From 3299e5f88906bab19d6d53aa86ead716d4bd2648 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sun, 26 Mar 2017 19:13:10 +0200 Subject: [PATCH 0001/1137] PRODUCT_PRICE_SUPPLIER_NO_LOG test inverted if PRODUCT_PRICE_SUPPLIER_NO_LOG is empty, no log is stored if PRODUCT_PRICE_SUPPLIER_NO_LOG is not empty log is stored they are inversion @eldy maybe add more field in this table --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index eaff46ddc2c..94034408e49 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -310,7 +310,7 @@ class ProductFournisseur extends Product $error++; } - if (! $error && ! empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { + if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { // Add record into log table $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price_log("; $sql .= "datec, fk_product_fournisseur,fk_user,price,quantity)"; From d8018f7937c2ae4c9a499df2eae9591876461735 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sun, 26 Mar 2017 19:16:19 +0200 Subject: [PATCH 0002/1137] add trigger on product price add/update --- .../product/class/productcustomerprice.class.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index fd36c55dcf9..9c2ce3e99d2 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -669,15 +669,12 @@ class Productcustomerprice extends CommonObject if (! $error) { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - // // Call triggers - // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - // $interface=new Interfaces($this->db); - // $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); - // if ($result < 0) { $error++; $this->errors=$interface->errors; } - // // End call triggers + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('CUSTOMER_PRODUCT_SELLPRICE_CREATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // End call triggers } } From d60f1d8402a085c54953af11471016f0383689a7 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sun, 26 Mar 2017 19:29:16 +0200 Subject: [PATCH 0003/1137] add price_level on product_customer_price_log fk_soc can be 0 when generic price is stored on log --- htdocs/install/mysql/tables/llx_product_customer_price_log.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product_customer_price_log.sql b/htdocs/install/mysql/tables/llx_product_customer_price_log.sql index 699060cdc98..1d728dd2486 100644 --- a/htdocs/install/mysql/tables/llx_product_customer_price_log.sql +++ b/htdocs/install/mysql/tables/llx_product_customer_price_log.sql @@ -24,7 +24,8 @@ create table llx_product_customer_price_log entity integer DEFAULT 1 NOT NULL, -- multi company id datec datetime, fk_product integer NOT NULL, - fk_soc integer NOT NULL, + fk_soc integer DEFAULT 0 NOT NULL, + price_level smallint NULL DEFAULT 1, price double(24,8) DEFAULT 0, price_ttc double(24,8) DEFAULT 0, price_min double(24,8) DEFAULT 0, From 9871bc3d9a006e6275eebbdaf6c0a6f78ad1bc92 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sun, 26 Mar 2017 19:35:00 +0200 Subject: [PATCH 0004/1137] Update 5.0.0-6.0.0.sql --- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 25145dc7cfe..bdc2630a4c4 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -25,6 +25,8 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_product_customer_price_log ADD COLUMN price_level smallint default 1; + ALTER TABLE llx_ecm_files ADD COLUMN ref varchar(128) AFTER rowid; ALTER TABLE llx_ecm_files CHANGE COLUMN fullpath filepath varchar(255); ALTER TABLE llx_ecm_files CHANGE COLUMN filepath filepath varchar(255); From 637e1a8d211a65c0c0cee59868df80e40d44ddb0 Mon Sep 17 00:00:00 2001 From: mikee2 Date: Sat, 6 May 2017 10:49:37 +0200 Subject: [PATCH 0005/1137] Update Segment.php Add additional needed fields so that you can invoice yearly items. Have number and text descriptions to avoid future changes that may break existing invoices. --- htdocs/includes/odtphp/Segment.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index 81e9dad9f97..4310c716ee7 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -170,8 +170,16 @@ class Segment implements IteratorAggregate, Countable { global $langs; - $patterns=array( '__CURRENTDAY__','__CURRENTDAYTEXT__','__CURRENTMONTHSHORT__','__CURRENTMONTH__','__CURRENTYEAR__' ); - $values=array( date('j'), $langs->trans(date('l')), $langs->trans(date('M')), $langs->trans(date('F')), date('Y') ); + $nextMonth = strtotime('+1 month'); + + $patterns=array( '/__CURRENTDAY__/u','/__CURRENTDAYTEXT__/u', + '/__CURRENTMONTH__/u','/__CURRENTMONTHSHORT__/u','/__CURRENTMONTHLONG__/u', + '/__NEXTMONTH__/u','/__NEXTMONTHSHORT__/u','/__NEXTMONTHLONG__/u', + '/__CURRENTYEAR__/u','/__NEXTYEAR__/u' ); + $values=array( date('j'), $langs->trans(date('l')), + $langs->trans(date('n')), $langs->trans(date('M')), $langs->trans(date('F')), + $langs->trans(date('n', $nextMonth)), $langs->trans(date('M', $nextMonth)), $langs->trans(date('F', $nextMonth)), + date('Y'), date('Y', strtotime('+1 year')) ); $text=preg_replace($patterns, $values, $text); From 44dba391c11a2a579771a2ee627e6fd13db4e50d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2017 10:24:16 +0200 Subject: [PATCH 0006/1137] New: add dictionnary sharing (multicompany) --- htdocs/admin/dict.php | 24 +++++------ htdocs/core/lib/functions.lib.php | 40 ++++++++++++------- .../install/mysql/migration/5.0.0-6.0.0.sql | 10 ++++- .../mysql/tables/llx_c_paiement.key.sql | 5 ++- .../install/mysql/tables/llx_c_paiement.sql | 11 +++-- .../mysql/tables/llx_c_payment_term.key.sql | 20 ++++++++++ .../mysql/tables/llx_c_payment_term.sql | 26 ++++++------ 7 files changed, 89 insertions(+), 47 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_c_payment_term.key.sql diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 22e7bf7087f..838f76aa296 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1,16 +1,16 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand - * Copyright (C) 2011 Remy Younes - * Copyright (C) 2012-2015 Marcos García - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro - * Copyright (C) 2015 Ferran Marcet - * Copyright (C) 2016 Raphaël Doursenaud +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2010-2016 Juanjo Menent + * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011 Remy Younes + * Copyright (C) 2012-2015 Marcos García + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2016 Raphaël Doursenaud * * 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 diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5113c9f1d96..454607d7dd1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -102,18 +102,21 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port) /** * Get list of entity id to use. * - * @param string $element Current element - * 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource', - * 'product', 'productprice', 'stock', - * 'propal', 'supplier_proposal', 'facture', 'facture_fourn', - * 'categorie', 'bank_account', 'bank_account', 'adherent', 'user', - * 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey', - * 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project', - * 'email_template', 'event', - * @param int $shared 1=Return id of current entity + shared entities (default), 0=Return id of current entity only + * @param string $element Current element + * 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource', + * 'product', 'productprice', 'stock', + * 'propal', 'supplier_proposal', 'facture', 'facture_fourn', + * 'categorie', 'bank_account', 'bank_account', 'adherent', 'user', + * 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey', + * 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project', + * 'email_template', 'event', + * @param int $shared 0=Return id of current entity only, + * 1=Return id of current entity + shared entities (default), + * 2=Return id of current entity OR $forceentity value (eg. dictionnary share) + * @param int $forceentity Entity id * @return mixed Entity id(s) to use */ -function getEntity($element=false, $shared=1) +function getEntity($element=false, $shared=1, $forceentity=null) { global $conf, $mc; @@ -124,14 +127,23 @@ function getEntity($element=false, $shared=1) if (is_object($mc)) { - return $mc->getEntity($element, $shared); + return $mc->getEntity($element, $shared, $forceentity); } else { $out=''; - $addzero = array('user', 'usergroup', 'email_template', 'default_values'); - if (in_array($element, $addzero)) $out.= '0,'; - $out.= $conf->entity; + + if ($shared == 2) + { + $out.= $forceentity; + } + else + { + $addzero = array('user', 'usergroup', 'email_template', 'default_values'); + if (in_array($element, $addzero)) $out.= '0,'; + $out.= $conf->entity; + } + return $out; } } diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 317fb6b7ff2..db67c58e51a 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -380,4 +380,12 @@ create table llx_loan_schedule fk_user_modif integer )ENGINE=innodb; -ALTER TABLE llx_tva ADD COLUMN datec date AFTER tms; \ No newline at end of file +ALTER TABLE llx_tva ADD COLUMN datec date AFTER tms; + +ALTER TABLE llx_c_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER id; +ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; +ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(entity, code); + +ALTER TABLE llx_c_payment_term ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; +ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(entity, code); + diff --git a/htdocs/install/mysql/tables/llx_c_paiement.key.sql b/htdocs/install/mysql/tables/llx_c_paiement.key.sql index 0d6686a774c..8c944e0c34d 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.key.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.key.sql @@ -1,5 +1,6 @@ -- ======================================================================== --- Copyright (C) 2012 Florian Henry +-- Copyright (C) 2012 Florian Henry +-- Copyright (C) 2017 Regis Houssin -- -- 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 @@ -16,4 +17,4 @@ -- -- ======================================================================== -ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(code); +ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index 1759af781f8..85e3cfb404d 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -1,7 +1,8 @@ -- ======================================================================== --- Copyright (C) 2001-2004 Rodolphe Quiedeville --- Copyright (C) 2004-2014 Laurent Destailleur --- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2004-2014 Laurent Destailleur +-- Copyright (C) 2014 Alexandre Spangaro +-- Copyright (C) 2017 Regis Houssin -- -- 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 @@ -21,6 +22,7 @@ create table llx_c_paiement ( id integer PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id code varchar(6) NOT NULL, libelle varchar(62), type smallint, -- 0: input money, 1: output money, 2: input and output, 3: other @@ -28,6 +30,3 @@ create table llx_c_paiement accountancy_code varchar(32) NULL, module varchar(32) NULL )ENGINE=innodb; - - - diff --git a/htdocs/install/mysql/tables/llx_c_payment_term.key.sql b/htdocs/install/mysql/tables/llx_c_payment_term.key.sql new file mode 100644 index 00000000000..e5977adf3cd --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_payment_term.key.sql @@ -0,0 +1,20 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- Copyright (C) 2017 Regis Houssin +-- +-- 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 3 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_payment_term.sql b/htdocs/install/mysql/tables/llx_c_payment_term.sql index a2d79af2502..6c55a6742b2 100644 --- a/htdocs/install/mysql/tables/llx_c_payment_term.sql +++ b/htdocs/install/mysql/tables/llx_c_payment_term.sql @@ -1,6 +1,7 @@ -- ============================================================================ --- Copyright (C) 2002-2003 Rodolphe Quiedeville --- Copyright (C) 2016 Laurent Destailleur +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2016 Laurent Destailleur +-- Copyright (C) 2017 Regis Houssin -- -- 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 @@ -19,14 +20,15 @@ create table llx_c_payment_term ( - rowid integer PRIMARY KEY, - code varchar(16), - sortorder smallint, - active tinyint DEFAULT 1, - libelle varchar(255), - libelle_facture text, - type_cdr tinyint, -- Type of change date reckoning. 1=Payment at end of current month, 2=the Nth of next month - nbjour smallint, - decalage smallint, - module varchar(32) NULL + rowid integer PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + code varchar(16), + sortorder smallint, + active tinyint DEFAULT 1, + libelle varchar(255), + libelle_facture text, + type_cdr tinyint, -- Type of change date reckoning. 1=Payment at end of current month, 2=the Nth of next month + nbjour smallint, + decalage smallint, + module varchar(32) NULL )ENGINE=innodb; From ade915af5f0485bf2d2a468af55df11fd50f09b7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2017 15:32:08 +0200 Subject: [PATCH 0007/1137] New: add dictionnary sharing (multicompany) --- htdocs/admin/dict.php | 85 +++++++++++++------ htdocs/core/lib/admin.lib.php | 20 ++--- htdocs/core/lib/functions.lib.php | 17 +--- .../install/mysql/migration/5.0.0-6.0.0.sql | 6 +- .../mysql/tables/llx_c_paiement.key.sql | 2 +- .../install/mysql/tables/llx_c_paiement.sql | 2 +- .../mysql/tables/llx_c_payment_term.key.sql | 2 +- .../mysql/tables/llx_c_payment_term.sql | 2 +- 8 files changed, 83 insertions(+), 53 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 86652fd7614..1f27fdd9dad 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -54,6 +54,7 @@ $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); $id=GETPOST('id','int'); $rowid=GETPOST('rowid','alpha'); +$entity=GETPOST('entity','int'); $allowed=$user->admin; if ($id == 7 && ! empty($user->rights->accounting->chartofaccount)) $allowed=1; // Tax page allowed to manager of chart account @@ -72,7 +73,7 @@ $active = 1; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); -if ($page == -1) { $page = 0 ; } +if (empty($page) || $page == -1) { $page = 0 ; } $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -176,8 +177,8 @@ $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as $tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c"; $tabsql[10]= "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; -$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder FROM ".MAIN_DB_PREFIX.'c_payment_term AS c'; -$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c"; +$tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = " . getEntity($tabname[12], 2); +$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = " . getEntity($tabname[13], 2); $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.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, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; @@ -250,8 +251,8 @@ $tabfield[8] = "code,libelle,country_id,country".(! empty($conf->global->SOCIETE $tabfield[9] = "code,label,unicode"; $tabfield[10]= "country_id,country,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle,position"; -$tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; -$tabfield[13]= "code,libelle,type,accountancy_code"; +$tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity"; +$tabfield[13]= "code,libelle,type,accountancy_code,entity"; $tabfield[14]= "code,libelle,price,organization,country_id,country"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle,sortorder"; @@ -324,8 +325,8 @@ $tabfieldinsert[8] = "code,libelle,fk_country".(! empty($conf->global->SOCIETE_S $tabfieldinsert[9] = "code_iso,label,unicode"; $tabfieldinsert[10]= "fk_pays,code,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[11]= "element,source,code,libelle,position"; -$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; -$tabfieldinsert[13]= "code,libelle,type,accountancy_code"; +$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity"; +$tabfieldinsert[13]= "code,libelle,type,accountancy_code,entity"; $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays"; $tabfieldinsert[15]= "code,label,width,height,unit"; $tabfieldinsert[16]= "code,label,sortorder"; @@ -703,7 +704,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } else if ($value == 'entity') { - $_POST[$listfieldvalue[$i]] = $conf->entity; + $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id], 2); } if ($i) $sql.=","; if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' @@ -751,7 +752,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } else if ($field == 'entity') { - $_POST[$listfieldvalue[$i]] = $conf->entity; + $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id], 2); } if ($i) $sql.=","; $sql.= $field."="; @@ -760,6 +761,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; + $sql.= " AND entity = '".getEntity($tabname[$id], 2)."'"; dol_syslog("actionmodify", LOG_DEBUG); //print $sql; @@ -782,7 +784,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } - $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'"; + $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); @@ -806,10 +808,10 @@ if ($action == $acts[0]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); } $result = $db->query($sql); @@ -826,10 +828,10 @@ if ($action == $acts[1]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); } $result = $db->query($sql); @@ -846,10 +848,10 @@ if ($action == 'activate_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); } $result = $db->query($sql); @@ -866,10 +868,10 @@ if ($action == 'disable_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); } $result = $db->query($sql); @@ -921,6 +923,7 @@ print "
\n"; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); +if ($entity >=0 ) $param.= '&entity='.$entity; $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; @@ -930,7 +933,7 @@ if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.$rowid.'&code='.urlencode($_GET["code"]).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.$rowid.'&code='.urlencode(GETPOST('code')).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); @@ -977,6 +980,7 @@ if ($id) if ($tabname[$id]) { $alabelisused=0; + $withentity=false; $fieldlist=explode(',',$tabfield[$id]); @@ -986,6 +990,11 @@ if ($id) print ''; foreach ($fieldlist as $field => $value) { + if ($fieldlist[$field] == 'entity') { + $withentity = getEntity($tabname[$id], 2); + continue; + } + // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut @@ -1076,6 +1085,8 @@ if ($id) if ($id == 4) print ''; print ''; print ''; + if (! empty($withentity)) + print ''; print ''; print ''; print ''; @@ -1156,7 +1167,9 @@ if ($id) $filterfound=0; foreach ($fieldlist as $field => $value) { - $showfield=1; // By defaut + if ($fieldlist[$field] == 'entity') continue; + + $showfield=1; // By default if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } @@ -1198,6 +1211,8 @@ if ($id) print ''; foreach ($fieldlist as $field => $value) { + if ($fieldlist[$field] == 'entity') continue; + // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut @@ -1305,12 +1320,16 @@ if ($id) $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields - if (empty($reshook)) fieldList($fieldlist, $obj, $tabname[$id], 'edit'); + if (empty($reshook)) { + $withentity = fieldList($fieldlist, $obj, $tabname[$id], 'edit'); + } print ''; print '
'; print ''; print ''; + if (! empty($withentity)) + print ''; print ''; print ''; print ''; @@ -1325,11 +1344,19 @@ if ($id) if (empty($reshook)) { + $withentity=false; + foreach ($fieldlist as $field => $value) { - $showfield=1; + $showfield=1; $align="left"; - $valuetoshow=$obj->{$fieldlist[$field]}; + $valuetoshow=$obj->{$fieldlist[$field]}; + + if ($fieldlist[$field] == 'entity') { + $withentity = $valuetoshow; + continue; + } + if ($value == 'element') { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; @@ -1521,7 +1548,8 @@ if ($id) // If rowidcol not defined if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid'; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); - if ($param) $url .= '&'.$param; + if (! empty($param)) $url .= '&'.$param; + if (! empty($withentity)) $url .= '&entity='.$withentity; $url.='&'; // Favorite @@ -1664,8 +1692,15 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') $formcompany = new FormCompany($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); + $withentity=false; + foreach ($fieldlist as $field => $value) { + if ($fieldlist[$field] == 'entity') { + $withentity = $obj->{$fieldlist[$field]}; + continue; + } + if (in_array($fieldlist[$field], array('code', 'libelle', 'type')) && $tabname == MAIN_DB_PREFIX."c_actioncomm" && in_array($obj->type, array('system','systemauto'))) { $hidden = (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''); @@ -1856,5 +1891,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; } } + + return $withentity; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6a0336aab38..98515f0271e 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -813,7 +813,7 @@ function activateModule($value,$withdeps=1) } $result=$objMod->init(); // Enable module - if ($result <= 0) + if ($result <= 0) { $ret['errors'][]=$objMod->error; } @@ -825,7 +825,7 @@ function activateModule($value,$withdeps=1) { // Activation of modules this module depends on // this->depends may be array('modModule1', 'mmodModule2') or array('always'=>"modModule1", 'FR'=>'modModule2') - foreach ($objMod->depend as $key => $modulestring) + foreach ($objMod->depends as $key => $modulestring) { if ((! is_numeric($key)) && $key != 'always' && $key != $mysoc->country_code) { @@ -848,19 +848,19 @@ function activateModule($value,$withdeps=1) break; } } - + if ($activate) { $ret['nbmodules']+=$resarray['nbmodules']; $ret['nbperms']+=$resarray['nbperms']; } - else + else { $ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring); } } } - + if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith)) { // Desactivation des modules qui entrent en conflit @@ -879,12 +879,12 @@ function activateModule($value,$withdeps=1) } } - if (! count($ret['errors'])) + if (! count($ret['errors'])) { $ret['nbmodules']++; $ret['nbperms']+=count($objMod->rights); } - + return $ret; } @@ -1221,7 +1221,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') if ($result) { $obj = $db->fetch_object($result); // Take first result of select - + // For avoid warning in strict mode if (empty($obj)) { @@ -1360,7 +1360,7 @@ function showModulesExludedForExternal($modules) //if (empty($conf->global->$moduleconst)) continue; if (! in_array($modulename,$listofmodules)) continue; //var_dump($modulename.'eee'.$langs->trans('Module'.$module->numero.'Name')); - + if ($i > 0) $text.=', '; else $text.=' '; $i++; @@ -1391,7 +1391,7 @@ function addDocumentModel($name, $type, $label='', $description='') $sql.= ($label?"'".$db->escape($label)."'":'null').", "; $sql.= (! empty($description)?"'".$db->escape($description)."'":"null"); $sql.= ")"; - + dol_syslog("admin.lib::addDocumentModel", LOG_DEBUG); $resql=$db->query($sql); if ($resql) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index de1cfafce0d..688624dc838 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -112,7 +112,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port) * 'email_template', 'event', * @param int $shared 0=Return id of current entity only, * 1=Return id of current entity + shared entities (default), - * 2=Return id of current entity OR $forceentity value (eg. dictionnary share) + * 2=Return id of current entity OR master entity 1 value (eg. dictionnary share) * @param int $forceentity Entity id * @return mixed Entity id(s) to use */ @@ -132,18 +132,9 @@ function getEntity($element=false, $shared=1, $forceentity=null) else { $out=''; - - if ($shared == 2) - { - $out.= $forceentity; - } - else - { - $addzero = array('user', 'usergroup', 'email_template', 'default_values'); - if (in_array($element, $addzero)) $out.= '0,'; - $out.= $conf->entity; - } - + $addzero = array('user', 'usergroup', 'email_template', 'default_values'); + if (in_array($element, $addzero)) $out.= '0,'; + $out.= $conf->entity; return $out; } } diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index ccc54b09026..996d218bf12 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -395,9 +395,11 @@ ALTER TABLE llx_usergroup_rights DROP INDEX fk_usergroup; ALTER TABLE llx_usergroup_rights ADD UNIQUE INDEX uk_usergroup_rights (entity, fk_usergroup, fk_id); ALTER TABLE llx_usergroup_rights ADD CONSTRAINT fk_usergroup_rights_fk_usergroup FOREIGN KEY (fk_usergroup) REFERENCES llx_usergroup (rowid); +ALTER TABLE llx_c_paiement DROP PRIMARY KEY ALTER TABLE llx_c_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER id; ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; -ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(entity, code); +ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(id, entity, code); +ALTER TABLE llx_c_payment_term DROP PRIMARY KEY ALTER TABLE llx_c_payment_term ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; -ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(entity, code); +ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(rowid, entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_paiement.key.sql b/htdocs/install/mysql/tables/llx_c_paiement.key.sql index 8c944e0c34d..ad1930fba2e 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.key.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.key.sql @@ -17,4 +17,4 @@ -- -- ======================================================================== -ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(entity, code); +ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(id, entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index 85e3cfb404d..60b4824748e 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -21,7 +21,7 @@ create table llx_c_paiement ( - id integer PRIMARY KEY, + id integer, entity integer DEFAULT 1 NOT NULL, -- multi company id code varchar(6) NOT NULL, libelle varchar(62), diff --git a/htdocs/install/mysql/tables/llx_c_payment_term.key.sql b/htdocs/install/mysql/tables/llx_c_payment_term.key.sql index e5977adf3cd..1bd86401945 100644 --- a/htdocs/install/mysql/tables/llx_c_payment_term.key.sql +++ b/htdocs/install/mysql/tables/llx_c_payment_term.key.sql @@ -17,4 +17,4 @@ -- -- ======================================================================== -ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(entity, code); +ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(rowid, entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_payment_term.sql b/htdocs/install/mysql/tables/llx_c_payment_term.sql index 6c55a6742b2..4ecfdea6134 100644 --- a/htdocs/install/mysql/tables/llx_c_payment_term.sql +++ b/htdocs/install/mysql/tables/llx_c_payment_term.sql @@ -20,7 +20,7 @@ create table llx_c_payment_term ( - rowid integer PRIMARY KEY, + rowid integer, entity integer DEFAULT 1 NOT NULL, -- multi company id code varchar(16), sortorder smallint, From 3bddbd3bdf78b2de8562c44e59ee814caf227d4c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2017 18:20:27 +0200 Subject: [PATCH 0008/1137] Fix: better test --- htdocs/admin/dict.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 1f27fdd9dad..e873e570930 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -784,7 +784,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } - $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); @@ -808,10 +808,10 @@ if ($action == $acts[0]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } $result = $db->query($sql); @@ -828,10 +828,10 @@ if ($action == $acts[1]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } $result = $db->query($sql); @@ -848,10 +848,10 @@ if ($action == 'activate_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } $result = $db->query($sql); @@ -868,10 +868,10 @@ if ($action == 'disable_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity >= 0 ? " AND entity = " . $entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); } $result = $db->query($sql); @@ -923,7 +923,7 @@ print "
\n"; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); -if ($entity >=0 ) $param.= '&entity='.$entity; +if ($entity != '') $param.= '&entity=' . (int)$entity; $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; From 73557151d295727c4c133b60e161d5a6e4b09d66 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2017 18:27:32 +0200 Subject: [PATCH 0009/1137] Fix: better test if entity equal 0 --- htdocs/admin/dict.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e873e570930..8cb30d6dd6e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -980,7 +980,7 @@ if ($id) if ($tabname[$id]) { $alabelisused=0; - $withentity=false; + $withentity=null; $fieldlist=explode(',',$tabfield[$id]); @@ -1085,7 +1085,7 @@ if ($id) if ($id == 4) print ''; print ''; print ''; - if (! empty($withentity)) + if (! is_null($withentity)) print ''; print ''; print ''; @@ -1328,7 +1328,7 @@ if ($id) print '
'; print ''; print ''; - if (! empty($withentity)) + if (! is_null($withentity)) print ''; print ''; print ''; @@ -1344,7 +1344,7 @@ if ($id) if (empty($reshook)) { - $withentity=false; + $withentity=null; foreach ($fieldlist as $field => $value) { @@ -1549,7 +1549,7 @@ if ($id) if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid'; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if (! empty($param)) $url .= '&'.$param; - if (! empty($withentity)) $url .= '&entity='.$withentity; + if (! is_null($withentity)) $url .= '&entity='.$withentity; $url.='&'; // Favorite @@ -1692,7 +1692,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') $formcompany = new FormCompany($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); - $withentity=false; + $withentity=null; foreach ($fieldlist as $field => $value) { From 0546f288232236ac71e7a432374d57f1dc118104 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2017 18:38:24 +0200 Subject: [PATCH 0010/1137] Fix: Travis error --- htdocs/admin/dict.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 8cb30d6dd6e..4f8b40e2259 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -784,7 +784,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } - $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : ''); dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); @@ -808,10 +808,10 @@ if ($action == $acts[0]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } $result = $db->query($sql); @@ -828,10 +828,10 @@ if ($action == $acts[1]) else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } $result = $db->query($sql); @@ -848,10 +848,10 @@ if ($action == 'activate_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } $result = $db->query($sql); @@ -868,10 +868,10 @@ if ($action == 'disable_favorite') else { $rowidcol="rowid"; } if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int)$entity: ''); + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag(GETPOST('code'))."'".($entity != '' ? " AND entity = " . (int) $entity : ''); } $result = $db->query($sql); @@ -923,7 +923,7 @@ print "
\n"; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); -if ($entity != '') $param.= '&entity=' . (int)$entity; +if ($entity != '') $param.= '&entity=' . (int) $entity; $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; From 4c70908ea2c9ec96893fb63b2bbc8a221e81c303 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 8 Jun 2017 18:52:01 +0200 Subject: [PATCH 0011/1137] Fix: entity field in combobox --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7a69172889e..01d28ecde24 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2743,7 +2743,8 @@ class Form $sql = "SELECT rowid, code, libelle as label"; $sql.= " FROM ".MAIN_DB_PREFIX.'c_payment_term'; - $sql.= " WHERE active > 0"; + $sql.= " WHERE entity = " . getEntity('c_payment_term', 2); + $sql.= " AND active > 0"; $sql.= " ORDER BY sortorder"; $resql = $this->db->query($sql); @@ -2958,6 +2959,7 @@ class Form $sql = "SELECT id, code, libelle as label, type, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement"; //if ($active >= 0) $sql.= " WHERE active = ".$active; + $sql.= " WHERE entity = " . getEntity('c_paiement', 2); $resql = $this->db->query($sql); if ($resql) From fa58f0f3e84886dd8960acc715124334f65bf46c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 09:25:15 +0200 Subject: [PATCH 0012/1137] Fix: add entity filter --- dev/initdata/import-thirdparties.php | 44 ++-- htdocs/adherents/subscription.php | 2 +- htdocs/cashdesk/validation_verif.php | 22 +- htdocs/comm/propal/class/propal.class.php | 26 +-- htdocs/commande/class/commande.class.php | 18 +- htdocs/compta/bank/bankentries.php | 46 ++-- htdocs/compta/bank/class/account.class.php | 55 ++--- htdocs/compta/bank/various_payment/index.php | 10 +- htdocs/compta/charges/index.php | 26 +-- htdocs/compta/facture/card.php | 10 +- .../facture/class/facture-rec.class.php | 156 +++++++------- htdocs/compta/facture/class/facture.class.php | 7 +- .../facture/class/paymentterm.class.php | 11 +- htdocs/compta/paiement.php | 67 +++--- htdocs/compta/paiement/avalider.php | 5 +- .../cheque/class/remisecheque.class.php | 18 +- .../compta/paiement/class/paiement.class.php | 53 ++--- htdocs/compta/paiement/list.php | 22 +- htdocs/compta/resultat/clientfourn.php | 22 +- htdocs/compta/resultat/index.php | 26 +-- htdocs/compta/salaries/index.php | 16 +- htdocs/compta/sociales/card.php | 41 ++-- .../sociales/class/chargesociales.class.php | 12 +- .../class/paymentsocialcontribution.class.php | 7 +- htdocs/compta/sociales/payments.php | 12 +- htdocs/compta/tva/reglement.php | 12 +- htdocs/core/class/commoninvoice.class.php | 31 +-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/translate.class.php | 61 +++--- htdocs/core/lib/functions.lib.php | 5 +- .../modules/facture/doc/pdf_crabe.modules.php | 38 ++-- htdocs/core/modules/modFacture.class.php | 26 +-- htdocs/core/modules/modSalaries.class.php | 10 +- htdocs/core/modules/modSociete.class.php | 4 +- .../modules/rapport/pdf_paiement.class.php | 3 +- .../rapport/pdf_paiement_fourn.class.php | 3 +- .../pdf/pdf_canelle.modules.php | 2 +- htdocs/don/card.php | 1 + htdocs/don/class/don.class.php | 6 +- htdocs/don/class/paymentdonation.class.php | 11 +- htdocs/expensereport/card.php | 197 +++++++++--------- .../class/expensereport.class.php | 97 ++++----- .../class/paymentexpensereport.class.php | 9 +- .../class/fournisseur.commande.class.php | 68 +++--- .../fourn/class/fournisseur.facture.class.php | 10 +- htdocs/fourn/class/paiementfourn.class.php | 33 +-- htdocs/fourn/facture/card.php | 2 +- htdocs/fourn/facture/paiement.php | 74 +++---- htdocs/loan/card.php | 1 + htdocs/loan/class/loanschedule.class.php | 1 + htdocs/loan/class/paymentloan.class.php | 1 + .../class/supplier_proposal.class.php | 80 +++---- 52 files changed, 780 insertions(+), 742 deletions(-) diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index 08ad248ecc0..05fd0689102 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -21,7 +21,7 @@ /** * \file dev/initdata/import-thirdparties.php - * \brief Script example to insert thirdparties from a csv file. + * \brief Script example to insert thirdparties from a csv file. * To purge data, you can have a look at purge-data.php */ @@ -123,15 +123,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) if ($endlinenb && $i > $endlinenb) continue; $nboflines++; - + $object = new Societe($db); $object->state = $fields[6]; $object->client = $fields[7]; $object->fournisseur = $fields[8]; - + $object->name = $fields[13]?trim($fields[13]):$fields[0]; $object->name_alias = $fields[0]!=$fields[13]?trim($fields[0]):''; - + $object->address = trim($fields[14]); $object->zip = trim($fields[15]); $object->town = trim($fields[16]); @@ -149,7 +149,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $condpayment = trim($fields[36]); if ($condpayment == 'A la commande') $condpayment = 'A réception de commande'; if ($condpayment == 'A reception facture') $condpayment = 'Réception de facture'; - $object->cond_reglement_id = dol_getIdFromCode($db, $condpayment, 'c_payment_term', 'libelle_facture', 'rowid'); + $object->cond_reglement_id = dol_getIdFromCode($db, $condpayment, 'c_payment_term', 'libelle_facture', 'rowid', getEntity('c_payment_term', 2)); if (empty($object->cond_reglement_id)) { print " - Error cant find payment mode for ".$condpayment."\n"; @@ -166,7 +166,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) // Set price level $object->price_level = 1; if ($labeltype == 'Revendeur') $object->price_level = 2; - + print "Process line nb ".$i.", name ".$object->name; @@ -182,7 +182,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - Creation OK with name ".$object->name." - id = ".$ret; } @@ -198,7 +198,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) if (! $errorrecord && $fields[3]) { $salesrep=new User($db); - + $tmp=explode(' ',$fields[3],2); $salesrep->firstname = trim($tmp[0]); $salesrep->lastname = trim($tmp[1]); @@ -206,7 +206,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) else $salesrep->login=strtolower($salesrep->firstname); $salesrep->login=preg_replace('/ /','',$salesrep->login); $salesrep->fetch(0,$salesrep->login); - + $result = $object->add_commercial($user, $salesrep->id); if ($result < 0) { @@ -217,14 +217,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { print " - create link sale representative OK"; } - } - + } + dol_syslog("Add invoice contacts"); // Insert an invoice contact if there is an invoice email != standard email if (! $errorrecord && $fields[27] && $fields[26] != $fields[27]) { $ret1=$ret2=0; - + $contact = new Contact($db); $contact->lastname = $object->name; $contact->address=$object->address; @@ -233,7 +233,7 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $contact->country_id=$object->country_id; $contact->email=$fields[27]; $contact->socid=$object->id; - + $ret1=$contact->create($user); if ($ret1 > 0) { @@ -244,18 +244,18 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - create contact OK"; } } - + dol_syslog("Add delivery contacts"); // Insert a delivery contact if (! $errorrecord && $fields[47]) { $ret1=$ret2=0; - + $contact2 = new Contact($db); $contact2->lastname = 'Service livraison - '.$fields[47]; $contact2->address = $fields[48]; @@ -264,10 +264,10 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $contact2->country_id=dol_getIdFromCode($db, trim($fields[52]), 'c_country', 'code', 'rowid'); $contact2->note_public=$fields[54]; $contact2->socid=$object->id; - + // Extrafields $contact2->array_options['options_anazoneliv']=price2num($fields[53]); - + $ret1=$contact2->create($user); if ($ret1 > 0) { @@ -278,16 +278,16 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in create contact result code = ".$ret1." ".$ret2." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - create contact OK"; } } - + print "\n"; - - if ($errorrecord) + + if ($errorrecord) { fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n"); $error++; // $errorrecord will be reset diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 21de6e305b5..30853e2dedf 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -442,7 +442,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $paiement = new Paiement($db); $paiement->datepaye = $paymentdate; $paiement->amounts = $amounts; - $paiement->paiementid = dol_getIdFromCode($db,$operation,'c_paiement'); + $paiement->paiementid = dol_getIdFromCode($db,$operation,'c_paiement','code','id',getEntity('c_paiement', 2)); $paiement->num_paiement = $num_chq; $paiement->note = $label; diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index 5e4ed9b028e..c28df626bc5 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -45,14 +45,14 @@ switch ($action) case 'valide_achat': $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; - + $company=new Societe($db); $company->fetch($thirdpartyid); $invoice=new Facture($db); $invoice->date=dol_now(); $invoice->type= Facture::TYPE_STANDARD; - + // To use a specific numbering module for POS, reset $conf->global->FACTURE_ADDON and other vars here // and restore values just after $sav_FACTURE_ADDON=''; @@ -68,7 +68,7 @@ switch ($action) // To force rule only for POS with mercure //... } - + $num=$invoice->getNextNumRef($company); // Restore save values @@ -76,7 +76,7 @@ switch ($action) { $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; } - + $obj_facturation->numInvoice($num); $obj_facturation->getSetPaymentMode($_POST['hdnChoix']); @@ -137,7 +137,7 @@ switch ($action) $cond_reglement_id = 0; break; case 'ESP': - $mode_reglement_id = dol_getIdFromCode($db,'LIQ','c_paiement'); + $mode_reglement_id = dol_getIdFromCode($db,'LIQ','c_paiement','code','id',getEntity('c_paiement', 2)); $cond_reglement_id = 0; $note .= $langs->trans("Cash")."\n"; $note .= $langs->trans("Received").' : '.$obj_facturation->montantEncaisse()." ".$conf->currency."\n"; @@ -146,11 +146,11 @@ switch ($action) $note .= '--------------------------------------'."\n\n"; break; case 'CB': - $mode_reglement_id = dol_getIdFromCode($db,'CB','c_paiement'); + $mode_reglement_id = dol_getIdFromCode($db,'CB','c_paiement','code','id',getEntity('c_paiement', 2)); $cond_reglement_id = 0; break; case 'CHQ': - $mode_reglement_id = dol_getIdFromCode($db,'CHQ','c_paiement'); + $mode_reglement_id = dol_getIdFromCode($db,'CHQ','c_paiement','code','id',getEntity('c_paiement', 2)); $cond_reglement_id = 0; break; } @@ -192,10 +192,10 @@ switch ($action) $invoiceline->remise_percent=$tab_liste[$i]['remise_percent']; $invoiceline->price=$tab_liste[$i]['price']; $invoiceline->subprice=$tab_liste[$i]['price']; - + $invoiceline->tva_tx=empty($vat_rate)?0:$vat_rate; // works even if vat_rate is '' $invoiceline->info_bits=empty($vat_npr)?0:$vat_npr; - + $invoiceline->total_ht=$tab_liste[$i]['total_ht']; $invoiceline->total_ttc=$tab_liste[$i]['total_ttc']; $invoiceline->total_tva=$tab_liste[$i]['total_vat']; @@ -224,7 +224,7 @@ switch ($action) { $warehouseidtodecrease=(isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0); if (! empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $warehouseidtodecrease=0; // If a particular stock is defined, we disable choice - + $resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), 0); if ($warehouseidtodecrease > 0) @@ -264,7 +264,7 @@ switch ($action) { $warehouseidtodecrease=(isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0); if (! empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) $warehouseidtodecrease=0; // If a particular stock is defined, we disable choice - + $resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), 0); if ($warehouseidtodecrease > 0) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index fb1ac46cd91..dfebeae6893 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -254,7 +254,7 @@ class Propal extends CommonObject $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; $vat_src_code = ''; // May be defined into tva_tx - + $localtax1_tx = get_localtax($tva_tx,1,$mysoc,$this->thirdparty,$tva_npr); $localtax2_tx = get_localtax($tva_tx,2,$mysoc,$this->thirdparty,$tva_npr); @@ -433,7 +433,7 @@ class Propal extends CommonObject // Check parameters if ($type < 0) return -1; - + if ($this->statut == self::STATUS_DRAFT) { $this->db->begin(); @@ -1270,8 +1270,8 @@ class Propal extends CommonObject $sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc"; $sql.= ", cp.code as mode_reglement_code, cp.libelle as mode_reglement"; $sql.= " FROM ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."propal as p"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_mode_reglement = cp.id'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON p.fk_cond_reglement = cr.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_mode_reglement = cp.id AND cp.entity = ' . getEntity('c_paiement', 2); + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON p.fk_cond_reglement = cr.rowid AND cr.entity = ' . getEntity('c_payment_term', 2); $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON p.fk_availability = ca.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON p.fk_incoterms = i.rowid'; @@ -1392,17 +1392,17 @@ class Propal extends CommonObject return -1; } } - + /** * Load array lines - * + * * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ function fetch_lines($only_product=0) { $this->lines=array(); - + $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; $sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,'; $sql.= ' d.fk_unit,'; @@ -1422,7 +1422,7 @@ class Propal extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $num = $this->db->num_rows($result); - + $i = 0; while ($i < $num) { @@ -1489,9 +1489,9 @@ class Propal extends CommonObject //print "xx $i ".$this->lines[$i]->fk_product; $i++; } - + $this->db->free($result); - + return 1; } else @@ -2779,7 +2779,7 @@ class Propal extends CommonObject function availability($availability_id, $notrigger=0) { global $user; - + if ($this->statut >= self::STATUS_DRAFT) { $error=0; @@ -3352,9 +3352,9 @@ class Propal extends CommonObject function getLinesArray() { // TODO Duplicate with fetch_lines ? Wich one to keep ? - + $this->lines = array(); - + $sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,'; $sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 93df2f1aa0b..eafb406ba58 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -706,10 +706,10 @@ class Commande extends CommonOrder // Clean parameters $this->brouillon = 1; // set command as draft - + // $date_commande is deprecated $date = ($this->date_commande ? $this->date_commande : $this->date); - + // Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); @@ -1468,7 +1468,7 @@ class Commande extends CommonOrder $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; $vat_src_code = ''; // May be defined into tva_tx - + $localtax1_tx=get_localtax($tva_tx,1,$this->thirdparty,$mysoc,$tva_npr); $localtax2_tx=get_localtax($tva_tx,2,$this->thirdparty,$mysoc,$tva_npr); @@ -1559,8 +1559,8 @@ class Commande extends CommonOrder $sql.= ', ca.code as availability_code, ca.label as availability_label'; $sql.= ', dr.code as demand_reason_code'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON (c.fk_mode_reglement = p.id)'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid AND cr.entity = ' . getEntity('c_payment_term', 2) . ')'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON (c.fk_mode_reglement = p.id AND cr.entity = ' . getEntity('c_paiement', 2) . ')'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON (c.fk_availability = ca.rowid)'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON (c.fk_input_reason = ca.rowid)'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; @@ -1798,7 +1798,7 @@ class Commande extends CommonOrder $line->product_type = $objp->product_type; $line->qty = $objp->qty; - $line->vat_src_code = $objp->vat_src_code; + $line->vat_src_code = $objp->vat_src_code; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; @@ -3106,7 +3106,7 @@ class Commande extends CommonOrder $error = 0; dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); - + $this->db->begin(); if (! $error && ! $notrigger) @@ -3381,7 +3381,7 @@ class Commande extends CommonOrder global $conf, $langs, $user; if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - + $result=''; if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; @@ -3418,7 +3418,7 @@ class Commande extends CommonOrder $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; } - + $linkstart = ''; $linkend=''; diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index 5f6d5156b72..1f9f089270f 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -407,7 +407,7 @@ if ($id > 0 || ! empty($ref)) dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_fiche_end(); - + /* * Buttons actions */ @@ -521,10 +521,10 @@ if (($id > 0 || ! empty($ref)) && ((string) $page == '')) $offset = $limit * $page; if ($page < 0) $page = 0; } -if ($page >= $nbtotalofpages) +if ($page >= $nbtotalofpages) { // If we made a search and result has low page than the page number we were on - $page = ($nbtotalofpages -1); + $page = ($nbtotalofpages -1); $offset = $limit * $page; if ($page < 0) $page = 0; } @@ -598,7 +598,7 @@ if ($resql) print ''; print ' '.$langs->trans("or").' '; print ''; - + // Show last bank statements $nbmax=15; // We accept to show last 15 receipts (so we can have more than one year) $liste=""; @@ -703,8 +703,8 @@ if ($resql) $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - - if ($moreforfilter) + + if ($moreforfilter) { print '
'; print $moreforfilter; @@ -718,7 +718,7 @@ if ($resql) print ''."\n"; print ''; - if (! empty($arrayfields['b.rowid']['checked'])) + if (! empty($arrayfields['b.rowid']['checked'])) { print ''; // Ref - if (! empty($arrayfields['b.rowid']['checked'])) + if (! empty($arrayfields['b.rowid']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } // Date value - if (! empty($arrayfields['b.datev']['checked'])) + if (! empty($arrayfields['b.datev']['checked'])) { print '\n"; @@ -1081,7 +1081,7 @@ if ($resql) } // Third party - if (! empty($arrayfields['bu.label']['checked'])) + if (! empty($arrayfields['bu.label']['checked'])) { print "'; - if (! $i) $totalarray['nbfield']++; - + if (! $i) $totalarray['nbfield']++; + // Action column print ''; - + // Ref print ''; - + // Ref supplier print ''; - + // Date if ($objp->df > 0 ) { @@ -470,13 +470,13 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { print ''; } - + // Multicurrency - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { // Currency print '\n"; - + print ''; print ''; - + print ''; - + print ''; - + print ''; - + print '"; - + // Multicurrency - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { print '"; } - + print "\n"; $total+=$objp->total_ht; $total_ttc+=$objp->total_ttc; @@ -549,7 +549,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print "\n"; } print "
'; print ''; @@ -840,19 +840,19 @@ if ($resql) $sign = 1; $totalarray=array(); - while ($i < min($num,$limit)) + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); // If we are in a situation where we need/can show balance, we calculate the start of balance if (! $balancecalculated && ! empty($arrayfields['balance']['checked']) && $mode_balance_ok) { - if (! $account) + if (! $account) { dol_print_error('', 'account is not defined but $mode_balance_ok is true'); exit; } - + //Loop on each record $sign = 1; $i = 0; @@ -875,7 +875,7 @@ if ($resql) } } else dol_print_error($db); - + $balancecalculated=true; } @@ -896,7 +896,7 @@ if ($resql) print '
'; print "rowid.'">'.img_object($langs->trans("ShowPayment").': '.$objp->rowid, 'account', 'class="classfortooltip"').' '.$objp->rowid."   "; @@ -908,14 +908,14 @@ if ($resql) if (! empty($arrayfields['description']['checked'])) { print ""; - + //print "rowid."&account=".$objp->fk_account."\">"; $reg=array(); preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); else print dol_trunc($objp->label,40); //print " "; - + // Add links after description $links = $bankaccountstatic->get_url($objp->rowid); $cachebankaccount=array(); @@ -1040,14 +1040,14 @@ if ($resql) } // Date ope - if (! empty($arrayfields['b.dateo']['checked'])) + if (! empty($arrayfields['b.dateo']['checked'])) { print ''.dol_print_date($db->jdate($objp->do),"day")."'; print ''.dol_print_date($db->jdate($objp->dv),"day").""; @@ -1063,10 +1063,10 @@ if ($resql) } // Payment type - if (! empty($arrayfields['type']['checked'])) + if (! empty($arrayfields['type']['checked'])) { print ''; - $labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle'); + $labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle','',getEntity('c_paiement', 2)); if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance"); else print $labeltype; print ""; if ($objp->url_id) @@ -1106,7 +1106,7 @@ if ($resql) } // Bank account - if (! empty($arrayfields['ba.ref']['checked'])) + if (! empty($arrayfields['ba.ref']['checked'])) { print ''; print $bankaccount->getNomUrl(1); @@ -1174,7 +1174,7 @@ if ($resql) print ''.$objp->num_releve.''; } else if ($action == 'reconcile') - { + { print 'rowid])?' checked':'').'>'; } } @@ -1229,8 +1229,8 @@ if ($resql) } } print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 43b6dace19c..5330eca86a4 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -39,7 +39,7 @@ class Account extends CommonObject public $element = 'bank_account'; public $table_element = 'bank_account'; public $picto = 'account'; - + /** * @var int Use id instead of rowid * @deprecated @@ -411,8 +411,9 @@ class Account extends CommonObject if (is_numeric($oper)) // Clean oper to have a code instead of a rowid { - $sql ="SELECT code FROM ".MAIN_DB_PREFIX."c_paiement"; - $sql.=" WHERE id=".$oper; + $sql = "SELECT code FROM ".MAIN_DB_PREFIX."c_paiement"; + $sql.= " WHERE id=".$oper; + $sql.= " AND entity = " . getEntity('c_payement_term', 2) . ")"; $resql=$this->db->query($sql); if ($resql) { @@ -538,7 +539,7 @@ class Account extends CommonObject $now=dol_now(); $this->db->begin(); - + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account ("; $sql.= "datec"; $sql.= ", ref"; @@ -619,14 +620,14 @@ class Account extends CommonObject $result=$this->insertExtraFields(); if ($result < 0) $error++; } - + if (! $error && ! $notrigger) { // Call trigger $result=$this->call_trigger('BANKACCOUNT_CREATE',$user); if ($result < 0) $error++; // End call triggers - } + } } else { @@ -670,9 +671,9 @@ class Account extends CommonObject global $langs,$conf, $hookmanager; $error=0; - + $this->db->begin(); - + // Clean parameters $this->state_id = ($this->state_id?$this->state_id:$this->state_id); $this->country_id = ($this->country_id?$this->country_id:$this->country_id); @@ -739,7 +740,7 @@ class Account extends CommonObject if ($result < 0) $error++; } } - + if (! $error && ! $notrigger) { // Call trigger @@ -754,7 +755,7 @@ class Account extends CommonObject $this->error=$this->db->lasterror(); dol_print_error($this->db); } - + if (! $error) { $this->db->commit(); @@ -906,7 +907,7 @@ class Account extends CommonObject $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_update = $this->db->jdate($obj->date_update); - + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); @@ -983,15 +984,15 @@ class Account extends CommonObject global $conf; $error=0; - + $this->db->begin(); - + // Delete link between tag and bank account if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account"; $sql.= " WHERE fk_account = ".$this->id; - + $resql = $this->db->query($sql); if (!$resql) { @@ -999,15 +1000,15 @@ class Account extends CommonObject $this->error = "Error ".$this->db->lasterror(); } } - + if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE rowid = ".$this->rowid; - + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); - if ($result) + if ($result) { // Remove extrafields if ((empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used @@ -1020,13 +1021,13 @@ class Account extends CommonObject } } } - else + else { $error++; $this->error = "Error ".$this->db->lasterror(); - } + } } - + if (! $error) { $this->db->commit(); @@ -1433,7 +1434,7 @@ class Account extends CommonObject * - DeskCode * * Some countries show less or more bank account properties to the user - * + * * @param int $includeibanbic 1=Return also key for IBAN and BIC * @return array * @see useDetailedBBAN @@ -1554,7 +1555,7 @@ class AccountLine extends CommonObject var $element='bank'; var $table_element='bank'; var $picto = 'generic'; - + var $id; var $ref; var $datec; @@ -1842,7 +1843,7 @@ class AccountLine extends CommonObject function update_conciliation(User $user, $cat) { global $conf; - + $this->db->begin(); // Check statement field @@ -1854,7 +1855,7 @@ class AccountLine extends CommonObject return -1; } } - + $sql = "UPDATE ".MAIN_DB_PREFIX."bank SET"; $sql.= " rappro = 1"; $sql.= ", num_releve = '".$this->db->escape($this->num_releve)."'"; @@ -2042,7 +2043,7 @@ class AccountLine extends CommonObject return $result; } - + /** * Return label of status (activity, closed) * @@ -2053,7 +2054,7 @@ class AccountLine extends CommonObject { return $this->LibStatut($this->status,$mode); } - + /** * Renvoi le libelle d'un statut donne * @@ -2097,6 +2098,6 @@ class AccountLine extends CommonObject if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"'); }*/ } - + } diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 39c6d27be4f..5cea33d5baa 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -92,7 +92,7 @@ $sql = "SELECT v.rowid, v.amount, v.label, v.datep as datep, v.datev as datev, v $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,"; $sql.= " pst.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON v.fk_typepayment = pst.id"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON v.fk_typepayment = pst.id AND pst.entity = " . getEntity('c_paiement', 2); $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " WHERE v.entity = ".$conf->entity; @@ -142,9 +142,9 @@ if ($result) print ''; print ''; print ''; - + print_barre_liste($langs->trans("VariousPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); - + print '
'; print ''."\n"; @@ -188,13 +188,13 @@ if ($result) $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; - + print "\n"; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - + print ''; $variousstatic->id=$obj->rowid; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index d494f778df0..715d1c96627 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -92,7 +92,7 @@ print ''; print ''; print ''; -if ($mode != 'sconly') +if ($mode != 'sconly') { $center=($year?''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."":""); print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); @@ -139,7 +139,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id AND pct.entity = " . getEntity('c_paiement', 2); $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " WHERE cs.fk_type = c.id"; @@ -260,7 +260,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pv.fk_typepayment = pct.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pv.fk_typepayment = pct.id AND pct.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE pv.entity = ".$conf->entity; if ($year > 0) { @@ -294,7 +294,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -309,12 +309,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) // Date print '\n"; - + // Type payment print ''; - + // Account if (! empty($conf->banque->enabled)) { @@ -333,7 +333,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) else print ' '; print ''; } - + // Paid print '"; print "\n"; @@ -424,7 +424,7 @@ while($j<$numlt) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -465,7 +465,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $sal = new PaymentSalary($db); print "
"; - + print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,"; @@ -474,7 +474,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON s.fk_typepayment = pct.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON s.fk_typepayment = pct.id AND pct.entity = " . getEntity('c_paiement', 2); $sql.= " , ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE s.entity IN (".getEntity('user').")"; $sql.= " AND u.rowid = s.fk_user"; @@ -508,7 +508,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -527,7 +527,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print ''; - + // Account if (! empty($conf->banque->enabled)) { @@ -546,7 +546,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) else print ' '; print ''; } - + // Paid print '"; print "\n"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e9be0a0b962..319369fa304 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -649,9 +649,12 @@ if (empty($reshook)) { // If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT - $sql = 'SELECT SUM(pf.amount) as total_paiements - FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p - WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid ORDER BY p.datep, p.tms'; + $sql = 'SELECT SUM(pf.amount) as total_paiements'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p'; + $sql.= ' WHERE pf.fk_facture = '.$object->id; + $sql.= ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; + $sql.= ' AND p.entity = ' . getEntity('c_paiement', 2); + $sql.= ' ORDER BY p.datep, p.tms'; $resql = $db->query($sql); $res = $db->fetch_object($resql); @@ -3693,6 +3696,7 @@ else if ($id > 0 || ! empty($ref)) $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; + $sql .= ' AND c.entity = ' . getEntity('c_paiement', 2); $sql .= ' ORDER BY p.datep, p.tms'; $result = $db->query($sql); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 6bc88e47490..6e7f2580859 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -43,7 +43,7 @@ class FactureRec extends CommonInvoice public $table_element_line='facturedet_rec'; public $fk_element='fk_facture'; public $picto='bill'; - + var $entity; var $number; var $date; @@ -58,7 +58,7 @@ class FactureRec extends CommonInvoice var $date_when; var $nb_gen_done; var $nb_gen_max; - + var $rang; var $special_code; @@ -91,20 +91,20 @@ class FactureRec extends CommonInvoice // Clean parameters $this->titre=trim($this->titre); $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; - + // No frequency defined then no next date to execution - if (empty($this->frequency)) + if (empty($this->frequency)) { $this->frequency=0; $this->date_when=NULL; } - - + + $this->frequency=abs($this->frequency); $this->nb_gen_done=0; $this->nb_gen_max=empty($this->nb_gen_max)?0:$this->nb_gen_max; $this->auto_validate=empty($this->auto_validate)?0:$this->auto_validate; - + $this->db->begin(); // Charge facture modele @@ -197,7 +197,7 @@ class FactureRec extends CommonInvoice $error++; } } - + // Add object linked if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) { @@ -210,7 +210,7 @@ class FactureRec extends CommonInvoice $error++; } } - } + } if ($error) { @@ -259,8 +259,8 @@ class FactureRec extends CommonInvoice $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; //$sql.= ', el.fk_source'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid AND c.entity = ' . getEntity('c_payment_term', 2); + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id AND p.entity = ' . getEntity('c_paiement', 2); //$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; if ($rowid) $sql.= ' WHERE f.rowid='.$rowid; elseif ($ref) $sql.= " WHERE f.titre='".$this->db->escape($ref)."'"; @@ -268,7 +268,7 @@ class FactureRec extends CommonInvoice if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; */ - + $result = $this->db->query($sql); if ($result) { @@ -361,8 +361,8 @@ class FactureRec extends CommonInvoice { return $this->fetch_lines(); } - - + + /** * Recupere les lignes de factures predefinies dans this->lines * @@ -386,7 +386,7 @@ class FactureRec extends CommonInvoice $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; $sql.= ' WHERE l.fk_facture = '.$this->id; $sql.= ' ORDER BY l.rang'; - + dol_syslog('FactureRec::fetch_lines', LOG_DEBUG); $result = $this->db->query($sql); if ($result) @@ -431,7 +431,7 @@ class FactureRec extends CommonInvoice $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; $line->fk_contract_line = $objp->fk_contract_line; - + // Ne plus utiliser $line->price = $objp->price; $line->remise = $objp->remise; @@ -463,12 +463,12 @@ class FactureRec extends CommonInvoice function delete($user, $notrigger=0, $idwarehouse=-1) { $rowid=$this->id; - + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); - + $error=0; $this->db->begin(); - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid; dol_syslog($sql); if ($this->db->query($sql)) @@ -486,7 +486,7 @@ class FactureRec extends CommonInvoice $this->error=$this->db->lasterror(); $error=-2; } - + if (! $error) { $this->db->commit(); @@ -525,7 +525,7 @@ class FactureRec extends CommonInvoice function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null) { global $mysoc; - + $facid=$this->id; dol_syslog(get_class($this)."::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG); @@ -578,7 +578,7 @@ class FactureRec extends CommonInvoice $total_ttc = $tabprice[2]; $total_localtax1=$tabprice[9]; $total_localtax2=$tabprice[10]; - + $product_type=$type; if ($fk_product) { @@ -679,12 +679,12 @@ class FactureRec extends CommonInvoice function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null) { global $mysoc; - + $facid=$this->id; - + dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - + // Check parameters if ($type < 0) return -1; @@ -709,7 +709,7 @@ class FactureRec extends CommonInvoice $txtva=price2num($txtva); $txlocaltax1 = price2num($txlocaltax1); $txlocaltax2 = price2num($txlocaltax2); - + if ($price_base_type=='HT') { $pu=$pu_ht; @@ -718,7 +718,7 @@ class FactureRec extends CommonInvoice { $pu=$pu_ttc; } - + // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker @@ -730,7 +730,7 @@ class FactureRec extends CommonInvoice $total_ttc = $tabprice[2]; $total_localtax1=$tabprice[9]; $total_localtax2=$tabprice[10]; - + $product_type=$type; if ($fk_product) { @@ -738,7 +738,7 @@ class FactureRec extends CommonInvoice $result=$product->fetch($fk_product); $product_type=$product->type; } - + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; $sql.= "fk_facture = '".$facid."'"; $sql.= ", label=".(! empty($label)?"'".$this->db->escape($label)."'":"null"); @@ -778,12 +778,12 @@ class FactureRec extends CommonInvoice return -1; } } - } - - + } + + /** - * Return the next date of - * + * Return the next date of + * * @return timestamp false if KO, timestamp if OK */ function getNextDate() @@ -791,27 +791,27 @@ class FactureRec extends CommonInvoice if (empty($this->date_when)) return false; return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency); } - + /** * Create all recurrents invoices (for all entities if multicompany is used). * A result may also be provided into this->output. - * - * WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found. - * - * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + * + * WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found. + * + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ function createRecurringInvoices() { global $conf, $langs, $db, $user; - + $langs->load("bills"); - + $nb_create=0; - + $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day - + dol_syslog("createRecurringInvoices"); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec'; $sql.= ' WHERE frequency > 0'; // A recurring invoice is an invoice with a frequency @@ -819,30 +819,30 @@ class FactureRec extends CommonInvoice $sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)'; $sql.= $db->order('entity', 'ASC'); //print $sql;exit; - + $resql = $db->query($sql); if ($resql) { $i=0; $num = $db->num_rows($resql); - + if ($num) $this->output.=$langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; else $this->output.=$langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); - + $saventity = $conf->entity; - + while ($i < $num) // Loop on each template invoice { $line = $db->fetch_object($resql); $db->begin(); - + $facturerec = new FactureRec($db); $facturerec->fetch($line->rowid); - + // Set entity context $conf->entity = $facturerec->entity; - + dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity); $error=0; @@ -850,12 +850,12 @@ class FactureRec extends CommonInvoice $facture = new Facture($db); $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice - + $facture->type = self::TYPE_STANDARD; $facture->brouillon = 1; $facture->date = $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; - + $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) { @@ -888,16 +888,16 @@ class FactureRec extends CommonInvoice $i++; } - + $conf->entity = $saventity; // Restore entity context } else dol_print_error($db); - + $this->output=trim($this->output); - + return $error?$error:0; } - + /** * Return clicable name (with picto eventually) * @@ -914,13 +914,13 @@ class FactureRec extends CommonInvoice $result=''; $label=$langs->trans("ShowInvoice").': '.$this->ref; - + $url = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id; - + if ($short) return $url; - + $picto='bill'; - + $link = ''; $linkend=''; @@ -952,7 +952,7 @@ class FactureRec extends CommonInvoice // Load array of products prodids $num_prods = 0; $prodids = array(); - + $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE entity IN (".getEntity('product').")"; @@ -1065,7 +1065,7 @@ class FactureRec extends CommonInvoice $this->lines[$xnbp]=$line; $xnbp++; } - + $this->usenewprice = 1; } @@ -1085,7 +1085,7 @@ class FactureRec extends CommonInvoice return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } - + /** * Update frequency and unit * @@ -1109,12 +1109,12 @@ class FactureRec extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET frequency = '.($frequency?$this->db->escape($frequency):'null'); - if (!empty($unit)) + if (!empty($unit)) { $sql.= ', unit_frequency = \''.$this->db->escape($unit).'\''; } $sql.= ' WHERE rowid = '.$this->id; - + dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG); if ($this->db->query($sql)) { @@ -1128,7 +1128,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the next date of execution * @@ -1161,7 +1161,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the maximum period * @@ -1175,9 +1175,9 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined",LOG_ERR); return -1; } - + if (empty($nb)) $nb=0; - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET nb_gen_max = '.$nb; $sql.= ' WHERE rowid = '.$this->id; @@ -1194,7 +1194,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the auto validate invoice * @@ -1208,7 +1208,7 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined",LOG_ERR); return -1; } - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET auto_validate = '.$validate; $sql.= ' WHERE rowid = '.$this->id; @@ -1235,7 +1235,7 @@ class FactureRec extends CommonInvoice */ class FactureLigneRec extends CommonInvoiceLine { - + /** * Delete line in database * @@ -1244,11 +1244,11 @@ class FactureLigneRec extends CommonInvoiceLine function delete() { global $conf,$langs,$user; - + $error=0; - + $this->db->begin(); - + // Call trigger /*$result=$this->call_trigger('LINEBILLREC_DELETE',$user); if ($result < 0) @@ -1257,8 +1257,8 @@ class FactureLigneRec extends CommonInvoiceLine return -1; }*/ // End call triggers - - + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id); dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql) ) @@ -1273,5 +1273,5 @@ class FactureLigneRec extends CommonInvoiceLine return -1; } } - + } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 880832f80e1..b7042404262 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1153,8 +1153,8 @@ class Facture extends CommonInvoice $sql.= ', f.fk_incoterms, f.location_incoterms'; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid AND c.entity = ' . getEntity('c_payment_term', 2); + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id AND p.entity = ' . getEntity('c_paiement', 2); $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON f.fk_incoterms = i.rowid'; $sql.= ' WHERE f.entity = '.$conf->entity; if ($rowid) $sql.= " AND f.rowid=".$rowid; @@ -3112,6 +3112,7 @@ class Facture extends CommonInvoice //$sql.= ' WHERE pf.'.$field.' = 1'; $sql.= ' AND pf.'.$field2.' = p.rowid'; $sql.= ' AND p.fk_paiement = t.id'; + $sql.= ' AND t.entity = ' . getEntity('c_paiement', 2); if ($filtertype) $sql.=" AND t.code='PRE'"; dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG); @@ -3594,7 +3595,7 @@ class Facture extends CommonInvoice if (! $error) { // Force payment mode of invoice to withdraw - $payment_mode_id = dol_getIdFromCode($this->db, 'PRE', 'c_paiement'); + $payment_mode_id = dol_getIdFromCode($this->db, 'PRE', 'c_paiement', 'code', 'id', getEntity('c_paiement', 2)); if ($payment_mode_id > 0) { $result=$this->setPaymentMethods($payment_mode_id); diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 2899e3fae56..3f0c2bcf732 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -93,6 +93,7 @@ class PaymentTerm // extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_payment_term("; $sql.= "rowid,"; + $sql.= "entity,"; $sql.= "code,"; $sql.= "sortorder,"; $sql.= "active,"; @@ -106,6 +107,7 @@ class PaymentTerm // extends CommonObject $sql.= ") VALUES ("; $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").","; + $sql.= " ".(! isset($this->entity)?getEntity('c_payment_term', 2):"'".$this->entity."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->sortorder)?'NULL':"'".$this->sortorder."'").","; $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").","; @@ -172,6 +174,7 @@ class PaymentTerm // extends CommonObject global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; + $sql.= " t.entity"; $sql.= " t.code,"; $sql.= " t.sortorder,"; @@ -185,6 +188,7 @@ class PaymentTerm // extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; $sql.= " WHERE t.rowid = ".$id; + $sql.= " AND t.entity = " . getEntity('c_payment_term', 2); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); @@ -234,6 +238,7 @@ class PaymentTerm // extends CommonObject $sql.= " t.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; $sql.= " WHERE t.code = 'RECEP'"; + $sql.= " AND t.entity = " . getEntity('c_payment_term', 2); dol_syslog(get_class($this)."::getDefaultId", LOG_DEBUG); $resql=$this->db->query($sql); @@ -296,7 +301,8 @@ class PaymentTerm // extends CommonObject $sql.= " decalage=".(isset($this->decalage)?$this->decalage:"null").""; - $sql.= " WHERE rowid=".$this->id; + $sql.= " WHERE rowid = " . $this->id; + $sql.= " AND entity = " . getEntity('c_payment_term', 2); $this->db->begin(); @@ -352,7 +358,8 @@ class PaymentTerm // extends CommonObject $error=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_payment_term"; - $sql.= " WHERE rowid=".$this->id; + $sql.= " WHERE rowid = " . $this->id; + $sql.= " AND t.entity = " . getEntity('c_payment_term', 2); $this->db->begin(); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index cdc5eb2e545..023f94c5eef 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -99,7 +99,7 @@ if (empty($reshook)) $atleastonepaymentnotnull = 0; // Generate payment array and check if there is payment higher than invoice and payment date before invoice date - $tmpinvoice=new Facture($db); + $tmpinvoice=new Facture($db); foreach ($_POST as $key => $value) { if (substr($key,0,7) == 'amount_') @@ -188,7 +188,7 @@ if (empty($reshook)) setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors'); $error++; } - + // Check if payments in both currency if ($totalpayment > 0 && $multicurrency_totalpayment > 0) { @@ -228,7 +228,7 @@ if (empty($reshook)) $newvalue = price2num($value,'MT'); $amounts[$key] = -$newvalue; } - + foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch { $newvalue = price2num($value,'MT'); @@ -251,7 +251,7 @@ if (empty($reshook)) $paiement->datepaye = $datepaye; $paiement->amounts = $amounts; // Array with all payments dispatching with invoice id $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching - $paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement'); + $paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement','code','id',getEntity('c_paiement', 2)); $paiement->num_paiement = GETPOST('num_paiement'); $paiement->note = GETPOST('comment'); @@ -389,7 +389,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { subJson[n["name"]] = n["value"]; }); - + return subJson; } function callForResult(imgId) @@ -516,31 +516,31 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; - + print '
'.dol_print_date($db->jdate($obj->dm),'day').''.dol_print_date($db->jdate($obj->dm),'day')."'; if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; print $obj->num_payment.''.price($obj->amount)."
'.dol_print_date($db->jdate($obj->dm),'day').'
'.dol_print_date($db->jdate($obj->dateep),'day').''; if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; print $obj->num_payment.''.price($obj->amount)."
'.$langs->trans('Comments').''; print '
'; dol_fiche_end(); - + /* * List of unpaid invoices */ - + $sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type, '; $sql.= ' f.datef as df, f.fk_soc as socid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - + if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS)) { $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON (f.fk_soc = s.rowid)'; } - + $sql.= ' WHERE f.entity = '.$conf->entity; $sql.= ' AND (f.fk_soc = '.$facture->socid; - + if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) { $sql.= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.$facture->thirdparty->parent.')'; } - + $sql.= ') AND f.paye = 0'; $sql.= ' AND f.fk_statut = 1'; // Statut=0 => not validated, Statut=2 => canceled if ($facture->type != 2) @@ -577,7 +577,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie //print '
'; print '
'; print ''; - + print ''; print ''; print ''; @@ -602,7 +602,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie while ($i < $num) { $objp = $db->fetch_object($resql); - + $soc = new Societe($db); $soc->fetch($objp->socid); @@ -614,9 +614,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $deposits=$invoice->getSumDepositsUsed(); $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); - + // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes=$invoice->getSumCreditNotesUsed(1); @@ -624,7 +624,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $multicurrency_alreadypayed=price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits,'MT'); $multicurrency_remaintopay=price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,'MT'); } - + print ''; print '\n"; - + // Currency if (!empty($conf->multicurrency->enabled)) print '\n"; - + // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) + if (!empty($conf->multicurrency->enabled)) { print ''; - + // Multicurrency Price print ''; - + // Multicurrency Price print ''; } - + // Price print ''; - + // Received or paid back print '"; // Multicurrency Price - if (! empty($conf->multicurrency->enabled)) + if (! empty($conf->multicurrency->enabled)) { print ''; print '\n"; print '\n"; diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php index 0fe627cf7ac..be0e96bb4c1 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/avalider.php @@ -71,7 +71,8 @@ if ($socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; } $sql.= " WHERE p.fk_paiement = c.id"; -$sql.= " AND p.entity = ".$conf->entity; +$sql.= " AND p.entity = " . $conf->entity; +$sql.= " AND c.entity = " . getEntity('c_paiement', 2); if ($socid) { $sql.= " AND f.fk_soc = ".$socid; @@ -111,7 +112,7 @@ if ($resql) while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + print ''; print ''; print '\n"; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 20afa14e0ca..45d64cf547e 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -36,7 +36,7 @@ class RemiseCheque extends CommonObject public $element='chequereceipt'; public $table_element='bordereau_cheque'; public $picto = 'payment'; - + var $num; var $intitule; //! Numero d'erreur Plage 1024-1279 @@ -345,7 +345,7 @@ class RemiseCheque extends CommonObject $this->errno = 0; $this->db->begin(); - + $numref = $this->getNextNumRef(); if ($this->errno == 0 && $numref) @@ -716,7 +716,7 @@ class RemiseCheque extends CommonObject * * @param int $bank_id Id of bank transaction line concerned * @param date $rejection_date Date to use on the negative payment - * @return int Id of negative payment line created + * @return int Id of negative payment line created */ function rejectCheck($bank_id, $rejection_date) { @@ -727,19 +727,19 @@ class RemiseCheque extends CommonObject $bankline = new AccountLine($db); $bankline->fetch($bank_id); - + /* Conciliation is allowed because when check is returned, a new line is created onto bank transaction log. if ($bankline->rappro) { $this->error='ActionRefusedLineAlreadyConciliated'; return -1; }*/ - + $this->db->begin(); - + // Not conciliated, we can delete it - //$bankline->delete($user); // We delete - + //$bankline->delete($user); // We delete + $bankaccount = $payment->fk_account; // Get invoices list to reopen them @@ -753,7 +753,7 @@ class RemiseCheque extends CommonObject $rejectedPayment = new Paiement($db); $rejectedPayment->amounts = array(); $rejectedPayment->datepaye = $rejection_date; - $rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement'); + $rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement','code','id',getEntity('c_paiement', 2)); $rejectedPayment->num_paiement = $payment->numero; while($obj = $db->fetch_object($resql)) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 03a7759e52c..0c66873647a 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -38,7 +38,7 @@ class Paiement extends CommonObject public $element='payment'; public $table_element='paiement'; public $picto = 'payment'; - + var $facid; var $datepaye; /** @@ -65,7 +65,7 @@ class Paiement extends CommonObject // fk_paiement dans llx_paiement_facture est le rowid du paiement var $fk_paiement; // Type of paiment - + /** * Constructor * @@ -93,6 +93,7 @@ class Paiement extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid '; $sql.= ' WHERE p.fk_paiement = c.id'; + $sql.= ' AND c.entity = ' . getEntity('c_paiement', 2); if ($id > 0) $sql.= ' AND p.rowid = '.$id; else if ($ref) @@ -153,14 +154,14 @@ class Paiement extends CommonObject $error = 0; $way = $this->getWay(); - + $now=dol_now(); - + // Clean parameters $totalamount = 0; $totalamount_converted = 0; $atleastonepaymentnotnull = 0; - + if ($way == 'dolibarr') { $amounts = &$this->amounts; @@ -171,22 +172,22 @@ class Paiement extends CommonObject $amounts = &$this->multicurrency_amounts; $amounts_to_update = &$this->amounts; } - + foreach ($amounts as $key => $value) // How payment is dispatch { $value_converted = Multicurrency::getAmountConversionFromInvoiceRate($key, $value, $way); $totalamount_converted += $value_converted; $amounts_to_update[$key] = price2num($value_converted, 'MT'); - + $newvalue = price2num($value,'MT'); $amounts[$key] = $newvalue; $totalamount += $newvalue; if (! empty($newvalue)) $atleastonepaymentnotnull++; } - + $totalamount = price2num($totalamount); $totalamount_converted = price2num($totalamount_converted); - + // Check parameters if (empty($totalamount) && empty($atleastonepaymentnotnull)) // We accept negative amounts for withdraw reject but not empty arrays { @@ -211,7 +212,7 @@ class Paiement extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_creat)"; $sql.= " VALUES (".$conf->entity.", '".$ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")"; - + dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -227,7 +228,7 @@ class Paiement extends CommonObject $amount = price2num($amount); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount)'; $sql .= ' VALUES ('.$facid.', '. $this->id.', \''.$amount.'\', \''.$this->multicurrency_amounts[$key].'\')'; - + dol_syslog(get_class($this).'::Create Amount line '.$key.' insert paiement_facture', LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -279,7 +280,7 @@ class Paiement extends CommonObject if ($invoice->type == Facture::TYPE_DEPOSIT) { $amount_ht = $amount_tva = $amount_ttc = array(); - + // Loop on each vat rate $i = 0; foreach ($invoice->lines as $line) @@ -292,20 +293,20 @@ class Paiement extends CommonObject $i ++; } } - + // Insert one discount by VAT rate category $discount = new DiscountAbsolute($this->db); $discount->description = '(DEPOSIT)'; $discount->fk_soc = $invoice->socid; $discount->fk_facture_source = $invoice->id; - + foreach ($amount_ht as $tva_tx => $xxx) { $discount->amount_ht = abs($amount_ht[$tva_tx]); $discount->amount_tva = abs($amount_tva[$tva_tx]); $discount->amount_ttc = abs($amount_ttc[$tva_tx]); $discount->tva_tx = abs($tva_tx); - + $result = $discount->create($user); if ($result < 0) { @@ -313,14 +314,14 @@ class Paiement extends CommonObject break; } } - + if ($error) { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; - } + } } - + // Set invoice to paid if (! $error) { @@ -520,13 +521,13 @@ class Paiement extends CommonObject $acc = new Account($this->db); $result=$acc->fetch($this->fk_account); - + $totalamount=$this->amount; if (empty($totalamount)) $totalamount=$this->total; // For backward compatibility - + // if dolibarr currency != bank currency then we received an amount in customer currency (currently I don't manage the case : my currency is USD, the customer currency is EUR and he paid me in GBP. Seems no sense for me) if (!empty($conf->multicurrency->enabled) && $conf->currency != $acc->currency_code) $totalamount=$this->multicurrency_amount; - + if ($mode == 'payment_supplier') $totalamount=-$totalamount; // Insert payment into llx_bank @@ -796,7 +797,7 @@ class Paiement extends CommonObject /** * Information sur l'objet - * + * * @param int $id id du paiement dont il faut afficher les infos * @return void */ @@ -962,13 +963,13 @@ class Paiement extends CommonObject /** * get the right way of payment - * + * * @return string 'dolibarr' if standard comportment or paid in dolibarr currency, 'customer' if payment received from multicurrency inputs */ function getWay() { global $conf; - + $way = 'dolibarr'; if (!empty($conf->multicurrency->enabled)) { @@ -981,10 +982,10 @@ class Paiement extends CommonObject } } } - + return $way; } - + /** * Initialise an instance with random values. * Used to build previews or test instances. diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index efc9d5e10d2..450ff455e13 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -117,7 +117,8 @@ if (GETPOST("orphelins")) $sql.= " ".MAIN_DB_PREFIX."c_paiement as c)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql.= " WHERE p.fk_paiement = c.id"; - $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.entity = " . $conf->entity; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " AND pf.fk_facture IS NULL"; // Add where from hooks $parameters=array(); @@ -148,7 +149,8 @@ else $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } $sql.= " WHERE p.fk_paiement = c.id"; - $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.entity = " . $conf->entity; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); if (! $user->rights->societe->client->voir && ! $socid) { $sql.= " AND sc.fk_user = " .$user->id; @@ -177,7 +179,7 @@ else if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; if ($search_payment_num != '') $sql .= natural_search('p.num_paiement', $search_payment_num); - if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1); + if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1); if ($search_company) $sql .= natural_search('s.nom', $search_company); // Add where from hooks $parameters=array(); @@ -211,7 +213,7 @@ if ($resql) $param.=($search_amount?"&search_amount=".urlencode($search_amount):""); $param.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):""); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - + print ''; if ($optioncss != '') print ''; print ''; @@ -220,9 +222,9 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords,'title_accountancy.png', 0, '', '', $limit); - + print '
'; print '
'.$arraytitle.''.$langs->trans('Date').'
'; @@ -634,36 +634,36 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date print ''.dol_print_date($db->jdate($objp->df),'day')."'.$objp->multicurrency_code."'; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $objp->multicurrency_total_ttc); print ''; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($sign * $multicurrency_payment); if ($multicurrency_creditnotes) print '+'.price($multicurrency_creditnotes); if ($multicurrency_deposits) print '+'.price($multicurrency_deposits); } print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay); print ''.price($sign * $objp->total_ttc).''.price($sign * $paiement); if ($creditnotes) print '+'.price($creditnotes); @@ -696,14 +696,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print "'; - + // Add remind multicurrency amount $namef = 'multicurrency_amount_'.$objp->facid; $nameRemain = 'multicurrency_remain_'.$objp->facid; - + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { if ($action != 'add_paiement') @@ -723,7 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Warning - print ''; + print ''; //print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."
"; if ($amounts[$invoice->id] && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])) || $multicurrency_amounts[$invoice->id] && (abs($multicurrency_amounts[$invoice->id]) > abs($multicurrency_amountsresttopay[$invoice->id]))) @@ -744,7 +744,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $totalrecudeposits+=$deposits; $i++; } - + if ($i > 1) { // Print total @@ -802,7 +802,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; if (!empty($totalpayment)) $text=$langs->trans('ConfirmCustomerPayment',$totalpayment,$langs->trans("Currency".$conf->currency)); - if (!empty($multicurrency_totalpayment)) + if (!empty($multicurrency_totalpayment)) { $text.='
'.$langs->trans('ConfirmCustomerPayment',$multicurrency_totalpayment,$langs->trans("paymentInInvoiceCurrency")); } @@ -835,7 +835,8 @@ if (! GETPOST('action','aZ09')) $sql.=', f.rowid as facid, c.libelle as paiement_type, p.num_paiement'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p, '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'c_paiement as c'; $sql.= ' WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id'; - $sql.= ' AND f.entity = '.$conf->entity; + $sql.= ' AND f.entity = ' . $conf->entity; + $sql.= ' AND c.entity = ' . getEntity('c_paiement', 2); if ($socid) { $sql.= ' AND f.fk_soc = '.$socid; @@ -864,7 +865,7 @@ if (! GETPOST('action','aZ09')) while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + print '
'.$objp->facnumber."'.dol_print_date($db->jdate($objp->dp))."
'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."
'."\n"; @@ -277,15 +279,15 @@ if ($resql) } print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder); - + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); @@ -314,7 +316,7 @@ if ($resql) // Type print ''; - + // Payment number print ''; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 62ee285d70b..632efaf5d43 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -234,7 +234,7 @@ if ($result) { while ($i < $num) { $objp = $db->fetch_object($result); - + print ''; print "\n"; @@ -278,7 +278,7 @@ if ($modecompta != 'CREANCES-DETTES') while ($i < $num) { $objp = $db->fetch_object($result); - + print ''; print "'; print ''; print ''; @@ -363,7 +363,7 @@ if ($result) { while ($i < $num) { $objp = $db->fetch_object($result); - + print ''; print "\n"; @@ -381,7 +381,7 @@ if ($result) { } } else - { + { print ''; print ''; print ''; @@ -581,7 +581,7 @@ if (! empty($conf->salaries->enabled)) $column = 'p.datep'; } - print ''; + print ''; $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; @@ -595,7 +595,7 @@ if (! empty($conf->salaries->enabled)) if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; $sql.= $db->order($newsortfield, $sortorder); - + dol_syslog("get payment salaries"); $result=$db->query($sql); $subtotal_ht = 0; @@ -663,7 +663,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id AND c.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE p.entity = ".getEntity('expensereport'); $sql.= " AND p.fk_statut>=5"; @@ -676,7 +676,7 @@ if (! empty($conf->expensereport->enabled)) { $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; } - + $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; $newsortfield = $sortfield; if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref'; @@ -744,9 +744,9 @@ if (! empty($conf->don->enabled)) $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id AND c.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE p.entity = ".getEntity('donation'); - $sql.= " AND fk_statut >= 2"; + $sql.= " AND fk_statut >= 2"; } if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 45cbbfe3a46..f1851bcfa36 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -492,14 +492,14 @@ if (! empty($conf->salaries->enabled)) } else { $column = 'p.datep'; } - + $subtotal_ht = 0; $subtotal_ttc = 0; $sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " GROUP BY p.label, dm"; - + dol_syslog("get social salaries payments"); $result=$db->query($sql); if ($result) @@ -512,13 +512,13 @@ if (! empty($conf->salaries->enabled)) while ($i < $num) { $obj = $db->fetch_object($result); - + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; $decaiss[$obj->dm] += $obj->amount; - + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; $decaiss_ttc[$obj->dm] += $obj->amount; - + $i++; } } @@ -546,7 +546,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id AND c.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE p.entity = ".getEntity('expensereport'); $sql.= " AND p.fk_statut>=5"; @@ -568,7 +568,7 @@ if (! empty($conf->expensereport->enabled)) { if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; $decaiss[$obj->dm] += $obj->amount_ht; - + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; $decaiss_ttc[$obj->dm] += $obj->amount_ttc; @@ -588,7 +588,7 @@ if (! empty($conf->don->enabled)) { $subtotal_ht = 0; $subtotal_ttc = 0; - + if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; @@ -599,7 +599,7 @@ if (! empty($conf->don->enabled)) $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id AND c.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE p.entity = ".getEntity('donation'); $sql.= " AND fk_statut >= 2"; } @@ -617,13 +617,13 @@ if (! empty($conf->don->enabled)) while ($i < $num) { $obj = $db->fetch_object($result); - + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; $encaiss[$obj->dm] += $obj->amount; - + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; $encaiss_ttc[$obj->dm] += $obj->amount; - + $i++; } } @@ -671,7 +671,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) { $mois_modulo = $mois; if($mois>12) {$mois_modulo = $mois-12;} - + print ''; print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index e87fc932c50..8d053028887 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -98,7 +98,7 @@ $sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.da $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,"; $sql.= " pst.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id AND pst.entity = " . getEntity('c_paiement', 2); $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid,"; $sql.= " ".MAIN_DB_PREFIX."user as u"; @@ -151,9 +151,9 @@ if ($result) print ''; print ''; print ''; - + print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); - + print '
'; print '
'.$langs->trans("PaymentTypeShort".$objp->paiement_code).''.$objp->num_paiement.'
 ".$langs->trans("Bills").' '.$objp->name."
 ".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; @@ -301,7 +301,7 @@ if ($modecompta != 'CREANCES-DETTES') } if ($total_ttc == 0) -{ +{ print '
 '.$langs->trans("None").'
 ".$langs->trans("Bills")." socid."\">".$objp->name."
 '.$langs->trans("None").'
'.$langs->trans("Salaries").'
'.$langs->trans("Salaries").'
".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,$annee),"%B")."
'."\n"; @@ -188,7 +188,7 @@ if ($result) $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; - + print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); @@ -199,13 +199,13 @@ if ($result) print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + print "\n"; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - + print ''; $userstatic->id=$obj->uid; @@ -238,11 +238,11 @@ if ($result) $accountstatic->id=$obj->bid; $accountstatic->ref=$obj->bref; $accountstatic->number=$obj->bnumber; - + if (! empty($conf->accounting->enabled)) { $accountstatic->account_number=$obj->account_number; - + $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($obj->fk_accountancy_journal); diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 630197cfc78..7d32da6f937 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -67,7 +67,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) { if ($object->paye) { $result = $object->set_unpaid($user); - if ($result > 0) + if ($result > 0) { header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); exit(); @@ -350,7 +350,7 @@ if ($action == 'create') print ''; } @@ -405,7 +405,7 @@ if ($id > 0) $head=tax_prepare_head($object); $totalpaye = $object->getSommePaiement(); - + // Clone confirmation if ($action === 'clone') { @@ -473,21 +473,21 @@ if ($id > 0) $morehtmlref.=''; } } - } + } $morehtmlref.=''; - + $linkback = '' . $langs->trans("BackToList") . ''; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); - + print '
'; print '
'; print '
'; - + print '
'.$langs->trans("Project").''; $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1); - + print '
'; - + // Type print '"; print ""; @@ -581,6 +581,7 @@ if ($id > 0) $sql.= " AND p.fk_charge = cs.rowid"; $sql.= " AND cs.entity = ".$conf->entity; $sql.= " AND p.fk_typepaiement = c.id"; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " ORDER BY dp DESC"; //print $sql; @@ -588,7 +589,7 @@ if ($id > 0) if ($resql) { $totalpaye = 0; - + $num = $db->num_rows($resql); $i = 0; $total = 0; print '
'.$langs->trans("Type")."".$object->type_libelle."
'; @@ -598,14 +599,14 @@ if ($id > 0) print ''; print ''; print ''; - + $var=true; if ($num > 0) { while ($i < $num) { $objp = $db->fetch_object($resql); - + print "'; print '\n"; @@ -619,18 +620,18 @@ if ($id > 0) } else { - + print ''; } - + //if ($object->status == ChargeSociales::STATUS_DRAFT) //{ print "\n"; print "\n"; - + $resteapayer = $object->amount - $totalpaye; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; - + print ""; print '\n"; //} @@ -640,12 +641,12 @@ if ($id > 0) else { dol_print_error($db); - } - + } + print ''; print ''; print ''; - + print '
'; dol_fiche_end(); diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index cf359d691ec..9d1205c1cb0 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -/** +/** * Classe permettant la gestion des paiements des charges * La tva collectee n'est calculee que sur les factures payees. */ @@ -36,7 +36,7 @@ class ChargeSociales extends CommonObject public $table='chargesociales'; public $table_element='chargesociales'; public $picto = 'bill'; - + /** * {@inheritdoc} */ @@ -83,7 +83,7 @@ class ChargeSociales extends CommonObject $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as c ON cs.fk_type = c.id"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON cs.fk_mode_reglement = p.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON cs.fk_mode_reglement = p.id AND p.entity = ' . getEntity('c_paiement', 2); if ($ref) $sql.= " WHERE cs.rowid = ".$ref; else $sql.= " WHERE cs.rowid = ".$id; @@ -110,7 +110,7 @@ class ChargeSociales extends CommonObject $this->paye = $obj->paye; $this->periode = $this->db->jdate($obj->periode); $this->import_key = $this->import_key; - + $this->db->free($resql); return 1; @@ -378,7 +378,7 @@ class ChargeSociales extends CommonObject if ($return) return 1; else return -1; } - + /** * Retourne le libelle du statut d'une charge (impaye, payee) * @@ -445,7 +445,7 @@ class ChargeSociales extends CommonObject if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - + return "Error, mode/status not found"; } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 1d553831f99..8a5c8f0eeef 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -78,7 +78,7 @@ class PaymentSocialContribution extends CommonObject $now=dol_now(); dol_syslog(get_class($this)."::create", LOG_DEBUG); - + // Validate parametres if (! $this->datepaye) { @@ -125,7 +125,7 @@ class PaymentSocialContribution extends CommonObject if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge"); - + // Insere tableau des montants / factures foreach ($this->amounts as $key => $amount) { @@ -137,7 +137,7 @@ class PaymentSocialContribution extends CommonObject // If we want to closed payed invoices if ($closepaidcontrib) { - + $contrib=new ChargeSociales($this->db); $contrib->fetch($contribid); $paiement = $contrib->getSommePaiement(); @@ -205,6 +205,7 @@ class PaymentSocialContribution extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as pt, ".MAIN_DB_PREFIX."paiementcharge as t)"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepaiement = pt.id"; + $sql.= " AND pt.entity = " . getEntity('c_paiement', 2); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 6c88305f72e..bd4b3efc8b7 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -88,7 +88,7 @@ print ''; print ''; print ''; -if ($mode != 'sconly') +if ($mode != 'sconly') { $center=($year?''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."":""); print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); @@ -133,7 +133,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs,"; $sql.= " ".MAIN_DB_PREFIX."paiementcharge as pc"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id AND pct.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE cs.fk_type = c.id AND pc.fk_charge = cs.rowid"; $sql.= " AND cs.entity = ".$conf->entity; if ($year > 0) @@ -260,7 +260,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -362,7 +362,7 @@ while($j<$numlt) $total = $total + $obj->amount; - + print ''; print ''."\n"; @@ -408,7 +408,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $sal = new PaymentSalary($db); print "
"; - + print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary"; @@ -444,7 +444,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $total = $total + $obj->amount; - + print ''; print ''."\n"; diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 44c45a65dc7..12ed60d6d68 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -100,7 +100,7 @@ $bankstatic = new Account($db); $sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,"; $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id AND pst.entity = " . getEntity('c_paiement', 2); $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " WHERE t.entity = ".$conf->entity; @@ -156,9 +156,9 @@ if ($result) print ''; print ''; print ''; - + print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit); - + print '
'; print '
'.$langs->trans("Type").''.$langs->trans("Amount").'
"; print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp),'day')."
'.$langs->trans("None").'
".$langs->trans("AlreadyPaid")." :".price($totalpaye)."
".$langs->trans("AmountExpected")." :".price($object->amount)."
".$langs->trans("RemainderToPay")." :'.price($resteapayer)."
'.dol_print_date($db->jdate($obj->dm),'day').'
'.dol_print_date($db->jdate($obj->dm),'day').'
'.dol_print_date($db->jdate($obj->dateep),'day').'
'; @@ -199,7 +199,7 @@ if ($result) print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); @@ -252,7 +252,7 @@ if ($result) $i++; } - + $colspan=5; if (! empty($conf->banque->enabled)) $colspan++; print ''; @@ -261,7 +261,7 @@ if ($result) print "
'.$langs->trans("Total").'
"; print ''; - + print ''; $db->free($result); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 4b6d70b1366..2be205fa5c9 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -51,7 +51,7 @@ abstract class CommonInvoice extends CommonObject const TYPE_DEPOSIT = 3; /** - * Proforma invoice. + * Proforma invoice. * @deprectad Remove this. A "proforma invoice" is an order with a look of invoice, not an invoice ! */ const TYPE_PROFORMA = 4; @@ -89,7 +89,7 @@ abstract class CommonInvoice extends CommonObject */ const STATUS_ABANDONED = 3; - + /** * Return remain amount to pay. Property ->id and ->total_ttc must be set. * This does not include open direct debit requests. @@ -141,7 +141,7 @@ abstract class CommonInvoice extends CommonObject return -1; } } - + /** * Return amount (with tax) of all deposits invoices used by invoice. * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). @@ -154,11 +154,11 @@ abstract class CommonInvoice extends CommonObject if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { // TODO - return 0; + return 0; } - + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - + $discountstatic=new DiscountAbsolute($this->db); $result=$discountstatic->getSumDepositsUsed($this, $multicurrency); if ($result >= 0) @@ -185,9 +185,9 @@ abstract class CommonInvoice extends CommonObject // TODO return 0; } - + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - + $discountstatic=new DiscountAbsolute($this->db); $result=$discountstatic->getSumCreditNotesUsed($this, $multicurrency); if ($result >= 0) @@ -200,7 +200,7 @@ abstract class CommonInvoice extends CommonObject return -1; } } - + /** * Renvoie tableau des ids de facture avoir issus de la facture * @@ -418,7 +418,7 @@ abstract class CommonInvoice extends CommonObject if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); if (($status == 3 || $status == 2) && $alreadypaid <= 0) return ''.$langs->trans('Bill'.$prefix.'StatusCanceled').' '.img_picto($langs->trans('BillStatusCanceled'),'statut5'); if (($status == 3 || $status == 2) && $alreadypaid > 0) return ''.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' '.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7'); - if ($alreadypaid <= 0) + if ($alreadypaid <= 0) { if ($type == self::TYPE_CREDIT_NOTE) return ''.$langs->trans('Bill'.$prefix.'StatusNotRefunded').' '.img_picto($langs->trans('StatusNotRefunded'),'statut1'); return ''.$langs->trans('Bill'.$prefix.'StatusNotPaid').' '.img_picto($langs->trans('BillStatusNotPaid'),'statut1'); @@ -450,8 +450,9 @@ abstract class CommonInvoice extends CommonObject $sqltemp = 'SELECT c.type_cdr,c.nbjour,c.decalage'; $sqltemp.= ' FROM '.MAIN_DB_PREFIX.'c_payment_term as c'; - if (is_numeric($cond_reglement)) $sqltemp.= " WHERE c.rowid=".$cond_reglement; - else $sqltemp.= " WHERE c.code='".$this->db->escape($cond_reglement)."'"; + $sqltemp.= " WHERE c.entity = " . getEntity('c_payment_term', 2); + if (is_numeric($cond_reglement)) $sqltemp.= " AND c.rowid=".$cond_reglement; + else $sqltemp.= " AND c.code='".$this->db->escape($cond_reglement)."'"; dol_syslog(get_class($this).'::calculate_date_lim_reglement', LOG_DEBUG); $resqltemp=$this->db->query($sqltemp); @@ -497,13 +498,13 @@ abstract class CommonInvoice extends CommonObject } elseif($cdr_type == 2 && !empty($cdr_nbjour)) // Application de la règle, le N du mois courant ou suivant { - + $date_piece = dol_mktime(0,0,0,date('m', $this->date),date('d', $this->date),date('Y', $this->date)); // Sans les heures minutes et secondes $date_lim_current = dol_mktime(0,0,0,date('m', $this->date),$cdr_nbjour,date('Y', $this->date)); // Sans les heures minutes et secondes $date_lim_next = strtotime(date('Y-m-d', $date_lim_current).' +1month'); - + $diff = $date_piece - $date_lim_current; - + if($diff < 0) $datelim = $date_lim_current; else $datelim = $date_lim_next; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 01d28ecde24..6b265584948 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2958,8 +2958,8 @@ class Form $sql = "SELECT id, code, libelle as label, type, active"; $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement"; - //if ($active >= 0) $sql.= " WHERE active = ".$active; $sql.= " WHERE entity = " . getEntity('c_paiement', 2); + //if ($active >= 0) $sql.= " AND active = ".$active; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 169aec16307..008049d3d13 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -151,7 +151,7 @@ class Translate $this->load($domain); } } - + /** * Load translation key-value for a particular file, into a memory array. * If data for file already loaded, do nothing. @@ -177,7 +177,7 @@ class Translate global $conf,$db; //dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang); - + // Check parameters if (empty($domain)) { @@ -185,8 +185,8 @@ class Translate return -1; } if ($this->defaultlang == 'none_NONE') return 0; // Special language code to not translate keys - - + + // Load $this->tab_translate[] from database if (empty($loadfromfileonly) && count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database. @@ -278,14 +278,14 @@ class Translate * and split the rest until a line feed. * This is more efficient than fgets + explode + trim by a factor of ~2. */ - while ($line = fscanf($fp, "%[^= ]%*[ =]%[^\n]")) + while ($line = fscanf($fp, "%[^= ]%*[ =]%[^\n]")) { - if (isset($line[1])) + if (isset($line[1])) { list($key, $value) = $line; //if ($domain == 'orders') print "Domain=$domain, found a string for $tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."
"; //if ($key == 'Order') print "Domain=$domain, found a string for key=$key=$tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."
"; - if (empty($this->tab_translate[$key])) + if (empty($this->tab_translate[$key])) { // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) $value = preg_replace('/\\n/', "\n", $value); // Parse and render carriage returns if ($key == 'DIRECTION') { // This is to declare direction of language @@ -375,8 +375,8 @@ class Translate if (! empty($tmparray2[1])) $this->tab_translate[$tmparray2[0]]=$tmparray2[1]; } } - } - + } + // Check to be sure that SeparatorDecimal differs from SeparatorThousand if (! empty($this->tab_translate["SeparatorDecimal"]) && ! empty($this->tab_translate["SeparatorThousand"]) && $this->tab_translate["SeparatorDecimal"] == $this->tab_translate["SeparatorThousand"]) $this->tab_translate["SeparatorThousand"]=''; @@ -401,7 +401,7 @@ class Translate global $conf; $domain='database'; - + // Check parameters if (empty($db)) return 0; // Database handler can't be used @@ -418,7 +418,7 @@ class Translate } $this->_tab_loaded[$newdomain] = 1; // We want to be sure this function is called once only. - + $fileread=0; $langofdir=(empty($forcelangdir)?$this->defaultlang:$forcelangdir); @@ -467,24 +467,24 @@ class Translate if (! $found && ! empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) { // Overwrite translation with database read - $sql="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."'"; + $sql="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."'"; $resql=$db->query($sql); - + if ($resql) { $num = $db->num_rows($resql); if ($num) { if ($usecachekey) $tabtranslatedomain=array(); // To save lang content in cache - + $i = 0; while ($i < $num) // Ex: Need 225ms for all fgets on all lang file for Third party page. Same speed than file_get_contents { $obj=$db->fetch_object($resql); - + $key=$obj->transkey; $value=$obj->transvalue; - + //print "Domain=$domain, found a string for $tab[0] with value $tab[1]
"; if (empty($this->tab_translate[$key])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) { @@ -493,12 +493,12 @@ class Translate $this->tab_translate[$key]=$value; if ($usecachekey) $tabtranslatedomain[$key]=$value; // To save lang content in cache } - + $i++; } - + $fileread=1; - + // TODO Move cache write out of loop on dirs // To save lang content for usecachekey into cache if ($usecachekey && count($tabtranslatedomain)) @@ -524,9 +524,9 @@ class Translate return 1; } - - - + + + /** * Return translated value of key for special keys ("Currency...", "Civility...", ...). * Search in lang file, then into database. Key must be any complete entry into lang file: CurrencyEUR, ... @@ -559,7 +559,7 @@ class Translate } elseif (preg_match('/^PaymentTypeShort([0-9A-Z]+)$/i',$key,$reg)) { - $newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle'); + $newstr=$this->getLabelFromKey($db,$reg[1],'c_paiement','code','libelle','',getEntity('c_paiement', 2)); } elseif (preg_match('/^OppStatusShort([0-9A-Z]+)$/i',$key,$reg)) { @@ -611,8 +611,8 @@ class Translate $str=preg_replace('/'.preg_quote($tmparray2[0]).'/',$tmparray2[1],$str); } } - - if (! preg_match('/^Format/',$key)) + + if (! preg_match('/^Format/',$key)) { //print $str; $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. @@ -690,9 +690,9 @@ class Translate $tmparray2=explode(':',$tmp); $str=preg_replace('/'.preg_quote($tmparray2[0]).'/',$tmparray2[1],$str); } - } + } - if (! preg_match('/^Format/',$key)) + if (! preg_match('/^Format/',$key)) { //print $str; $str=sprintf($str,$param1,$param2,$param3,$param4); // Replace %s and %d except for FormatXXX strings. @@ -867,10 +867,11 @@ class Translate * @param string $fieldkey Field for key * @param string $fieldlabel Field for label * @param string $keyforselect Use another value than the translation key for the where into select + * @param int $entity Field for filter by entity * @return string Label in UTF8 (but without entities) * @see dol_getIdFromCode */ - function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel,$keyforselect='') + function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel,$keyforselect='',$entity=null) { // If key empty if ($key == '') return ''; @@ -893,6 +894,8 @@ class Translate $sql = "SELECT ".$fieldlabel." as label"; $sql.= " FROM ".MAIN_DB_PREFIX.$tablename; $sql.= " WHERE ".$fieldkey." = '".($keyforselect?$keyforselect:$key)."'"; + if (! is_null($entity)) + $sql.= " AND entity = " . (int) $entity; dol_syslog(get_class($this).'::getLabelFromKey', LOG_DEBUG); $resql = $db->query($sql); if ($resql) @@ -930,7 +933,7 @@ class Translate } /** - * Return a currency code into its symbol. + * Return a currency code into its symbol. * If mb_convert_encoding is not available, return currency code. * * @param string $currency_code Currency code diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 688624dc838..204e55778af 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5652,10 +5652,11 @@ function dol_osencode($str) * @param string $tablename Table name without prefix * @param string $fieldkey Field for code * @param string $fieldid Field for id + * @param int $entity Field for filter by entity * @return int <0 if KO, Id of code if OK * @see $langs->getLabelFromKey */ -function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id') +function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id',$entity=null) { global $cache_codes; @@ -5671,6 +5672,8 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id') $sql = "SELECT ".$fieldid." as valuetoget"; $sql.= " FROM ".MAIN_DB_PREFIX.$tablename; $sql.= " WHERE ".$fieldkey." = '".$db->escape($key)."'"; + if (! is_null($entity)) + $sql.= " AND entity = " . (int) $entity; dol_syslog('dol_getIdFromCode', LOG_DEBUG); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 693dd2e412f..2d0e09f57dc 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -255,16 +255,16 @@ class pdf_crabe extends ModelePDFFactures // Set nblignes with the new facture lines content after hook $nblignes = count($object->lines); $nbpayments = count($object->getListOfPayments()); - + // Create pdf instance $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + $heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -509,7 +509,7 @@ class pdf_crabe extends ModelePDFFactures $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); // Enough for 6 chars - + if ($this->situationinvoice) { $pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R'); @@ -769,7 +769,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('','', $default_font_size - 4); - + // Loop on each deposits and credit notes included $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; $sql.= " re.description, re.fk_facture_source,"; @@ -818,11 +818,11 @@ class pdf_crabe extends ModelePDFFactures $sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount,"; $sql.= " cp.code"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id AND cp.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; //$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1"; $sql.= " ORDER BY p.datep"; - + $resql=$this->db->query($sql); if ($resql) { @@ -1052,7 +1052,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(255,255,255); $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - + $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); @@ -1071,7 +1071,7 @@ class pdf_crabe extends ModelePDFFactures else { // FIXME amount of vat not supported with multicurrency - + //Local tax 1 before VAT //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ @@ -1397,7 +1397,7 @@ class pdf_crabe extends ModelePDFFactures if (empty($hidetop)) { $pdf->SetXY($this->posxqty-1, $tab_top+1); - + if($this->situationinvoice) { $pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); @@ -1411,14 +1411,14 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); } } - + if ($this->situationinvoice) { $pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height); - + if (empty($hidetop)) { - + $pdf->SetXY($this->posxprogress, $tab_top+1); - + if($conf->global->PRODUCT_USE_UNITS) { $pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C'); @@ -1431,9 +1431,9 @@ class pdf_crabe extends ModelePDFFactures { $pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C'); } - + } - + } if($conf->global->PRODUCT_USE_UNITS) { @@ -1554,7 +1554,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $textref=$outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref); - if ($object->statut == Facture::STATUS_DRAFT) + if ($object->statut == Facture::STATUS_DRAFT) { $pdf->SetTextColor(128,0,0); $textref.=' - '.$outputlangs->trans("NotValidated"); @@ -1616,7 +1616,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0,0,60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : " . dol_print_date($object->date_pointoftax,"day",false,$outputlangs), '', 'R'); } - + if ($object->type != 2) { $posy+=3; @@ -1647,7 +1647,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=1; // Show list of linked objects diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 3af85a1944d..71849018554 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -71,7 +71,7 @@ class modFacture extends DolibarrModules $this->warnings_activation = array('FR'=>'WarningNoteModuleInvoiceForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text') $this->warnings_activation = array(); $this->warnings_activation_ext = array('FR'=>'WarningInstallationMayBecomeNotCompliantWithLaw'); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text') - + // Config pages $this->config_page_url = array("facture.php"); @@ -99,7 +99,7 @@ class modFacture extends DolibarrModules $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; - + /*$this->const[$r][0] = "FACTURE_DRAFT_WATERMARK"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "__(Draft)__"; @@ -107,7 +107,7 @@ class modFacture extends DolibarrModules $this->const[$r][4] = 0; $r++;*/ - + // Boxes //$this->boxes = array(0=>array(1=>'box_factures_imp.php'),1=>array(1=>'box_factures.php')); $this->boxes = array( @@ -116,16 +116,16 @@ class modFacture extends DolibarrModules 2=>array('file'=>'box_graph_invoices_permonth.php','enabledbydefaulton'=>'Home') ); - // Cronjobs + // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600*24), + 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600*24), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - ); - // List of cron jobs entries to add - // Example: + ); + // List of cron jobs entries to add + // Example: // $this->cronjobs=array( - // 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600) + // 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600), + // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600) // ); // Permissions @@ -206,8 +206,8 @@ class modFacture extends DolibarrModules // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - + + // Exports //-------- $r=1; @@ -267,7 +267,7 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pt ON pt.id = p.fk_paiement'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pt ON pt.id = p.fk_paiement AND pt.entity = ' . getEntity('c_paiement', 2); $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON b.rowid = p.fk_bank'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index bf37a7e73d8..a0f479e79fe 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -111,7 +111,7 @@ class modSalaries extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; $this->rights[$r][5] = ''; - + $r++; $this->rights[$r][0] = 513; $this->rights[$r][1] = 'Create/modify payment of salaries'; @@ -119,7 +119,7 @@ class modSalaries extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; $this->rights[$r][5] = ''; - + $r++; $this->rights[$r][0] = 514; $this->rights[$r][1] = 'Delete contracts/salaries'; @@ -140,8 +140,8 @@ class modSalaries extends DolibarrModules // Menus //------- $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - + + // Exports //-------- $r=0; @@ -157,7 +157,7 @@ class modSalaries extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'payment_salary as p ON p.fk_user = u.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_typepayment = cp.id'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_typepayment = cp.id AND cp.entity = ' . getEntity('c_paiement', 2); $this->export_sql_end[$r] .=' AND u.entity IN ('.getEntity('user').')'; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c4c93537444..641597de539 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -284,8 +284,8 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sc.fk_user = u.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as payterm ON s.cond_reglement = payterm.rowid AND payterm.entity = ' . getEntity('c_payment_term', 2); + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id AND paymode.entity = ' . getEntity('c_paiement', 2); $this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe').')'; if (is_object($user) && empty($user->rights->societe->client->voir)) { $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 11ee8a32d7d..406e07b094d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -180,6 +180,7 @@ class pdf_paiement $sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid "; $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND p.fk_paiement = c.id "; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; if (! $user->rights->societe->client->voir && ! $socid) { @@ -199,7 +200,7 @@ class pdf_paiement while ($i < $num) { $objp = $this->db->fetch_object($result); - + $lines[$i][0] = $objp->facnumber; $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true); diff --git a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php index f20e912e1ed..f220c51b59d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php @@ -178,6 +178,7 @@ class pdf_paiement_fourn $sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid "; $sql.= " AND f.entity = ".$conf->entity; $sql.= " AND p.fk_paiement = c.id "; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'"; if (! $user->rights->societe->client->voir && ! $socid) { @@ -197,7 +198,7 @@ class pdf_paiement_fourn while ($i < $num) { $objp = $this->db->fetch_object($result); - + $lines[$i][0] = $objp->ref; $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 1e7e6f4bcad..20f77c68a0e 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -914,7 +914,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; $sql.= " cp.code"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX."paiementfourn as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id AND cp.entity = " . getEntity('c_paiement', 2); $sql.= " WHERE pf.fk_paiementfourn = p.rowid and pf.fk_facturefourn = ".$object->id; $sql.= " ORDER BY p.datep"; $resql=$this->db->query($sql); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 8e1bd00d893..e671f06845b 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -683,6 +683,7 @@ if (! empty($id) && $action != 'edit') $sql.= " AND p.fk_donation = d.rowid"; $sql.= " AND d.entity = ".$conf->entity; $sql.= " AND p.fk_typepayment = c.id"; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " ORDER BY dp"; //print $sql; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 695314bb526..2c92e52be7c 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -39,7 +39,7 @@ class Don extends CommonObject public $fk_element = 'fk_donation'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $picto = 'generic'; - + var $date; var $amount; var $societe; @@ -163,7 +163,7 @@ class Don extends CommonObject global $conf, $user,$langs; $now = dol_now(); - + // Charge tableau des id de societe socids $socids = array(); @@ -611,7 +611,7 @@ class Don extends CommonObject $sql.= " c.code as country_code, c.label as country"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_projet"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON cp.id = d.fk_payment"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON cp.id = d.fk_payment AND cp.entity = " . getEntity('c_paiement', 2); $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.fk_country = c.rowid"; if (! empty($id)) { diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 9d478c4d7f5..5752878fecf 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -32,7 +32,7 @@ class PaymentDonation extends CommonObject public $element='payment_donation'; //!< Id that identify managed objects public $table_element='payment_donation'; //!< Name of table without prefix where object is stored public $picto = 'payment'; - + public $rowid; public $fk_donation; @@ -175,6 +175,7 @@ class PaymentDonation extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as pt, ".MAIN_DB_PREFIX."payment_donation as t)"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepayment = pt.id"; + $sql.= " AND pt.entity = " . getEntity('c_paiement', 2); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); @@ -443,7 +444,7 @@ class PaymentDonation extends CommonObject { return ''; } - + /** * Renvoi le libelle d'un statut donne * @@ -454,11 +455,11 @@ class PaymentDonation extends CommonObject function LibStatut($statut,$mode=0) { global $langs; - + return ''; } - - + + /** * Initialise an instance with random values. * Used to build previews or test instances. diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index dff27139581..181b8d90b1d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -125,7 +125,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($cancel) + if ($cancel) { $action=''; $fk_projet=''; @@ -158,7 +158,7 @@ if (empty($reshook)) { // Because createFromClone modifies the object, we must clone it so that we can restore it later if it fails $orig = clone $object; - + $result=$object->createFromClone(GETPOST('fk_user_author','int')); if ($result > 0) { @@ -174,7 +174,7 @@ if (empty($reshook)) } } } - + if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->supprimer) { $object = new ExpenseReport($db); @@ -190,20 +190,20 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + if ($action == 'add' && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); - + $object->date_debut = $date_start; $object->date_fin = $date_end; - + $object->fk_user_author = GETPOST('fk_user_author','int'); if (! ($object->fk_user_author > 0)) $object->fk_user_author = $user->id; - + $fuser=new User($db); $fuser->fetch($object->fk_user_author); - + $object->fk_statut = 1; $object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->fk_user_validator = GETPOST('fk_user_validator','int'); @@ -215,20 +215,20 @@ if (empty($reshook)) $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; } - + if ($object->periode_existe($fuser,$object->date_debut,$object->date_fin)) { $error++; setEventMessages($langs->trans("ErrorDoubleDeclaration"), null, 'errors'); $action='create'; } - + if (! $error) { $db->begin(); - + $id = $object->create($user); - + if ($id > 0) { $db->commit(); @@ -243,25 +243,25 @@ if (empty($reshook)) } } } - + if ($action == 'update' && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); - + $object->date_debut = $date_start; $object->date_fin = $date_end; - + if($object->fk_statut < 3) { $object->fk_user_validator = GETPOST('fk_user_validator','int'); } - + $object->fk_c_paiement = GETPOST('fk_c_paiement','int'); $object->note_public = GETPOST('note_public'); $object->note_private = GETPOST('note_private'); $object->fk_user_modif = $user->id; - + $result = $object->update($user); if ($result > 0) { @@ -273,14 +273,14 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); if ($ret < 0) $error++; - + if (! $error) { // Actions on extra fields (by external module or standard code) @@ -296,17 +296,17 @@ if (empty($reshook)) } else if ($reshook < 0) $error++; } - + if ($error) $action = 'edit_extras'; } - + if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); $result = $object->setValidate($user); - + if ($result > 0) { // Define output language @@ -322,51 +322,51 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + if ($result > 0 && $object->fk_user_validator > 0) { $langs->load("mails"); - + // TO $destinataire = new User($db); $destinataire->fetch($object->fk_user_validator); $emailTo = $destinataire->email; - + // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_author); $emailFrom = $expediteur->email; - + if ($emailTo && $emailFrom) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportWaitingForApproval"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut,$object->date_fin,'',$langs), $link); - + // Rebuild pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$id,'',"",$langs); - + if($resultPDF): // ATTACHMENT array_push($filename,dol_sanitizeFileName($object->ref).".pdf"); array_push($filedir,$conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref) . "/" . dol_sanitizeFileName($object->ref).".pdf"); array_push($mimetype,"application/pdf"); */ - + // PREPARE SEND $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -411,13 +411,13 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->fetch($id); $result = $object->set_save_from_refuse($user); - + if ($result > 0) { // Define output language @@ -433,11 +433,11 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + if ($result > 0) { // Send mail @@ -446,7 +446,7 @@ if (empty($reshook)) $destinataire = new User($db); $destinataire->fetch($object->fk_user_validator); $emailTo = $destinataire->email; - + // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_author); @@ -455,10 +455,10 @@ if (empty($reshook)) if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportWaitingForReApproval"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $dateRefusEx = explode(" ",$object->date_refuse); @@ -481,7 +481,7 @@ if (empty($reshook)) // PREPARE SEND $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -526,15 +526,15 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - + // Approve if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->approve) { $object = new ExpenseReport($db); $object->fetch($id); - + $result = $object->setApproved($user); - + if ($result > 0) { // Define output language @@ -550,11 +550,11 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + if ($result > 0) { // Send mail @@ -576,19 +576,19 @@ if (empty($reshook)) if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportApproved"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportApprovedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link); - + // Rebuilt pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); - + if($resultPDF { // ATTACHMENT @@ -600,7 +600,7 @@ if (empty($reshook)) */ $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -673,7 +673,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -686,28 +686,28 @@ if (empty($reshook)) $destinataire = new User($db); $destinataire->fetch($object->fk_user_author); $emailTo = $destinataire->email; - + // FROM $expediteur = new User($db); $expediteur->fetch($object->fk_user_refuse); $emailFrom = $expediteur->email; - + if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportRefused"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_refuse'], $link); - + // Rebuilt pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); - + if($resultPDF { // ATTACHMENT @@ -796,7 +796,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -814,23 +814,23 @@ if (empty($reshook)) $expediteur = new User($db); $expediteur->fetch($object->fk_user_cancel); $emailFrom = $expediteur->email; - + if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportCanceled"); - + // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_cancel'], $link); - + // Rebuilt pdf /* $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); - + if($resultPDF { // ATTACHMENT @@ -840,10 +840,10 @@ if (empty($reshook)) array_push($mimetype,"application/pdf"); } */ - + // PREPARE SEND $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); - + if ($mailfile) { // SEND @@ -881,7 +881,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action=''; - } + } } else { @@ -918,7 +918,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -961,7 +961,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -983,7 +983,7 @@ if (empty($reshook)) if ($emailFrom && $emailTo) { $filename=array(); $filedir=array(); $mimetype=array(); - + // SUBJECT $subject = $langs->transnoentities("ExpenseReportPaid"); @@ -1154,7 +1154,7 @@ if (empty($reshook)) { $object = new ExpenseReport($db); $object->fetch($id); - + $object_ligne = new ExpenseReportLine($db); $object_ligne->fetch(GETPOST("rowid")); $total_ht = $object_ligne->total_ht; @@ -1178,11 +1178,11 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + $object->update_totaux_del($object_ligne->total_ht,$object_ligne->total_tva); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']); exit; @@ -1244,13 +1244,13 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - + $result = $object->recalculer($id); - + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -1296,7 +1296,7 @@ if ($action == 'create') print ''; print ''; - + // Date start print ''; print ''; @@ -1304,7 +1304,7 @@ if ($action == 'create') $form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1); print ''; print ''; - + // Date end print ''; print ''; @@ -1312,7 +1312,7 @@ if ($action == 'create') $form->select_date($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1); print ''; print ''; - + print ''; print ''; print ''; print ''; - + // Payment mode if (! empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { @@ -1400,7 +1400,7 @@ else $result = $object->fetch($id, $ref); $res = $object->fetch_optionals($object->id, $extralabels); - + if ($result > 0) { if (! in_array($object->fk_user_author, $user->getAllChildIds(1))) @@ -1698,7 +1698,7 @@ else $userfee=new User($db); $result = $userfee->fetch($object->fk_user_validator); if ($result > 0) print $userfee->getNomUrl(-1); - if (empty($userfee->email) || ! isValidEmail($userfee->email)) + if (empty($userfee->email) || ! isValidEmail($userfee->email)) { $langs->load("errors"); print img_warning($langs->trans("ErrorBadEMail", $userfee->email)); @@ -1851,6 +1851,7 @@ else $sql.= " AND p.fk_expensereport = e.rowid"; $sql.= " AND e.entity = ".$conf->entity; $sql.= " AND p.fk_typepayment = c.id"; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " ORDER BY dp"; $resql = $db->query($sql); @@ -1902,9 +1903,9 @@ else { print ''; print ''; - + $remaintopay = $object->total_ttc - $totalpaid; - + print ''; print ''; } @@ -1984,7 +1985,7 @@ else if ($action != 'editline' || $objp->rowid != GETPOST('rowid')) { print ''; - + print ''; @@ -2006,7 +2007,7 @@ else print ''; print ''; print ''; - + if ($action != 'editline') { print ''; @@ -2034,7 +2035,7 @@ else if ($action == 'editline' && $objp->rowid == GETPOST('rowid')) { print ''; - + print ''; // Select date @@ -2049,7 +2050,7 @@ else $formproject->select_projects(-1, $objp->fk_projet,'fk_projet', 0, 0, 1, 1); print ''; } - + // Select type print ''; - + print ''; } // Fin si c'est payé/validé print '
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("User").''; @@ -1341,7 +1341,7 @@ if ($action == 'create') } print '
'.$langs->trans("AlreadyPaid").':'.price($totalpaid).'
'.$langs->trans("AmountExpected").':'.price($object->total_ttc).'
'.$langs->trans("RemainderToPay").':'.price($remaintopay).'
'; print img_picto($langs->trans("Document"), "object_generic"); print ' '.$piece_comptable.''.vatrate($objp->vatrate,true).''.price($objp->value_unit).''.$objp->qty.''.price($objp->total_ht).'
'; select_type_fees_id($objp->type_fees_code,'fk_c_type_fees'); @@ -2168,13 +2169,13 @@ else } print '
'; print ''; - + print ''; } else @@ -2290,7 +2291,7 @@ if ($action != 'create' && $action != 'edit') // If status is Appoved // -------------------- - + if ($user->rights->expensereport->approve && $object->fk_statut == 5) { print ''; @@ -2309,7 +2310,7 @@ if ($action != 'create' && $action != 'edit') print ''; } } - + // If bank module is not used if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->fk_statut == 5) { @@ -2319,26 +2320,26 @@ if ($action != 'create' && $action != 'edit') print '"; } } - + if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->fk_statut == 5) { // Cancel print ''; } - + // TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled. if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->fk_statut == 6) { // Cancel print ''; } - + // Clone if ($user->rights->expensereport->creer) { print ''; } - - /* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */ + + /* If draft, validated, cancel, and user can create, he can always delete its card before it is approved */ if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4) { // Delete @@ -2389,7 +2390,7 @@ if ($action != 'create' && $action != 'edit' && ($id || $ref)) $object->fetch_thirdparty(); $result = $object->add_object_linked('fichinter', GETPOST('LinkedFichinter')); } - + // Show links to link elements $linktoelements=array(); if (! empty($conf->global->EXPENSES_LINK_TO_INTERVENTION)) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ffef31cad8b..05be397fde3 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -37,9 +37,9 @@ class ExpenseReport extends CommonObject var $picto = 'trip'; var $lignes=array(); - + public $date_debut; - + public $date_fin; var $fk_user_validator; @@ -65,7 +65,7 @@ class ExpenseReport extends CommonObject // Update var $date_modif; var $fk_user_modif; - + // Refus var $date_refuse; var $detail_refuse; @@ -128,17 +128,17 @@ class ExpenseReport extends CommonObject $now = dol_now(); $error = 0; - + // Check parameters - if (empty($this->date_debut) || empty($this->date_fin)) + if (empty($this->date_debut) || empty($this->date_fin)) { $this->error='ErrorFieldRequired'; return -1; } - + $fuserid = $this->fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for. if (empty($fuserid)) $fuserid = $user->id; - + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; @@ -208,7 +208,7 @@ class ExpenseReport extends CommonObject $result=$this->update_price(); if ($result > 0) { - + if (!$notrigger) { // Call trigger @@ -262,19 +262,19 @@ class ExpenseReport extends CommonObject function createFromClone($fk_user_author) { global $user,$hookmanager; - + $error=0; - + if (empty($fk_user_author)) $fk_user_author = $user->id; - + $this->context['createfromclone'] = 'createfromclone'; - + $this->db->begin(); - + // get extrafields so they will be clone //foreach($this->lines as $line) //$line->fetch_optionals($line->rowid); - + // Load source object $objFrom = clone $this; @@ -325,8 +325,8 @@ class ExpenseReport extends CommonObject return -1; } } - - + + /** * update * @@ -341,7 +341,7 @@ class ExpenseReport extends CommonObject $error = 0; $this->db->begin(); - + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql.= " total_ht = ".$this->total_ht; $sql.= " , total_ttc = ".$this->total_ttc; @@ -417,7 +417,8 @@ class ExpenseReport extends CommonObject $sql.= " d.fk_user_valid, d.fk_user_approve,"; $sql.= " d.fk_statut as status, d.fk_c_paiement,"; $sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement - $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id"; + $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id AND dp.entity = " . getEntity('c_paiement', 2); if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'"; else $sql.= " WHERE d.rowid = ".$id; $sql.= $restrict; @@ -455,7 +456,7 @@ class ExpenseReport extends CommonObject $this->fk_user_refuse = $obj->fk_user_refuse; $this->fk_user_cancel = $obj->fk_user_cancel; $this->fk_user_approve = $obj->fk_user_approve; - + $user_author = new User($this->db); if ($this->fk_user_author > 0) $user_author->fetch($this->fk_user_author); @@ -512,7 +513,7 @@ class ExpenseReport extends CommonObject { $error = 0; $this->db->begin(); - + $sql = "UPDATE ".MAIN_DB_PREFIX."expensereport"; $sql.= " SET fk_statut = 6, paid=1"; $sql.= " WHERE rowid = ".$id." AND fk_statut = 5"; @@ -533,7 +534,7 @@ class ExpenseReport extends CommonObject } // End call triggers } - + if (empty($error)) { $this->db->commit(); @@ -670,7 +671,7 @@ class ExpenseReport extends CommonObject $auser->fetch($obj->fk_user_approve); $this->user_approve = $auser; } - + } $this->db->free($resql); } @@ -704,8 +705,8 @@ class ExpenseReport extends CommonObject $this->date_fin = $now; $this->date_approve = $now; - $type_fees_id = 2; // TF_TRIP - + $type_fees_id = 2; // TF_TRIP + $this->status = 5; $this->fk_statut = 5; @@ -1078,14 +1079,14 @@ class ExpenseReport extends CommonObject { $now = dol_now(); $this->db->begin(); - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = 2, fk_user_valid = ".$fuser->id.", date_valid='".$this->db->idate($now)."'"; if ($update_number_int) { $sql.= ", ref_number_int = ".$ref_number_int; } $sql.= ' WHERE rowid = '.$this->id; - + $resql=$this->db->query($sql); if ($resql) { @@ -1099,7 +1100,7 @@ class ExpenseReport extends CommonObject } // End call triggers } - + if (empty($error)) { $this->db->commit(); @@ -1123,7 +1124,7 @@ class ExpenseReport extends CommonObject { dol_syslog(get_class($this)."::setValidate expensereport already with validated status", LOG_WARNING); } - + return 0; } @@ -1183,13 +1184,13 @@ class ExpenseReport extends CommonObject { $now=dol_now(); $error = 0; - + // date approval $this->date_approve = $this->db->idate($now); if ($this->fk_statut != 5) { $this->db->begin(); - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = 5, fk_user_approve = ".$fuser->id.","; $sql.= " date_approve='".$this->db->idate($this->date_approve)."'"; @@ -1206,7 +1207,7 @@ class ExpenseReport extends CommonObject } // End call triggers } - + if (empty($error)) { $this->db->commit(); @@ -1230,7 +1231,7 @@ class ExpenseReport extends CommonObject { dol_syslog(get_class($this)."::setApproved expensereport already with approve status", LOG_WARNING); } - + return 0; } @@ -1245,7 +1246,7 @@ class ExpenseReport extends CommonObject { $now = dol_now(); $error = 0; - + // date de refus if ($this->fk_statut != 99) { @@ -1261,7 +1262,7 @@ class ExpenseReport extends CommonObject $this->fk_user_refuse = $fuser->id; $this->detail_refuse = $details; $this->date_refuse = $now; - + if (!$notrigger) { // Call trigger @@ -1272,7 +1273,7 @@ class ExpenseReport extends CommonObject } // End call triggers } - + if (empty($error)) { $this->db->commit(); @@ -1308,11 +1309,11 @@ class ExpenseReport extends CommonObject function set_unpaid($fuser, $notrigger = 0) { $error = 0; - + if ($this->fk_c_deplacement_statuts != 5) { $this->db->begin(); - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= " SET fk_statut = 5"; $sql.= ' WHERE rowid = '.$this->id; @@ -1331,7 +1332,7 @@ class ExpenseReport extends CommonObject } // End call triggers } - + if (empty($error)) { $this->db->commit(); @@ -1372,7 +1373,7 @@ class ExpenseReport extends CommonObject if ($this->fk_statut != 4) { $this->db->begin(); - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= " SET fk_statut = 4, fk_user_cancel = ".$fuser->id; $sql.= ", date_cancel='".$this->db->idate($this->date_cancel)."'"; @@ -1393,7 +1394,7 @@ class ExpenseReport extends CommonObject } // End call triggers } - + if (empty($error)) { $this->db->commit(); @@ -1433,7 +1434,7 @@ class ExpenseReport extends CommonObject $sql = 'SELECT MAX(de.ref_number_int) as max'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' de'; - + $result = $this->db->query($sql); if($this->db->num_rows($result) > 0): @@ -1758,7 +1759,7 @@ class ExpenseReport extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."usergroup_user as ugu, ".MAIN_DB_PREFIX."usergroup_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd"; $sql.= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve'; //print $sql; - + dol_syslog(get_class($this)."::fetch_users_approver_expensereport sql=".$sql); $result = $this->db->query($sql); if($result) @@ -1895,7 +1896,7 @@ class ExpenseReport extends CommonObject $now=dol_now(); $userchildids = $user->getAllChildIds(1); - + $sql = "SELECT ex.rowid, ex.date_valid"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as ex"; if ($option == 'toapprove') $sql.= " WHERE ex.fk_statut = 2"; @@ -1927,7 +1928,7 @@ class ExpenseReport extends CommonObject while ($obj=$this->db->fetch_object($resql)) { $response->nbtodo++; - + if ($option == 'toapprove') { if ($this->db->jdate($obj->date_valid) < ($now - $conf->expensereport->approve->warning_delay)) { @@ -1951,7 +1952,7 @@ class ExpenseReport extends CommonObject return -1; } } - + /** * Return if an expense report is late or not * @@ -1961,11 +1962,11 @@ class ExpenseReport extends CommonObject public function hasDelay($option) { global $conf; - + //Only valid members if ($option == 'toapprove' && $this->status != 2) return false; if ($option == 'topay' && $this->status != 5) return false; - + $now = dol_now(); if ($option == 'toapprove') { @@ -1973,7 +1974,7 @@ class ExpenseReport extends CommonObject } else return ($this->datevalid?$this->datevalid:$this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); - } + } } diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index edd80a0bff5..51321460760 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -168,6 +168,7 @@ class PaymentExpenseReport extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as pt, ".MAIN_DB_PREFIX."payment_expensereport as t)"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepayment = pt.id"; + $sql.= " AND pt.entity = " . getEntity('c_paiement', 2); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); @@ -447,7 +448,7 @@ class PaymentExpenseReport extends CommonObject function LibStatut($statut,$mode=0) { global $langs; - + return ''; } @@ -506,7 +507,7 @@ class PaymentExpenseReport extends CommonObject $total=$this->total; if ($mode == 'payment_expensereport') $amount=$total; - + // Insert payment into llx_bank $bank_line_id = $acc->addline( $this->datepaid, @@ -543,7 +544,7 @@ class PaymentExpenseReport extends CommonObject dol_print_error($this->db); } } - + // Add link 'user' in bank_url between user and bank transaction if (! $error) { @@ -561,7 +562,7 @@ class PaymentExpenseReport extends CommonObject $er->user->getFullName($langs), 'user' ); - if ($result <= 0) + if ($result <= 0) { $this->error=$this->db->lasterror(); dol_syslog(get_class($this).'::addPaymentToBank '.$this->error); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 159f76249df..84b346028c1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -45,7 +45,7 @@ class CommandeFournisseur extends CommonOrder public $fk_element = 'fk_commande'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='order'; - + /** * {@inheritdoc} */ @@ -132,9 +132,9 @@ class CommandeFournisseur extends CommonOrder * Draft status */ const STATUS_DRAFT = 0; - - - + + + /** * Constructor * @@ -190,8 +190,8 @@ class CommandeFournisseur extends CommonOrder $sql.= ', c.fk_incoterms, c.location_incoterms'; $sql.= ', i.libelle as libelle_incoterms'; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON (c.fk_mode_reglement = p.id)"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid AND cr.entity = " . getEntity('c_payment_term', 2) . ")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON (c.fk_mode_reglement = p.id AND p.entity = " . getEntity('c_paiement', 2) . ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; $sql.= " WHERE c.entity = ".$conf->entity; @@ -318,7 +318,7 @@ class CommandeFournisseur extends CommonOrder $line->subprice = $objp->subprice; $line->pu_ht = $objp->subprice; $line->remise_percent = $objp->remise_percent; - + $line->vat_src_code = $objp->vat_src_code; $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; @@ -615,7 +615,7 @@ class CommandeFournisseur extends CommonOrder $picto='order'; $url = DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id; - + $linkclose=''; if (empty($notooltip)) { @@ -627,7 +627,7 @@ class CommandeFournisseur extends CommonOrder $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; } - + $linkstart = ''; $linkend=''; @@ -1378,7 +1378,7 @@ class CommandeFournisseur extends CommonOrder } $desc=trim($desc); $ref_supplier=''; // Ref of supplier price when we add line - + // Check parameters if ($qty < 1 && ! $fk_product) { @@ -1402,7 +1402,7 @@ class CommandeFournisseur extends CommonOrder { $product_type = $prod->type; $label = $prod->label; - + // We use 'none' instead of $fourn_ref, because fourn_ref may not exists anymore. So we will take the first supplier price ok. // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. $result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', $this->fk_soc); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$fourn_ref/$this->fk_soc @@ -1414,7 +1414,7 @@ class CommandeFournisseur extends CommonOrder if ($remise_percent == 0 && $prod->remise_percent !=0) $remise_percent =$prod->remise_percent; - + } if ($result == 0) // If result == 0, we failed to found the supplier reference price { @@ -1422,7 +1422,7 @@ class CommandeFournisseur extends CommonOrder $this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier"); $this->db->rollback(); dol_syslog(get_class($this)."::addline we did not found supplier price, so we can't guess unit price"); - //$pu = $prod->fourn_pu; // We do not overwrite unit price + //$pu = $prod->fourn_pu; // We do not overwrite unit price //$ref = $prod->ref_fourn; // We do not overwrite ref supplier price return -1; } @@ -1468,7 +1468,7 @@ class CommandeFournisseur extends CommonOrder $vat_src_code = $reg[1]; $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx,$pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -1487,7 +1487,7 @@ class CommandeFournisseur extends CommonOrder $localtax2_type=$localtaxes_type[2]; $subprice = price2num($pu,'MU'); - + $rangmax = $this->line_max(); $rang = $rangmax + 1; @@ -1513,7 +1513,7 @@ class CommandeFournisseur extends CommonOrder $this->line->subprice=$pu_ht; $this->line->rang=$this->rang; $this->line->info_bits=$info_bits; - + $this->line->vat_src_code=$vat_src_code; $this->line->total_ht=$total_ht; $this->line->total_tva=$total_tva; @@ -2001,7 +2001,7 @@ class CommandeFournisseur extends CommonOrder $old_statut = $this->statut; $this->statut = $statut; $this->actionmsg2 = $comment; - + // Call trigger $result=$this->call_trigger('ORDER_SUPPLIER_RECEIVE',$user); if ($result < 0) $error++; @@ -2334,7 +2334,7 @@ class CommandeFournisseur extends CommonOrder $vat_src_code = $reg[1]; $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -2678,14 +2678,14 @@ class CommandeFournisseur extends CommonOrder if ($db->num_rows($query)) { $obj = $db->fetch_object($query); - + $string = $langs->trans($obj->code); if ($string == $obj->code) { $string = $obj->label != '-' ? $obj->label : ''; } return $string; - } + } } else dol_print_error($db); } @@ -2819,7 +2819,7 @@ class CommandeFournisseur extends CommonOrder return $text; } - + /** * Calc status regarding to dispatched stock * @@ -2828,7 +2828,7 @@ class CommandeFournisseur extends CommonOrder * @param string $comment Comment * @return int <0 if KO, 0 if not applicable, >0 if OK */ - public function calcAndSetStatusDispatch(User $user, $closeopenorder=1, $comment='') + public function calcAndSetStatusDispatch(User $user, $closeopenorder=1, $comment='') { global $conf, $langs; @@ -2845,14 +2845,14 @@ class CommandeFournisseur extends CommonOrder $filter['t.status']=1; } $ret=$supplierorderdispatch->fetchAll('','',0,0,$filter); - if ($ret<0) + if ($ret<0) { $this->error=$supplierorderdispatch->error; $this->errors=$supplierorderdispatch->errors; return $ret; - } - else + } + else { - if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0) + if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0) { //Build array with quantity deliverd by product foreach($supplierorderdispatch->lines as $line) { @@ -2861,12 +2861,12 @@ class CommandeFournisseur extends CommonOrder foreach($this->lines as $line) { $qtywished[$line->fk_product]+=$line->qty; } - + $date_liv = dol_now(); - + //Compare array $diff_array=array_diff_assoc($qtydelivered,$qtywished); - + if (count($diff_array)==0) //No diff => mean everythings is received { if ($closeopenorder) @@ -2888,8 +2888,8 @@ class CommandeFournisseur extends CommonOrder } return 4; } - } - else + } + else { //Diff => received partially $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can' @@ -3014,12 +3014,12 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->date_start = $this->db->jdate($objp->date_start); $this->date_end = $this->db->jdate($objp->date_end); $this->fk_unit = $objp->fk_unit; - + $this->multicurrency_subprice = $objp->multicurrency_subprice; $this->multicurrency_total_ht = $objp->multicurrency_total_ht; $this->multicurrency_total_tva = $objp->multicurrency_total_tva; $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - + $this->db->free($result); return 1; } @@ -3208,7 +3208,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql.= ", subprice='".price2num($this->subprice)."'"; //$sql.= ",remise='".price2num($remise)."'"; $sql.= ", remise_percent='".price2num($this->remise_percent)."'"; - + $sql.= ", vat_src_code = '".(empty($this->vat_src_code)?'':$this->vat_src_code)."'"; $sql.= ", tva_tx='".price2num($this->tva_tx)."'"; $sql.= ", localtax1_tx='".price2num($this->total_localtax1)."'"; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 5c8a41a0466..5ae4be6692d 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -130,7 +130,7 @@ class FactureFournisseur extends CommonInvoice public $multicurrency_total_ttc; //! id of source invoice if replacement invoice or credit note public $fk_facture_source; - + /** * Standard invoice */ @@ -517,8 +517,8 @@ class FactureFournisseur extends CommonInvoice $sql.= ' t.fk_multicurrency, t.multicurrency_code, t.multicurrency_tx, t.multicurrency_total_ht, t.multicurrency_total_tva, t.multicurrency_total_ttc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t'; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON (t.fk_cond_reglement = cr.rowid)"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON (t.fk_mode_reglement = p.id)"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_payment_term as cr ON (t.fk_cond_reglement = cr.rowid AND cr.entity = " . getEntity('c_payment_term', 2) . ")"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON (t.fk_mode_reglement = p.id AND p.entity = " . getEntity('c_paiement', 2) . ")"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid'; if ($id) $sql.= " WHERE t.rowid=".$id; if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'"; @@ -883,7 +883,7 @@ class FactureFournisseur extends CommonInvoice } // Fin appel triggers } - + if (! $error) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';'; @@ -902,7 +902,7 @@ class FactureFournisseur extends CommonInvoice $error++; } } - + if (! $error) { // Delete linked object diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 12fccab91d8..eb685f113ba 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -37,7 +37,7 @@ class PaiementFourn extends Paiement public $element='payment_supplier'; public $table_element='paiementfourn'; public $picto = 'payment'; - + var $statut; //Status of payment. 0 = unvalidated; 1 = validated // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) // fk_paiement dans llx_paiement_facture est le rowid du paiement @@ -75,13 +75,14 @@ class PaiementFourn extends Paiement function fetch($id, $ref='', $fk_bank='') { $error=0; - + $sql = 'SELECT p.rowid, p.ref, p.entity, p.datep as dp, p.amount, p.statut, p.fk_bank,'; $sql.= ' c.code as paiement_code, c.libelle as paiement_type,'; $sql.= ' p.num_paiement, p.note, b.fk_account'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiementfourn as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid '; $sql.= ' WHERE p.fk_paiement = c.id'; + $sql.= ' AND c.entity = ' . getEntity('c_paiement', 2); if ($id > 0) $sql.= ' AND p.rowid = '.$id; else if ($ref) @@ -141,9 +142,9 @@ class PaiementFourn extends Paiement // Clean parameters $totalamount = 0; $totalamount_converted = 0; - + dol_syslog(get_class($this)."::create", LOG_DEBUG); - + if ($way == 'dolibarr') { $amounts = &$this->amounts; @@ -154,13 +155,13 @@ class PaiementFourn extends Paiement $amounts = &$this->multicurrency_amounts; $amounts_to_update = &$this->amounts; } - + foreach ($amounts as $key => $value) { $value_converted = Multicurrency::getAmountConversionFromInvoiceRate($key, $value, $way, 'facture_fourn'); $totalamount_converted += $value_converted; $amounts_to_update[$key] = price2num($value_converted, 'MT'); - + $newvalue = price2num($value,'MT'); $amounts[$key] = $newvalue; $totalamount += $newvalue; @@ -174,7 +175,7 @@ class PaiementFourn extends Paiement { $ref = $this->getNextNumRef(''); $now=dol_now(); - + if ($way == 'dolibarr') { $total = $totalamount; @@ -185,7 +186,7 @@ class PaiementFourn extends Paiement $total = $totalamount_converted; // Maybe use price2num with MT for the converted value $mtotal = $totalamount; } - + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn ('; $sql.= 'ref, entity, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_author, fk_bank)'; $sql.= " VALUES ('".$this->db->escape($ref)."', ".$conf->entity.", '".$this->db->idate($now)."',"; @@ -289,7 +290,7 @@ class PaiementFourn extends Paiement function delete($notrigger=0) { global $conf, $user, $langs; - + $bank_line_id = $this->bank_line; $this->db->begin(); @@ -358,7 +359,7 @@ class PaiementFourn extends Paiement return -4; } } - + if (! $notrigger) { // Appel des triggers @@ -370,7 +371,7 @@ class PaiementFourn extends Paiement } // Fin appel triggers } - + $this->db->commit(); return 1; } @@ -555,7 +556,7 @@ class PaiementFourn extends Paiement if ($withpicto != 2) $result.=$link.$text.$linkend; return $result; } - + /** * Initialise an instance with random values. * Used to build previews or test instances. @@ -579,7 +580,7 @@ class PaiementFourn extends Paiement $this->facid = 1; $this->datepaye = $nownotime; } - + /** * Return next reference of supplier invoice not already used (or last reference) * according to numbering module defined into constant SUPPLIER_PAYMENT_ADDON @@ -711,13 +712,13 @@ class PaiementFourn extends Paiement /** * get the right way of payment - * + * * @return string 'dolibarr' if standard comportment or paid in dolibarr currency, 'customer' if payment received from multicurrency inputs */ function getWay() { global $conf; - + $way = 'dolibarr'; if (!empty($conf->multicurrency->enabled)) { @@ -730,7 +731,7 @@ class PaiementFourn extends Paiement } } } - + return $way; } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0ec657ccdfe..7b97b70d71d 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2321,7 +2321,7 @@ else $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id AND c.entity = ' . getEntity('c_paiement', 2); $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid'; $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; $sql.= ' ORDER BY p.datep, p.tms'; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f51246d8eea..a6b395b030a 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -214,7 +214,7 @@ if (empty($reshook)) setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors'); $error++; } - + // Check if payments in both currency if ($totalpayment > 0 && $multicurrency_totalpayment > 0) { @@ -341,7 +341,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $obj = $db->fetch_object($resql); $total = $obj->total; - + print load_fiche_titre($langs->trans('DoPayment')); print '
'; @@ -353,7 +353,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; dol_fiche_head(null); - + print ''; print '
'.$langs->trans('Company').''; @@ -384,7 +384,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; dol_fiche_end(); - + $parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -447,19 +447,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie while ($i < $num) { $objp = $db->fetch_object($resql); - + print '
'; $invoicesupplierstatic->ref=$objp->ref; $invoicesupplierstatic->id=$objp->facid; print $invoicesupplierstatic->getNomUrl(1); print ''.$objp->ref_supplier.'!!!'.$objp->multicurrency_code."'; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { @@ -485,14 +485,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) - { + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + { print price($objp->multicurrency_am); } print ''; - if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) + if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($objp->multicurrency_total_ttc - $objp->multicurrency_am); } @@ -500,20 +500,20 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ''.price($objp->total_ttc).''.price($objp->am).''.price($objp->total_ttc - $objp->am).''; $namef = 'amount_'.$objp->facid; if (!empty($conf->use_javascript_ajax)) print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($objp->total_ttc - $objp->am)."'"); print ''; print "'; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) @@ -525,7 +525,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print "
\n"; - + print "
"; } $db->free($resql); @@ -574,7 +574,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; if (!empty($totalpayment)) $text=$langs->trans('ConfirmSupplierPayment',price($totalpayment),$langs->trans("Currency".$conf->currency)); - if (!empty($multicurrency_totalpayment)) + if (!empty($multicurrency_totalpayment)) { $text.='
'.$langs->trans('ConfirmSupplierPayment',price($multicurrency_totalpayment),$langs->trans("paymentInInvoiceCurrency")); } @@ -589,7 +589,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; } } - else dol_print_error($db); + else dol_print_error($db); } /* @@ -617,7 +617,7 @@ if (empty($action)) $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn AS p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS pf ON p.rowid=pf.fk_paiementfourn'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid=pf.fk_facturefourn'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id AND c.entity = ' . getEntity('c_paiement', 2); $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; @@ -635,14 +635,14 @@ if (empty($action)) $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label"; if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= $db->order($sortfield,$sortorder); - + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - + $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); @@ -667,9 +667,9 @@ if (empty($action)) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + $massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - + print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); print '
'; @@ -680,24 +680,24 @@ if (empty($action)) print ''; print ''; print ''; - + $moreforfilter=''; - + $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - + if ($moreforfilter) { print '
'; print $moreforfilter; print '
'; } - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -739,11 +739,11 @@ if (empty($action)) //print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; - + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - + print ''; // Ref payment @@ -764,7 +764,7 @@ if (empty($action)) // Payment number print ''; - + print ''; - print ''; - + $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle)); print ''; From cfe667a3cee4991ef5208918de756350d0a25e19 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 14:29:04 +0200 Subject: [PATCH 0019/1137] Fix: show all logs --- .travis.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index a040342b2e6..c7f63c2ef33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -275,26 +275,26 @@ script: set +e cd htdocs/install php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log - php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log - php step5.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-3.log + php upgrade2.php 3.5.0 3.6.0 >> $TRAVIS_BUILD_DIR/upgrade350360-2.log + php step5.php 3.5.0 3.6.0 >> $TRAVIS_BUILD_DIR/upgrade350360-3.log php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log - php upgrade2.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-2.log - php step5.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-3.log + php upgrade2.php 3.6.0 3.7.0 >> $TRAVIS_BUILD_DIR/upgrade360370-2.log + php step5.php 3.6.0 3.7.0 >> $TRAVIS_BUILD_DIR/upgrade360370-3.log php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log - php upgrade2.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-2.log - php step5.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-3.log + php upgrade2.php 3.7.0 3.8.0 >> $TRAVIS_BUILD_DIR/upgrade370380-2.log + php step5.php 3.7.0 3.8.0 >> $TRAVIS_BUILD_DIR/upgrade370380-3.log php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log - php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log - php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log + php upgrade2.php 3.8.0 3.9.0 >> $TRAVIS_BUILD_DIR/upgrade380390-2.log + php step5.php 3.8.0 3.9.0 >> $TRAVIS_BUILD_DIR/upgrade380390-3.log php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log - php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log - php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log + php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL >> $TRAVIS_BUILD_DIR/upgrade390400-2.log + php step5.php 3.9.0 4.0.0 >> $TRAVIS_BUILD_DIR/upgrade390400-3.log php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log - php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log - php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log + php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL >> $TRAVIS_BUILD_DIR/upgrade400500-2.log + php step5.php 4.0.0 5.0.0 >> $TRAVIS_BUILD_DIR/upgrade400500-3.log php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log - php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log - php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log + php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL >> $TRAVIS_BUILD_DIR/upgrade500600-2.log + php step5.php 5.0.0 6.0.0 >> $TRAVIS_BUILD_DIR/upgrade500600-3.log cd - set +e echo From d4edca585726314e6dab230a53c232b90d486ccc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 14:30:02 +0200 Subject: [PATCH 0020/1137] Revert "Fix: show all logs" This reverts commit cfe667a3cee4991ef5208918de756350d0a25e19. --- .travis.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index c7f63c2ef33..a040342b2e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -275,26 +275,26 @@ script: set +e cd htdocs/install php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log - php upgrade2.php 3.5.0 3.6.0 >> $TRAVIS_BUILD_DIR/upgrade350360-2.log - php step5.php 3.5.0 3.6.0 >> $TRAVIS_BUILD_DIR/upgrade350360-3.log + php upgrade2.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-2.log + php step5.php 3.5.0 3.6.0 > $TRAVIS_BUILD_DIR/upgrade350360-3.log php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log - php upgrade2.php 3.6.0 3.7.0 >> $TRAVIS_BUILD_DIR/upgrade360370-2.log - php step5.php 3.6.0 3.7.0 >> $TRAVIS_BUILD_DIR/upgrade360370-3.log + php upgrade2.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-2.log + php step5.php 3.6.0 3.7.0 > $TRAVIS_BUILD_DIR/upgrade360370-3.log php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log - php upgrade2.php 3.7.0 3.8.0 >> $TRAVIS_BUILD_DIR/upgrade370380-2.log - php step5.php 3.7.0 3.8.0 >> $TRAVIS_BUILD_DIR/upgrade370380-3.log + php upgrade2.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-2.log + php step5.php 3.7.0 3.8.0 > $TRAVIS_BUILD_DIR/upgrade370380-3.log php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log - php upgrade2.php 3.8.0 3.9.0 >> $TRAVIS_BUILD_DIR/upgrade380390-2.log - php step5.php 3.8.0 3.9.0 >> $TRAVIS_BUILD_DIR/upgrade380390-3.log + php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log + php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log - php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL >> $TRAVIS_BUILD_DIR/upgrade390400-2.log - php step5.php 3.9.0 4.0.0 >> $TRAVIS_BUILD_DIR/upgrade390400-3.log + php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log + php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log - php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL >> $TRAVIS_BUILD_DIR/upgrade400500-2.log - php step5.php 4.0.0 5.0.0 >> $TRAVIS_BUILD_DIR/upgrade400500-3.log + php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log + php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log - php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL >> $TRAVIS_BUILD_DIR/upgrade500600-2.log - php step5.php 5.0.0 6.0.0 >> $TRAVIS_BUILD_DIR/upgrade500600-3.log + php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log + php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log cd - set +e echo From 2864d431482741c976e609fbd5cf4ba3b8a05239 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 14:31:19 +0200 Subject: [PATCH 0021/1137] Fix: missing all logs --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a040342b2e6..8da1b9fcd2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -299,8 +299,10 @@ script: set +e echo #cat $TRAVIS_BUILD_DIR/upgrade400500-2.log + cat $TRAVIS_BUILD_DIR/upgrade500600.log cat $TRAVIS_BUILD_DIR/upgrade500600-2.log - cat /tmp/dolibarr_install.log + cat $TRAVIS_BUILD_DIR/upgrade500600-3.log + #cat /tmp/dolibarr_install.log - | echo "Unit testing" From fc08adff0f2a48a7798245abbaf0728ffc0e772c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 14:44:29 +0200 Subject: [PATCH 0022/1137] Fix: syntax error --- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 996d218bf12..e990bb040e1 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -395,11 +395,11 @@ ALTER TABLE llx_usergroup_rights DROP INDEX fk_usergroup; ALTER TABLE llx_usergroup_rights ADD UNIQUE INDEX uk_usergroup_rights (entity, fk_usergroup, fk_id); ALTER TABLE llx_usergroup_rights ADD CONSTRAINT fk_usergroup_rights_fk_usergroup FOREIGN KEY (fk_usergroup) REFERENCES llx_usergroup (rowid); -ALTER TABLE llx_c_paiement DROP PRIMARY KEY +ALTER TABLE llx_c_paiement DROP PRIMARY KEY; ALTER TABLE llx_c_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER id; ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(id, entity, code); -ALTER TABLE llx_c_payment_term DROP PRIMARY KEY +ALTER TABLE llx_c_payment_term DROP PRIMARY KEY; ALTER TABLE llx_c_payment_term ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(rowid, entity, code); From 735a24fb07aa47ac180b1b386686a7f053540e29 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 15:43:43 +0200 Subject: [PATCH 0023/1137] Fix: remove debug --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8da1b9fcd2b..6b47e5de600 100644 --- a/.travis.yml +++ b/.travis.yml @@ -299,9 +299,9 @@ script: set +e echo #cat $TRAVIS_BUILD_DIR/upgrade400500-2.log - cat $TRAVIS_BUILD_DIR/upgrade500600.log - cat $TRAVIS_BUILD_DIR/upgrade500600-2.log - cat $TRAVIS_BUILD_DIR/upgrade500600-3.log + #cat $TRAVIS_BUILD_DIR/upgrade500600.log + #cat $TRAVIS_BUILD_DIR/upgrade500600-2.log + #cat $TRAVIS_BUILD_DIR/upgrade500600-3.log #cat /tmp/dolibarr_install.log - | From 6cac4b15d3e97be016608b1b16e749ab7fd11549 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 11 Jun 2017 06:54:40 +0200 Subject: [PATCH 0024/1137] Fix: Parameter must be an array or an object that implements Countable --- htdocs/core/lib/json.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 6b868663aa7..db343236e54 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -49,7 +49,7 @@ function dol_json_encode($elements) { dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING); - $num=count($elements); + $num = (is_null($elements) ? 0 : count($elements)); // for avoid phpunit error : "Parameter must be an array or an object that implements Countable" if (is_object($elements)) // Count number of properties for an object { $num=0; From 6a350470200b224261d20817d3a5159095e2f104 Mon Sep 17 00:00:00 2001 From: mikee2 Date: Wed, 14 Jun 2017 12:53:29 +0200 Subject: [PATCH 0025/1137] Updated to use dolibarr timme functions Redefined macro strings to adapt to dolibarr date functions return values. Keep same macro names when possible to avoid breaking existing code. Some macro holders (not commonly used) have been dropped because non existing values in dolibarr date functions. Per eldy request changed php date functions with dolibarr's internal date functions to match users time zone. Now dates are those of the user's timezone so check that is is correctly defined in user's profile. --- htdocs/includes/odtphp/Segment.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index 4310c716ee7..d015d6ad263 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -170,16 +170,17 @@ class Segment implements IteratorAggregate, Countable { global $langs; - $nextMonth = strtotime('+1 month'); - - $patterns=array( '/__CURRENTDAY__/u','/__CURRENTDAYTEXT__/u', - '/__CURRENTMONTH__/u','/__CURRENTMONTHSHORT__/u','/__CURRENTMONTHLONG__/u', - '/__NEXTMONTH__/u','/__NEXTMONTHSHORT__/u','/__NEXTMONTHLONG__/u', + $hoy = dol_getdate(dol_now('tzuser')); + $nextMonth = dol_get_next_month($hoy['mon'], $hoy['year'])['month']; + + $patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u', + '/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u', + '/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u', '/__CURRENTYEAR__/u','/__NEXTYEAR__/u' ); - $values=array( date('j'), $langs->trans(date('l')), - $langs->trans(date('n')), $langs->trans(date('M')), $langs->trans(date('F')), - $langs->trans(date('n', $nextMonth)), $langs->trans(date('M', $nextMonth)), $langs->trans(date('F', $nextMonth)), - date('Y'), date('Y', strtotime('+1 year')) ); + $values=array( $hoy['mday'], $langs->trans($hoy['weekday']), + $hoy['mon'], $langs->trans($hoy['month']), + $nextMonth, monthArray($langs)[$nextMonth], + $hoy['year'], $hoy['year']+1 ); $text=preg_replace($patterns, $values, $text); From c50b180e18b988d1bddfd113abc5fc624ab7e8d8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 19 Jun 2017 07:32:14 +0200 Subject: [PATCH 0026/1137] Fix: revert fix --- htdocs/install/inc.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index c799ab2c665..b9efc4eb8a4 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -453,11 +453,6 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0) print '
'; if ($nonext == '2') { - if (!isset($_SERVER['REQUEST_URI'])) - { - $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1 ); - if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; } - } print $langs->trans("ErrorFoundDuringMigration", isset($_SERVER["REQUEST_URI"])?$_SERVER["REQUEST_URI"].'&ignoreerrors=1':'').'

'; } From 3e93f27d98f079a4389cd200b154105a8d851894 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 25 Jun 2017 01:27:41 +0200 Subject: [PATCH 0027/1137] Update index.php --- htdocs/api/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 1e04590da14..c1233295674 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -29,6 +29,10 @@ if (! defined("NOLOGIN")) define("NOLOGIN",'1'); if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK",'1'); +$DOLAPIENTITY = $_SERVER['HTTP_DOLAPIENTITY']; +$entity=(! empty($DOLAPIENTITY) ? (int) $DOLAPIENTITY : (! empty($DOLAPIENTITY) ? (int) $DOLAPIENTITY : 1)); +if (is_numeric($entity)) define("DOLENTITY", $entity); + $res=0; if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php'; if (! $res) die("Include of main fails"); From ffb8c684d0353e911029918cd56c762c8c2f4931 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 6 Jul 2017 13:40:26 +0200 Subject: [PATCH 0028/1137] NEW : Can transmer from bank account to bank account with different currency --- htdocs/compta/bank/class/account.class.php | 53 +++++++-------- htdocs/compta/bank/transfer.php | 76 +++++++++++++++++++++- htdocs/core/ajax/getaccountcurrency.php | 60 +++++++++++++++++ 3 files changed, 161 insertions(+), 28 deletions(-) create mode 100644 htdocs/core/ajax/getaccountcurrency.php diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 43b6dace19c..b0cf86403be 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -39,7 +39,7 @@ class Account extends CommonObject public $element = 'bank_account'; public $table_element = 'bank_account'; public $picto = 'account'; - + /** * @var int Use id instead of rowid * @deprecated @@ -538,7 +538,7 @@ class Account extends CommonObject $now=dol_now(); $this->db->begin(); - + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account ("; $sql.= "datec"; $sql.= ", ref"; @@ -619,14 +619,14 @@ class Account extends CommonObject $result=$this->insertExtraFields(); if ($result < 0) $error++; } - + if (! $error && ! $notrigger) { // Call trigger $result=$this->call_trigger('BANKACCOUNT_CREATE',$user); if ($result < 0) $error++; // End call triggers - } + } } else { @@ -670,9 +670,9 @@ class Account extends CommonObject global $langs,$conf, $hookmanager; $error=0; - + $this->db->begin(); - + // Clean parameters $this->state_id = ($this->state_id?$this->state_id:$this->state_id); $this->country_id = ($this->country_id?$this->country_id:$this->country_id); @@ -739,7 +739,7 @@ class Account extends CommonObject if ($result < 0) $error++; } } - + if (! $error && ! $notrigger) { // Call trigger @@ -754,7 +754,7 @@ class Account extends CommonObject $this->error=$this->db->lasterror(); dol_print_error($this->db); } - + if (! $error) { $this->db->commit(); @@ -906,7 +906,7 @@ class Account extends CommonObject $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_update = $this->db->jdate($obj->date_update); - + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); @@ -923,7 +923,8 @@ class Account extends CommonObject } else { - dol_print_error($this->db); + $this->error=$this->db->lasterror; + $this->errors[]=$this->error; return -1; } } @@ -983,15 +984,15 @@ class Account extends CommonObject global $conf; $error=0; - + $this->db->begin(); - + // Delete link between tag and bank account if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account"; $sql.= " WHERE fk_account = ".$this->id; - + $resql = $this->db->query($sql); if (!$resql) { @@ -999,15 +1000,15 @@ class Account extends CommonObject $this->error = "Error ".$this->db->lasterror(); } } - + if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE rowid = ".$this->rowid; - + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); - if ($result) + if ($result) { // Remove extrafields if ((empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used @@ -1020,13 +1021,13 @@ class Account extends CommonObject } } } - else + else { $error++; $this->error = "Error ".$this->db->lasterror(); - } + } } - + if (! $error) { $this->db->commit(); @@ -1433,7 +1434,7 @@ class Account extends CommonObject * - DeskCode * * Some countries show less or more bank account properties to the user - * + * * @param int $includeibanbic 1=Return also key for IBAN and BIC * @return array * @see useDetailedBBAN @@ -1554,7 +1555,7 @@ class AccountLine extends CommonObject var $element='bank'; var $table_element='bank'; var $picto = 'generic'; - + var $id; var $ref; var $datec; @@ -1842,7 +1843,7 @@ class AccountLine extends CommonObject function update_conciliation(User $user, $cat) { global $conf; - + $this->db->begin(); // Check statement field @@ -1854,7 +1855,7 @@ class AccountLine extends CommonObject return -1; } } - + $sql = "UPDATE ".MAIN_DB_PREFIX."bank SET"; $sql.= " rappro = 1"; $sql.= ", num_releve = '".$this->db->escape($this->num_releve)."'"; @@ -2042,7 +2043,7 @@ class AccountLine extends CommonObject return $result; } - + /** * Return label of status (activity, closed) * @@ -2053,7 +2054,7 @@ class AccountLine extends CommonObject { return $this->LibStatut($this->status,$mode); } - + /** * Renvoi le libelle d'un statut donne * @@ -2097,6 +2098,6 @@ class AccountLine extends CommonObject if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"'); }*/ } - + } diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 73e94a3d197..7c8d4a1826a 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -50,6 +50,7 @@ if ($action == 'add') $dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int')); $label = GETPOST('label','alpha'); $amount= GETPOST('amount'); + $amountto= GETPOST('amountto'); if (! $label) { @@ -71,6 +72,9 @@ if ($action == 'add') $error=1; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors'); } + + + if (! $error) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -81,7 +85,18 @@ if ($action == 'add') $accountto=new Account($db); $accountto->fetch(GETPOST('account_to','int')); - if (($accountto->id != $accountfrom->id) && ($accountto->currency_code == $accountfrom->currency_code)) + if ($accountto->currency_code == $accountfrom->currency_code) { + $amountto=$amount; + } else { + if (! $amountto) + { + $error=1; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AmountTo")), null, 'errors'); + } + } + + + if (($accountto->id != $accountfrom->id) && empty($error)) { $db->begin(); @@ -102,7 +117,7 @@ if ($action == 'add') if (! $error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1*price2num($amount), '', '', $user); if (! ($bank_line_id_from > 0)) $error++; - if (! $error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amount), '', '', $user); + if (! $error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amountto), '', '', $user); if (! ($bank_line_id_to > 0)) $error++; if (! $error) $result=$accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/ligne.php?rowid=', '(banktransfert)', 'banktransfert'); @@ -137,6 +152,61 @@ if ($action == 'add') llxHeader(); + +print ' '; + + $form=new Form($db); $account_from=''; @@ -165,6 +235,7 @@ print ''; print '
'.$objp->num_paiement.''; if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; else print ' '; diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 557d48be680..f42303361ec 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -639,6 +639,7 @@ if ($id > 0) $sql.= " AND p.fk_loan = l.rowid"; $sql.= " AND l.entity = ".$conf->entity; $sql.= " AND p.fk_typepayment = c.id"; + $sql.= " AND c.entity = " . getEntity('c_paiement', 2); $sql.= " ORDER BY dp DESC"; //print $sql; diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index fb6df8fcb6c..90729dd3468 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -179,6 +179,7 @@ class LoanSchedule extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as pt, ".MAIN_DB_PREFIX.$this->table_element." as t)"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepayment = pt.id"; + $sql.= " AND pt.entity = " . getEntity('c_paiement', 2); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 52c822e54c1..ec6672d898f 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -178,6 +178,7 @@ class PaymentLoan extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as pt, ".MAIN_DB_PREFIX."payment_loan as t)"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepayment = pt.id"; + $sql.= " AND pt.entity = " . getEntity('c_paiement', 2); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index e3f873476ba..dbb0dad7149 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -50,7 +50,7 @@ class SupplierProposal extends CommonObject public $fk_element='fk_supplier_proposal'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='propal'; - + /** * {@inheritdoc} */ @@ -140,7 +140,7 @@ class SupplierProposal extends CommonObject var $multicurrency_total_ht; var $multicurrency_total_tva; var $multicurrency_total_ttc; - + /** * Draft status */ @@ -160,10 +160,10 @@ class SupplierProposal extends CommonObject /** * Billed or closed/processed quote */ - const STATUS_CLOSE = 4; - - - + const STATUS_CLOSE = 4; + + + /** * Constructor * @@ -407,7 +407,7 @@ class SupplierProposal extends CommonObject $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc); $txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate. - + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -419,7 +419,7 @@ class SupplierProposal extends CommonObject $multicurrency_total_ht = $tabprice[16]; $multicurrency_total_tva = $tabprice[17]; $multicurrency_total_ttc = $tabprice[18]; - + // Rang to use $rangtouse = $rang; if ($rangtouse == -1) @@ -487,7 +487,7 @@ class SupplierProposal extends CommonObject $this->line->multicurrency_total_ht = $multicurrency_total_ht; $this->line->multicurrency_total_tva = $multicurrency_total_tva; $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; - + // Mise en option de la ligne if (empty($qty) && empty($special_code)) $this->line->special_code=3; @@ -583,7 +583,7 @@ class SupplierProposal extends CommonObject $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc); $txtva = preg_replace('/\s*\(.*\)/','',$txtva); // Remove code into vatrate. - + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $this->thirdparty, $localtaxes_type, 100, $this->multicurrency_tx); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; @@ -595,7 +595,7 @@ class SupplierProposal extends CommonObject $multicurrency_total_ht = $tabprice[16]; $multicurrency_total_tva = $tabprice[17]; $multicurrency_total_ttc = $tabprice[18]; - + // Anciens indicateurs: $price, $remise (a ne plus utiliser) $price = $pu; if ($remise_percent > 0) @@ -662,7 +662,7 @@ class SupplierProposal extends CommonObject if (is_array($array_option) && count($array_option)>0) { $this->line->array_options=$array_option; } - + // Multicurrency $this->line->multicurrency_subprice = price2num($pu * $this->multicurrency_tx); $this->line->multicurrency_total_ht = $multicurrency_total_ht; @@ -1116,8 +1116,8 @@ class SupplierProposal extends CommonObject $sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc"; $sql.= ", cp.code as mode_reglement_code, cp.libelle as mode_reglement"; $sql.= " FROM ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."supplier_proposal as p"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_mode_reglement = cp.id'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON p.fk_cond_reglement = cr.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_mode_reglement = cp.id AND cp.entity = ' . getEntity('c_paiement', 2); + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON p.fk_cond_reglement = cr.rowid AND cr.entity = ' . getEntity('c_payment_term', 2); $sql.= " WHERE p.fk_statut = c.id"; $sql.= " AND p.entity = ".$conf->entity; if ($ref) $sql.= " AND p.ref='".$ref."'"; @@ -1180,7 +1180,7 @@ class SupplierProposal extends CommonObject $this->multicurrency_total_ht = $obj->multicurrency_total_ht; $this->multicurrency_total_tva = $obj->multicurrency_total_tva; $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; - + if ($obj->fk_statut == 0) { $this->brouillon = 1; @@ -1271,7 +1271,7 @@ class SupplierProposal extends CommonObject $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; $line->fk_unit = $objp->fk_unit; - + $this->lines[$i] = $line; $i++; @@ -1653,7 +1653,7 @@ class SupplierProposal extends CommonObject { $trigger_name='SUPPLIER_PROPOSAL_CLASSIFY_BILLED'; } - + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -1704,7 +1704,7 @@ class SupplierProposal extends CommonObject $productsupplier = new ProductFournisseur($this->db); dol_syslog(get_class($this)."::updateOrCreatePriceFournisseur", LOG_DEBUG); - foreach ($this->lines as $product) + foreach ($this->lines as $product) { if ($product->subprice <= 0) continue; @@ -1721,7 +1721,7 @@ class SupplierProposal extends CommonObject $this->createPriceFournisseur($product, $user); } } - + return 1; } @@ -2149,7 +2149,7 @@ class SupplierProposal extends CommonObject $response->label = $label; $response->url = DOL_URL_ROOT.'/supplier_proposal/list.php?viewstatut='.$statut; $response->img = img_object('',"propal"); - + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { @@ -2187,7 +2187,7 @@ class SupplierProposal extends CommonObject global $user,$langs,$conf; // Load array of products prodids - $num_prods = 0; + $num_prods = 0; $prodids = array(); $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; @@ -2250,7 +2250,7 @@ class SupplierProposal extends CommonObject $prodid = mt_rand(1, $num_prods); $line->fk_product=$prodids[$prodid]; } - + $this->lines[$xnbp]=$line; $this->total_ht += $line->total_ht; @@ -2375,10 +2375,10 @@ class SupplierProposal extends CommonObject global $langs, $conf, $user; if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - + $url=''; $result=''; - + $label=''.$langs->trans("ShowSupplierProposal").''; if (! empty($this->ref)) $label.= '
'.$langs->trans('Ref').': '.$this->ref; @@ -2396,7 +2396,7 @@ class SupplierProposal extends CommonObject if ($option == 'document') { $url = DOL_URL_ROOT.'/supplier_proposal/document.php?id='.$this->id. $get_params; } - + $linkclose=''; if (empty($notooltip) && $user->rights->propal->lire) { @@ -2408,7 +2408,7 @@ class SupplierProposal extends CommonObject $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; } - + $linkstart = ''; $linkend=''; @@ -2432,7 +2432,7 @@ class SupplierProposal extends CommonObject function getLinesArray() { // For other object, here we call fetch_lines. But fetch_lines does not exists on supplier proposal - + $sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,'; $sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,'; @@ -2486,7 +2486,7 @@ class SupplierProposal extends CommonObject $this->lines[$i]->rang = $obj->rang; $this->lines[$i]->ref_fourn = $obj->ref_produit_fourn; - + // Multicurrency $this->lines[$i]->fk_multicurrency = $obj->fk_multicurrency; $this->lines[$i]->multicurrency_code = $obj->multicurrency_code; @@ -2541,7 +2541,7 @@ class SupplierProposal extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } - + /** * Function used to replace a thirdparty id with another one. * @@ -2555,10 +2555,10 @@ class SupplierProposal extends CommonObject $tables = array( 'supplier_proposal' ); - + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } - + } @@ -2669,7 +2669,7 @@ class SupplierProposalLine extends CommonObjectLine var $skip_update_total; // Skip update price total for special lines var $ref_fourn; - + // Multicurrency var $fk_multicurrency; var $multicurrency_code; @@ -2750,7 +2750,7 @@ class SupplierProposalLine extends CommonObjectLine $this->product_desc = $objp->product_desc; $this->ref_fourn = $objp->ref_produit_forun; - + // Multicurrency $this->fk_multicurrency = $objp->fk_multicurrency; $this->multicurrency_code = $objp->multicurrency_code; @@ -2798,11 +2798,11 @@ class SupplierProposalLine extends CommonObjectLine if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; if (empty($this->fk_unit)) $this->fk_unit=0; - + if (empty($this->pa_ht)) $this->pa_ht=0; // if buy price not defined, define buyprice as configured in margin admin - if ($this->pa_ht == 0) + if ($this->pa_ht == 0) { if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { @@ -2869,7 +2869,7 @@ class SupplierProposalLine extends CommonObjectLine { $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet'); $this->id=$this->rowid; - + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { $result=$this->insertExtraFields(); @@ -2982,11 +2982,11 @@ class SupplierProposalLine extends CommonObjectLine if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; if (empty($this->fk_unit)) $this->fk_unit=0; - + if (empty($this->pa_ht)) $this->pa_ht=0; // if buy price not defined, define buyprice as configured in margin admin - if ($this->pa_ht == 0) + if ($this->pa_ht == 0) { if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) { @@ -3031,13 +3031,13 @@ class SupplierProposalLine extends CommonObjectLine if (! empty($this->rang)) $sql.= ", rang=".$this->rang; $sql.= " , ref_fourn=".(! empty($this->ref_fourn)?"'".$this->db->escape($this->ref_fourn)."'":"null"); $sql.= " , fk_unit=".($this->fk_unit?$this->fk_unit:'null'); - + // Multicurrency $sql.= " , multicurrency_subprice=".price2num($this->multicurrency_subprice).""; $sql.= " , multicurrency_total_ht=".price2num($this->multicurrency_total_ht).""; $sql.= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql.= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - + $sql.= " WHERE rowid = ".$this->rowid; dol_syslog(get_class($this)."::update", LOG_DEBUG); From 58b3d86b498d18e99667a59a76ce1b5e98604cb0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 09:40:43 +0200 Subject: [PATCH 0013/1137] Fix: errors --- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/facture/card.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index eafb406ba58..ab76fa34fd5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1560,7 +1560,7 @@ class Commande extends CommonOrder $sql.= ', dr.code as demand_reason_code'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid AND cr.entity = ' . getEntity('c_payment_term', 2) . ')'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON (c.fk_mode_reglement = p.id AND cr.entity = ' . getEntity('c_paiement', 2) . ')'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON (c.fk_mode_reglement = p.id AND p.entity = ' . getEntity('c_paiement', 2) . ')'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON (c.fk_availability = ca.rowid)'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON (c.fk_input_reason = ca.rowid)'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 5330eca86a4..b5a2177d798 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -413,7 +413,7 @@ class Account extends CommonObject { $sql = "SELECT code FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " WHERE id=".$oper; - $sql.= " AND entity = " . getEntity('c_payement_term', 2) . ")"; + $sql.= " AND entity = " . getEntity('c_paiement', 2) . ")"; $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 319369fa304..6f1454de1d3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -653,7 +653,7 @@ if (empty($reshook)) $sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p'; $sql.= ' WHERE pf.fk_facture = '.$object->id; $sql.= ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; - $sql.= ' AND p.entity = ' . getEntity('c_paiement', 2); + $sql.= ' AND c.entity = ' . getEntity('c_paiement', 2); $sql.= ' ORDER BY p.datep, p.tms'; $resql = $db->query($sql); From 4bd7bb86a79221131e7e95a90ca8064e8789adfb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 10:13:24 +0200 Subject: [PATCH 0014/1137] Fix: try to add functions.lib.php to avoid phpunit error --- test/phpunit/PricesTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 3e09450b9cb..a171feb9d3c 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -28,6 +28,7 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; +require_once dirname(__FILE__).'/../../htdocs/core/lib/functions.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/price.lib.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; @@ -160,7 +161,7 @@ class PricesTest extends PHPUnit_Framework_TestCase print __METHOD__." result1=".join(', ',$result1)."\n"; // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) $this->assertEquals(array(17.12, 1.71, 18.83, 8.56, 0.856, 9.416, 17.12, 1.71, 18.83, 0, 0, 0, 0, 0, 0, 0, 18.7, 1.87, 20.56, 9.34795),$result1,'Test1 FR'); - + // qty=2, unit_price=0, discount_line=0, vat_rate=10, price_base_type='HT', multicurrency_tx=1.09205 (method we provide value), pu_ht_devise=100 $mysoc->country_code='FR'; $mysoc->country_id=1; @@ -168,7 +169,7 @@ class PricesTest extends PHPUnit_Framework_TestCase print __METHOD__." result1=".join(', ',$result1)."\n"; // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) $this->assertEquals(array(36.63, 3.66, 40.29, 18.31418, 1.83142, 20.1456, 36.63, 3.66, 40.29, 0, 0, 0, 0, 0, 0, 0, 40, 4, 44, 20),$result1,'Test1 FR'); - + /* * Country Spain */ From 0a442365a7e1278d8f469d8ae08e20d91d99bc40 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 11:46:26 +0200 Subject: [PATCH 0015/1137] Revert "Fix: try to add functions.lib.php to avoid phpunit error" This reverts commit 4bd7bb86a79221131e7e95a90ca8064e8789adfb. --- test/phpunit/PricesTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index a171feb9d3c..3e09450b9cb 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -28,7 +28,6 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; -require_once dirname(__FILE__).'/../../htdocs/core/lib/functions.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/price.lib.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; @@ -161,7 +160,7 @@ class PricesTest extends PHPUnit_Framework_TestCase print __METHOD__." result1=".join(', ',$result1)."\n"; // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) $this->assertEquals(array(17.12, 1.71, 18.83, 8.56, 0.856, 9.416, 17.12, 1.71, 18.83, 0, 0, 0, 0, 0, 0, 0, 18.7, 1.87, 20.56, 9.34795),$result1,'Test1 FR'); - + // qty=2, unit_price=0, discount_line=0, vat_rate=10, price_base_type='HT', multicurrency_tx=1.09205 (method we provide value), pu_ht_devise=100 $mysoc->country_code='FR'; $mysoc->country_id=1; @@ -169,7 +168,7 @@ class PricesTest extends PHPUnit_Framework_TestCase print __METHOD__." result1=".join(', ',$result1)."\n"; // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) $this->assertEquals(array(36.63, 3.66, 40.29, 18.31418, 1.83142, 20.1456, 36.63, 3.66, 40.29, 0, 0, 0, 0, 0, 0, 0, 40, 4, 44, 20),$result1,'Test1 FR'); - + /* * Country Spain */ From 6dfb8e33c9354d0106752fe22edc1b344a73b27c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 12:12:25 +0200 Subject: [PATCH 0016/1137] Fix: try to debug --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bf34c86bd58..a040342b2e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -299,7 +299,8 @@ script: set +e echo #cat $TRAVIS_BUILD_DIR/upgrade400500-2.log - #cat /tmp/dolibarr_install.log + cat $TRAVIS_BUILD_DIR/upgrade500600-2.log + cat /tmp/dolibarr_install.log - | echo "Unit testing" From 1056473cdccc01a392057102c1cc024df73875ff Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 13:45:36 +0200 Subject: [PATCH 0017/1137] Try to fix travis error --- htdocs/install/inc.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 6da4125a56c..8045aada0b1 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -385,12 +385,12 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='',$css // We force the content charset header("Content-type: text/html; charset=".$conf->file->character_set_client); header("X-Content-Type-Options: nosniff"); - + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; @@ -453,9 +453,14 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0) print '
'; if ($nonext == '2') { - print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'

'; + if (!isset($_SERVER['REQUEST_URI'])) + { + $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1 ); + if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; } + } + print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'

'; } - + print '"'; if ($jscheckfunction) print ' onClick="return '.$jscheckfunction.'();"'; print '>
'; From 460a6f0fb75c1eb96d273fa3279b2c3c8fa3ec97 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 9 Jun 2017 14:15:29 +0200 Subject: [PATCH 0018/1137] Fix: phpunit : Unexpected 'print' (T_PRINT) --- htdocs/admin/perms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 03b29abc109..eb348869b34 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -187,11 +187,11 @@ if ($result) print '
' + print ''; print img_object('',$picto,'class="pictoobjectwidth"').' '.$objMod->getName(); print ' '; print ''.$perm_libelle. '
'; print ''; print ''; +print ''; print ''; $var=false; @@ -181,6 +252,7 @@ $form->select_date((! empty($dateo)?$dateo:''),'','','','','add'); print "\n"; print ''; print ''; +print ''; print "
'.$langs->trans("TransferFrom").''.$langs->trans("TransferTo").''.$langs->trans("Date").''.$langs->trans("Description").''.$langs->trans("Amount").'
"; diff --git a/htdocs/core/ajax/getaccountcurrency.php b/htdocs/core/ajax/getaccountcurrency.php new file mode 100644 index 00000000000..40e52672c0e --- /dev/null +++ b/htdocs/core/ajax/getaccountcurrency.php @@ -0,0 +1,60 @@ + + * + * 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 3 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, see . + */ + +/** + * \file htdocs/core/ajax/vatrates.php + * \brief File to load vat rates combobox + */ + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); + +require '../../main.inc.php'; + +$id = GETPOST('id','int'); + +/* + * View + */ + +top_httphead(); + +//print ''."\n"; + +// Load original field value +if (! empty($id)) +{ + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $account=new Account($db); + $result = $account->fetch($id); + if ($result<0) { + $return['value'] = ''; + $return['num'] = $result; + $return['error'] = $account->errors[0]; + } else { + $return['value'] = $account->currency_code; + $return['num'] = $result; + $return['error'] = ''; + } + + echo json_encode($return); +} + From 3825e7fd52870e39e94da7ca0899a4bdedf0e445 Mon Sep 17 00:00:00 2001 From: hguibourgdev Date: Sat, 15 Jul 2017 18:55:52 +0200 Subject: [PATCH 0029/1137] Update replenish.php FIX ">=" instead of ">" for alert test in order to work when negatif stock are allowed --- htdocs/product/stock/replenish.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index a3f4cb8ecaf..695cea9a9af 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -357,17 +357,17 @@ if ($usevirtualstock) if ($salert == 'on') // Option to see when stock is lower than alert { - $sql.= ' AND ('.$sqlalertstock.' > 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; + $sql.= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql.= ' - ('.$sqlCommandesCli.' - '.$sqlExpeditionsCli.') + ('.$sqlCommandesFourn.' - '.$sqlReceptionFourn.')))'; $alertchecked = 'checked'; } } else { - $sql.= ' HAVING (('.$sqldesiredtock.' > 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; - $sql.= ' OR ('.$sqlalertstock.' > 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))'; + $sql.= ' HAVING (('.$sqldesiredtock.' >= 0 AND ('.$sqldesiredtock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; + $sql.= ' OR ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").'))))'; if ($salert == 'on') // Option to see when stock is lower than alert { - $sql.= ' AND ('.$sqlalertstock.' > 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; + $sql.= ' AND ('.$sqlalertstock.' >= 0 AND ('.$sqlalertstock.' > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')))'; $alertchecked = 'checked'; } } From dcc3febf6f99fdcc70580aee153bd41396a7c3a7 Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Thu, 20 Jul 2017 18:22:53 +0200 Subject: [PATCH 0030/1137] add bookkkeeping in report turnover --- htdocs/compta/stats/index.php | 42 +++++++++++++++++++++++++++++----- htdocs/langs/fr_FR/compta.lang | 1 + 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 19c106a44dc..0c4a16edf7b 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2017 Olivier Geffroy * * 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 @@ -62,6 +63,7 @@ if ($modecompta=="CREANCES-DETTES") $nom=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCADue"); @@ -70,10 +72,12 @@ if ($modecompta=="CREANCES-DETTES") $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -else { +else if ($modecompta=="RECETTES-DEPENSES") +{ $nom=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period="$year_start - $year_end"; $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCAIn"); @@ -81,6 +85,20 @@ else { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } +else if ($modecompta=="BOOKKEEPING") +{ + $nom=$langs->trans("BookkeepingTurnover"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $period="$year_start - $year_end"; + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $description=$langs->trans("RulesCABookkeeping"); + $description.= $langs->trans("DepositsAreIncluded"); + $builddate=time(); + //$exportlink=$langs->trans("NotYetAvailable"); +} + $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); @@ -98,8 +116,10 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " WHERE f.fk_statut in (1,2)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; else $sql.= " AND f.type IN (0,1,2,3,5)"; + $sql.= " AND f.entity = ".$conf->entity; +if ($socid) $sql.= " AND f.fk_soc = ".$socid; } -else +else if ($modecompta=="RECETTES-DEPENSES") { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -111,9 +131,19 @@ else $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; $sql.= " WHERE p.rowid = pf.fk_paiement"; $sql.= " AND pf.fk_facture = f.rowid"; -} -$sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; +} +else if ($modecompta=="BOOKKEEPING") +{ + $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b"; + $sql.= " WHERE b.numero_compte IN (SELECT a.account_number" ; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_account as a"; + $sql.= " WHERE a.fk_accounting_category = 1 ) " ; // todo sql with accounting category, but we need to define category in turnover +} + + $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; @@ -481,7 +511,7 @@ print '
'; $i++; } - print "Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r�gl� des factures partiellement r�gl�es"; + print "Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r?gl? des factures partiellement r?gl?es"; } $db->free($resql); } diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index ae51312a5f7..067a349aefd 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -130,6 +130,7 @@ AnnualByCompaniesDueDebtMode=Bilan des recettes et dépenses, détail par tiers AnnualByCompaniesInputOutputMode=Bilan des recettes et dépenses, détail par tiers SeeReportInInputOutputMode=Cliquer sur %sRecettes-Dépenses%s dit comptabilité de caisse pour un calcul sur les paiements effectivement réalisés SeeReportInDueDebtMode=Cliquer sur %sCréances-Dettes%s dit comptabilité d'engagement pour un calcul sur les factures émises +SeeReportInBookkeepingMode=Cliquer sur %sGrand Livre%s dit comptabilité avance pour un calcul sur les factures dans le grand livre RulesAmountWithTaxIncluded=- Les montants affichés sont les montants taxe incluse RulesResultDue=- Il comprend les factures impayées, les dépenses, la TVA, les dons qu'elles soient payées ou non. Il comprend également les salaires versés.
- Il est basé sur la date de validation de factures et de la TVA et à la date prévue pour les dépenses. Pour les salaires définis avec le module de salaire, la date de paiement de la valeur est utilisée. RulesResultInOut=- Il comprend les paiements réels effectués sur les factures, les dépenses, la TVA et les salaires.
- Il est basé sur les dates de paiement des factures, les dépenses, la TVA et les salaires. La date du don pour le don. From 2be75420caaf2e95a29585d3f73ae24194dd592e Mon Sep 17 00:00:00 2001 From: altatof Date: Mon, 7 Aug 2017 10:21:38 +0200 Subject: [PATCH 0031/1137] FIX : supplier id was not passed to hooks --- htdocs/fourn/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index d3c0fa7357d..ee6ac67412a 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -66,7 +66,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard')); * Action */ -$parameters=array('socid'=>$socid); +$parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 0bf4ac6fb3d592d5fc0d8d06535fd6b562e742dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Aug 2017 20:06:26 +0200 Subject: [PATCH 0032/1137] Add missing field fk_supplier_proposal --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index f1c94f346cf..8880f3fae97 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -34,6 +34,7 @@ ALTER TABLE llx_product_customer_price ADD COLUMN localtax1_type varchar(10) NO ALTER TABLE llx_product_customer_price ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx; ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0' after localtax1_tx; ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx; +ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin; From ca3cdfabec0886fbf24c2545a5b821bcf5f769ef Mon Sep 17 00:00:00 2001 From: fappels Date: Wed, 9 Aug 2017 14:15:26 +0200 Subject: [PATCH 0033/1137] FIX Best buy price calculation Best buy price also depends on buy discount. --- htdocs/fourn/class/fournisseur.product.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 34a11663e2a..4d155bbce5f 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -581,7 +581,8 @@ class ProductFournisseur extends Product foreach($record_array as $record) { $fourn_price = $record["price"]; - $fourn_unitprice = $record["unitprice"]; + // discount calculated buy price + $fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) + $record["unitcharges"] - $record["remise"]; if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) { $prod_supplier = new ProductFournisseur($this->db); $prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"]; @@ -613,7 +614,7 @@ class ProductFournisseur extends Product $this->fourn_qty = $record["quantity"]; $this->fourn_remise_percent = $record["remise_percent"]; $this->fourn_remise = $record["remise"]; - $this->fourn_unitprice = $fourn_unitprice; + $this->fourn_unitprice = $record["unitprice"]; $this->fourn_charges = $record["charges"]; // deprecated $this->fourn_unitcharges = $record["unitcharges"]; // deprecated $this->fourn_tva_tx = $record["tva_tx"]; @@ -622,7 +623,7 @@ class ProductFournisseur extends Product $this->delivery_time_days = $record["delivery_time_days"]; $this->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; $this->id = $prodid; - $min = $this->fourn_unitprice; + $min = $fourn_unitprice; } } } From 34a7c7667d442cc4374cf840c969dcbd30ed1c94 Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Fri, 11 Aug 2017 14:40:29 +0200 Subject: [PATCH 0034/1137] Add Dolistore module Explore and find dolistore modules directly in your Dolibarr --- htdocs/dolistore/ajax/image.php | 65 + .../class/PSWebServiceLibrary.class.php | 409 ++++ htdocs/dolistore/class/dolistore.class.php | 308 +++ htdocs/dolistore/class/init.php | 72 + .../core/modules/modDolistore.class.php | 159 ++ htdocs/dolistore/css/dolistore.css | 234 ++ htdocs/dolistore/img/Download-128.png | Bin 0 -> 761 bytes htdocs/dolistore/img/NoImageAvailable.png | Bin 0 -> 11231 bytes htdocs/dolistore/img/compatible.png | Bin 0 -> 2147 bytes htdocs/dolistore/img/dolistore.png | Bin 0 -> 11317 bytes htdocs/dolistore/img/follow.png | Bin 0 -> 2869 bytes htdocs/dolistore/img/object_dolistore.png | Bin 0 -> 1851 bytes htdocs/dolistore/index.php | 115 + htdocs/dolistore/js/dolistore.js.php | 79 + htdocs/dolistore/js/fancybox/blank.gif | Bin 0 -> 43 bytes .../js/fancybox/fancybox_loading.gif | Bin 0 -> 6567 bytes .../js/fancybox/fancybox_loading@2x.gif | Bin 0 -> 13984 bytes .../js/fancybox/fancybox_overlay.png | Bin 0 -> 1003 bytes .../dolistore/js/fancybox/fancybox_sprite.png | Bin 0 -> 1362 bytes .../js/fancybox/fancybox_sprite@2x.png | Bin 0 -> 6553 bytes .../js/fancybox/helpers/fancybox_buttons.png | Bin 0 -> 1080 bytes .../helpers/jquery.fancybox-buttons.css | 97 + .../helpers/jquery.fancybox-buttons.js | 122 + .../fancybox/helpers/jquery.fancybox-media.js | 201 ++ .../helpers/jquery.fancybox-thumbs.css | 55 + .../helpers/jquery.fancybox-thumbs.js | 165 ++ .../dolistore/js/fancybox/jquery.fancybox.css | 275 +++ .../dolistore/js/fancybox/jquery.fancybox.js | 2018 +++++++++++++++++ .../js/fancybox/jquery.fancybox.pack.js | 46 + htdocs/dolistore/langs/de_DE/dolistore.lang | 22 + htdocs/dolistore/langs/en_EN/dolistore.lang | 22 + htdocs/dolistore/langs/es_ES/dolistore.lang | 22 + htdocs/dolistore/langs/fr_FR/dolistore.lang | 22 + htdocs/dolistore/langs/it_IT/dolistore.lang | 22 + 34 files changed, 4530 insertions(+) create mode 100644 htdocs/dolistore/ajax/image.php create mode 100644 htdocs/dolistore/class/PSWebServiceLibrary.class.php create mode 100644 htdocs/dolistore/class/dolistore.class.php create mode 100644 htdocs/dolistore/class/init.php create mode 100644 htdocs/dolistore/core/modules/modDolistore.class.php create mode 100644 htdocs/dolistore/css/dolistore.css create mode 100644 htdocs/dolistore/img/Download-128.png create mode 100644 htdocs/dolistore/img/NoImageAvailable.png create mode 100644 htdocs/dolistore/img/compatible.png create mode 100644 htdocs/dolistore/img/dolistore.png create mode 100644 htdocs/dolistore/img/follow.png create mode 100644 htdocs/dolistore/img/object_dolistore.png create mode 100644 htdocs/dolistore/index.php create mode 100644 htdocs/dolistore/js/dolistore.js.php create mode 100644 htdocs/dolistore/js/fancybox/blank.gif create mode 100644 htdocs/dolistore/js/fancybox/fancybox_loading.gif create mode 100644 htdocs/dolistore/js/fancybox/fancybox_loading@2x.gif create mode 100644 htdocs/dolistore/js/fancybox/fancybox_overlay.png create mode 100644 htdocs/dolistore/js/fancybox/fancybox_sprite.png create mode 100644 htdocs/dolistore/js/fancybox/fancybox_sprite@2x.png create mode 100644 htdocs/dolistore/js/fancybox/helpers/fancybox_buttons.png create mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-buttons.css create mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-buttons.js create mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-media.js create mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.css create mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.js create mode 100644 htdocs/dolistore/js/fancybox/jquery.fancybox.css create mode 100644 htdocs/dolistore/js/fancybox/jquery.fancybox.js create mode 100644 htdocs/dolistore/js/fancybox/jquery.fancybox.pack.js create mode 100644 htdocs/dolistore/langs/de_DE/dolistore.lang create mode 100644 htdocs/dolistore/langs/en_EN/dolistore.lang create mode 100644 htdocs/dolistore/langs/es_ES/dolistore.lang create mode 100644 htdocs/dolistore/langs/fr_FR/dolistore.lang create mode 100644 htdocs/dolistore/langs/it_IT/dolistore.lang diff --git a/htdocs/dolistore/ajax/image.php b/htdocs/dolistore/ajax/image.php new file mode 100644 index 00000000000..5bc6c9f2f0f --- /dev/null +++ b/htdocs/dolistore/ajax/image.php @@ -0,0 +1,65 @@ +. + * + * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); + * it under the terms of the GNU General Public License as published bypliance with the License. + * the Free Software Foundation; either version 3 of the License, or + * + * 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, see . + * or see http://www.gnu.org/ + */ + +if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); +/** + * \file htdocs/commande/info.php + * \ingroup commande + * \brief Page des informations d'une commande + */ +$res = 0; +if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); +if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); +if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); +if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); +if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res) die("Include of main fails"); + +// CORE + +global $lang, $user, $conf; + + +dol_include_once('/dolistore/class/dolistore.class.php'); +$dolistore = new Dolistore(); + +$id_product = GETPOST('id_product', 'int'); +$id_image = GETPOST('id_image', 'int'); +// quality : image resize with this in the URL : "cart_default", "home_default", "large_default", "medium_default", "small_default", "thickbox_default" +$quality = GETPOST('quality', 'alpha'); + +try { + $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; + $api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api); + //echo $url; + $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); + header('Content-type:image'); + print $request['response']; +} catch (PrestaShopWebserviceException $e) { + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + else if ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); +} \ No newline at end of file diff --git a/htdocs/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/dolistore/class/PSWebServiceLibrary.class.php new file mode 100644 index 00000000000..8f55f6fd323 --- /dev/null +++ b/htdocs/dolistore/class/PSWebServiceLibrary.class.php @@ -0,0 +1,409 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +* PrestaShop Webservice Library +* @package PrestaShopWebservice +*/ + +/** + * @package PrestaShopWebservice + */ +class PrestaShopWebservice +{ + + /** @var string Shop URL */ + protected $url; + + /** @var string Authentification key */ + protected $key; + + /** @var boolean is debug activated */ + protected $debug; + + /** @var string PS version */ + protected $version; + + /** @var array compatible versions of PrestaShop Webservice */ + const psCompatibleVersionsMin = '1.4.0.0'; + const psCompatibleVersionsMax = '1.6.99.99'; + + /** + * PrestaShopWebservice constructor. Throw an exception when CURL is not installed/activated + * + * getMessage(); + * } + * ?> + * + * @param string $url Root URL for the shop + * @param string $key Authentification key + * @param mixed $debug Debug mode Activated (true) or deactivated (false) + */ + function __construct($url, $key, $debug = true) { + if (!extension_loaded('curl')) + throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library'); + $this->url = $url; + $this->key = $key; + $this->debug = $debug; + $this->version = 'unknown'; + } + + /** + * Take the status code and throw an exception if the server didn't return 200 or 201 code + * @param int $status_code Status code of an HTTP return + */ + protected function checkStatusCode($status_code) + { + $error_label = 'This call to PrestaShop Web Services failed and returned an HTTP status of %d. That means: %s.'; + switch($status_code) + { + case 200: case 201: break; + case 204: throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'No content'));break; + case 400: throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Bad Request'));break; + case 401: throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Unauthorized'));break; + case 404: throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Not Found'));break; + case 405: throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Method Not Allowed'));break; + case 500: throw new PrestaShopWebserviceException(sprintf($error_label, $status_code, 'Internal Server Error'));break; + default: throw new PrestaShopWebserviceException('This call to PrestaShop Web Services returned an unexpected HTTP status of:' . $status_code); + } + } + /** + * Handles a CURL request to PrestaShop Webservice. Can throw exception. + * @param string $url Resource name + * @param mixed $curl_params CURL parameters (sent to curl_set_opt) + * @return array status_code, response + */ + public function executeRequest($url, $curl_params = array()) + { + $defaultParams = array( + CURLOPT_HEADER => TRUE, + CURLOPT_RETURNTRANSFER => TRUE, + CURLINFO_HEADER_OUT => TRUE, + CURLOPT_HTTPAUTH => CURLAUTH_BASIC, + CURLOPT_USERPWD => $this->key.':', + CURLOPT_HTTPHEADER => array( 'Expect:' ) + ); + + $session = curl_init($url); + + $curl_options = array(); + foreach ($defaultParams as $defkey => $defval) + { + if (isset($curl_params[$defkey])) + $curl_options[$defkey] = $curl_params[$defkey]; + else + $curl_options[$defkey] = $defaultParams[$defkey]; + } + foreach ($curl_params as $defkey => $defval) + if (!isset($curl_options[$defkey])) + $curl_options[$defkey] = $curl_params[$defkey]; + + curl_setopt_array($session, $curl_options); + $response = curl_exec($session); + + $index = strpos($response, "\r\n\r\n"); + if ($index === false && $curl_params[CURLOPT_CUSTOMREQUEST] != 'HEAD') + throw new PrestaShopWebserviceException('Bad HTTP response'); + + $header = substr($response, 0, $index); + $body = substr($response, $index + 4); + + $headerArrayTmp = explode("\n", $header); + + $headerArray = array(); + foreach ($headerArrayTmp as &$headerItem) + { + $tmp = explode(':', $headerItem); + $tmp = array_map('trim', $tmp); + if (count($tmp) == 2) + $headerArray[$tmp[0]] = $tmp[1]; + } + + if (array_key_exists('PSWS-Version', $headerArray)) + { + $this->version = $headerArray['PSWS-Version']; + if ( + version_compare(PrestaShopWebservice::psCompatibleVersionsMin, $headerArray['PSWS-Version']) == 1 || + version_compare(PrestaShopWebservice::psCompatibleVersionsMax, $headerArray['PSWS-Version']) == -1 + ) + throw new PrestaShopWebserviceException('This library is not compatible with this version of PrestaShop. Please upgrade/downgrade this library'); + } + + if ($this->debug) + { + $this->printDebug('HTTP REQUEST HEADER', curl_getinfo($session, CURLINFO_HEADER_OUT)); + $this->printDebug('HTTP RESPONSE HEADER', $header); + + } + $status_code = curl_getinfo($session, CURLINFO_HTTP_CODE); + if ($status_code === 0) + throw new PrestaShopWebserviceException('CURL Error: '.curl_error($session)); + curl_close($session); + if ($this->debug) + { + if ($curl_params[CURLOPT_CUSTOMREQUEST] == 'PUT' || $curl_params[CURLOPT_CUSTOMREQUEST] == 'POST') + $this->printDebug('XML SENT', urldecode($curl_params[CURLOPT_POSTFIELDS])); + if ($curl_params[CURLOPT_CUSTOMREQUEST] != 'DELETE' && $curl_params[CURLOPT_CUSTOMREQUEST] != 'HEAD') + $this->printDebug('RETURN HTTP BODY', $body); + } + return array('status_code' => $status_code, 'response' => $body, 'header' => $header); + } + + public function printDebug($title, $content) + { + echo '
'.$title.'
'.htmlentities($content).'
'; + } + + public function getVersion() + { + return $this->version; + } + + /** + * Load XML from string. Can throw exception + * @param string $response String from a CURL response + * @return SimpleXMLElement status_code, response + */ + protected function parseXML($response) + { + if ($response != '') + { + libxml_clear_errors(); + libxml_use_internal_errors(true); + $xml = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOCDATA); + if (libxml_get_errors()) + { + $msg = var_export(libxml_get_errors(), true); + libxml_clear_errors(); + throw new PrestaShopWebserviceException('HTTP XML response is not parsable: '.$msg); + } + return $xml; + } + else + throw new PrestaShopWebserviceException('HTTP response is empty'); + } + + /** + * Add (POST) a resource + *

Unique parameter must take :

+ * 'resource' => Resource name
+ * 'postXml' => Full XML string to add resource

+ * Examples are given in the tutorial

+ * @param array $options + * @return SimpleXMLElement status_code, response + */ + public function add($options) + { + $xml = ''; + + if (isset($options['resource'], $options['postXml']) || isset($options['url'], $options['postXml'])) + { + $url = (isset($options['resource']) ? $this->url.'/api/'.$options['resource'] : $options['url']); + $xml = $options['postXml']; + if (isset($options['id_shop'])) + $url .= '&id_shop='.$options['id_shop']; + if (isset($options['id_group_shop'])) + $url .= '&id_group_shop='.$options['id_group_shop']; + } + else + throw new PrestaShopWebserviceException('Bad parameters given'); + $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml)); + + self::checkStatusCode($request['status_code']); + return self::parseXML($request['response']); + } + + /** + * Retrieve (GET) a resource + *

Unique parameter must take :

+ * 'url' => Full URL for a GET request of Webservice (ex: http://mystore.com/api/customers/1/)
+ * OR
+ * 'resource' => Resource name,
+ * 'id' => ID of a resource you want to get

+ *

+ * + * get(array('resource' => 'orders', 'id' => 1)); + * // Here in $xml, a SimpleXMLElement object you can parse + * foreach ($xml->children()->children() as $attName => $attValue) + * echo $attName.' = '.$attValue.'
'; + * } + * catch (PrestaShopWebserviceException $ex) + * { + * echo 'Error : '.$ex->getMessage(); + * } + * ?> + *
+ * @param array $options Array representing resource to get. + * @return SimpleXMLElement status_code, response + */ + public function get($options) + { + if (isset($options['url'])) + $url = $options['url']; + elseif (isset($options['resource'])) + { + $url = $this->url.'/api/'.$options['resource']; + $url_params = array(); + if (isset($options['id'])) + $url .= '/'.$options['id']; + + $params = array('filter', 'display', 'sort', 'limit', 'id_shop', 'id_group_shop'); + foreach ($params as $p) + foreach ($options as $k => $o) + if (strpos($k, $p) !== false) + $url_params[$k] = $options[$k]; + if (count($url_params) > 0) + $url .= '?'.http_build_query($url_params); + } + else + throw new PrestaShopWebserviceException('Bad parameters given '); + + $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); + self::checkStatusCode($request['status_code']);// check the response validity + return self::parseXML($request['response']); + } + + /** + * Head method (HEAD) a resource + * + * @param array $options Array representing resource for head request. + * @return SimpleXMLElement status_code, response + */ + public function head($options) + { + if (isset($options['url'])) + $url = $options['url']; + elseif (isset($options['resource'])) + { + $url = $this->url.'/api/'.$options['resource']; + $url_params = array(); + if (isset($options['id'])) + $url .= '/'.$options['id']; + + $params = array('filter', 'display', 'sort', 'limit'); + foreach ($params as $p) + foreach ($options as $k => $o) + if (strpos($k, $p) !== false) + $url_params[$k] = $options[$k]; + if (count($url_params) > 0) + $url .= '?'.http_build_query($url_params); + } + else + throw new PrestaShopWebserviceException('Bad parameters given'); + $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'HEAD', CURLOPT_NOBODY => true)); + self::checkStatusCode($request['status_code']);// check the response validity + return $request['header']; + } + /** + * Edit (PUT) a resource + *

Unique parameter must take :

+ * 'resource' => Resource name ,
+ * 'id' => ID of a resource you want to edit,
+ * 'putXml' => Modified XML string of a resource

+ * Examples are given in the tutorial

+ * @param array $options Array representing resource to edit. + */ + public function edit($options) + { + $xml = ''; + if (isset($options['url'])) + $url = $options['url']; + elseif ((isset($options['resource'], $options['id']) || isset($options['url'])) && $options['putXml']) + { + $url = (isset($options['url']) ? $options['url'] : $this->url.'/api/'.$options['resource'].'/'.$options['id']); + $xml = $options['putXml']; + if (isset($options['id_shop'])) + $url .= '&id_shop='.$options['id_shop']; + if (isset($options['id_group_shop'])) + $url .= '&id_group_shop='.$options['id_group_shop']; + } + else + throw new PrestaShopWebserviceException('Bad parameters given'); + + $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); + self::checkStatusCode($request['status_code']);// check the response validity + return self::parseXML($request['response']); + } + + /** + * Delete (DELETE) a resource. + * Unique parameter must take :

+ * 'resource' => Resource name
+ * 'id' => ID or array which contains IDs of a resource(s) you want to delete

+ * + * delete(array('resource' => 'orders', 'id' => 1)); + * // Following code will not be executed if an exception is thrown. + * echo 'Successfully deleted.'; + * } + * catch (PrestaShopWebserviceException $ex) + * { + * echo 'Error : '.$ex->getMessage(); + * } + * ?> + * + * @param array $options Array representing resource to delete. + */ + public function delete($options) + { + if (isset($options['url'])) + $url = $options['url']; + elseif (isset($options['resource']) && isset($options['id'])) + if (is_array($options['id'])) + $url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']'; + else + $url = $this->url.'/api/'.$options['resource'].'/'.$options['id']; + if (isset($options['id_shop'])) + $url .= '&id_shop='.$options['id_shop']; + if (isset($options['id_group_shop'])) + $url .= '&id_group_shop='.$options['id_group_shop']; + $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE')); + self::checkStatusCode($request['status_code']);// check the response validity + return true; + } + + +} + +/** + * @package PrestaShopWebservice + */ +class PrestaShopWebserviceException extends Exception { } \ No newline at end of file diff --git a/htdocs/dolistore/class/dolistore.class.php b/htdocs/dolistore/class/dolistore.class.php new file mode 100644 index 00000000000..35900d66f7d --- /dev/null +++ b/htdocs/dolistore/class/dolistore.class.php @@ -0,0 +1,308 @@ +. + * + * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); + * it under the terms of the GNU General Public License as published bypliance with the License. + * the Free Software Foundation; either version 3 of the License, or + * + * 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, see . + * or see http://www.gnu.org/ + */ +dol_include_once('/core/lib/admin.lib.php'); +dol_include_once('/dolistore/class/PSWebServiceLibrary.class.php'); + +class Dolistore extends DolistoreModel +{ + // params + public $start // beginning of pagination + , $end // end of pagination + , $per_page // pagination: display per page + , $categorie // the current categorie + , $search // the search keywords + // setups + , $url // the url of this page + , $shop_url // the url of the shop + , $vat_rate // the vat rate used in the shop (prices are provided without vat) + , $lang // the integer representing the lang in the store + , $debug_api; // usefull if no dialog + + function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) + { + global $conf, $langs; + + $this->start = $options['start']; + $this->end = $options['end']; + $this->per_page = $options['per_page']; + $this->categorie = $options['categorie']; + $this->search = $options['search']; + + $this->url = dol_buildpath('/dolistore/index.php', 2); + $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; + $this->vat_rate = 1.2; // 20% de TVA + $this->debug_api = false; + + if ($this->end == 0) { + $this->end = $this->per_page; + } + + $lang = explode('_', $langs->defaultlang); + $lang = $lang[0]; + $lang_array = ['fr', 'en', 'es', 'it', 'de']; + if (!in_array($lang, $lang_array)) { + $lang = 'en'; + } + $this->lang = array_search($lang, $lang_array) + 1; // 1=fr 2=en ... + + try { + $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); + + // Here we set the option array for the Webservice : we want products resources + $opt = array(); + $opt['resource'] = 'products'; + // make a search to limit the id returned. + if ($this->search != '') { + $opt2 = array(); + $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->products->children() as $product) { + $products[] = (int) $product['id']; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } elseif ($this->categorie != 0) { + $opt2 = array(); + $opt2['resource'] = 'categories'; + $opt2['id'] = $this->categorie; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->category->associations->products->children() as $product) { + $products[] = (int) $product->id; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } + $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; + $opt['sort'] = 'id_desc'; + $opt['filter[active]'] = '[1]'; + $opt['limit'] = "$this->start,$this->end"; + // Call + $xml = $this->api->get($opt); + $this->products = $xml->products->children(); + + + // Here we set the option array for the Webservice : we want categories resources + $opt = array(); + $opt['resource'] = 'categories'; + $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; + $opt['sort'] = 'id_asc'; + // Call + $xml = $this->api->get($opt); + $this->categories = $xml->categories->children(); + } catch (PrestaShopWebserviceException $e) { + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + else if ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); + } + } + + function get_previous_url() + { + $param_array = array(); + if ($this->start < $this->per_page) { + $sub = 0; + } else { + $sub = $this->per_page; + } + $param_array['start'] = $this->start - $sub; + $param_array['end'] = $this->end - $sub; + if ($this->categorie != 0) { + $param_array['categorie'] = $this->categorie; + } + $param = http_build_query($param_array); + return $this->url."?$param"; + } + + function get_next_url() + { + $param_array = array(); + if (count($this->products) < $this->per_page) { + $add = 0; + } else { + $add = $this->per_page; + } + $param_array['start'] = $this->start + $add; + $param_array['end'] = $this->end + $add; + if ($this->categorie != 0) { + $param_array['categorie'] = $this->categorie; + } + $param = http_build_query($param_array); + return $this->url."?$param"; + } + + function version_compare($v1, $v2) + { + $v1 = explode('.', $v1); + $v2 = explode('.', $v2); + $ret = 0; + $level = 0; + $count1 = count($v1); + $count2 = count($v2); + $maxcount = max($count1, $count2); + while ($level < $maxcount) { + $operande1 = isset($v1[$level]) ? $v1[$level] : 'x'; + $operande2 = isset($v2[$level]) ? $v2[$level] : 'x'; + $level++; + if (strtoupper($operande1) == 'X' || strtoupper($operande2) == 'X' || $operande1 == '*' || $operande2 == '*') { + break; + } + if ($operande1 < $operande2) { + $ret = -$level; + break; + } + if ($operande1 > $operande2) { + $ret = $level; + break; + } + } + //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
'."\n"; + return $ret; + } +} + +class DolistoreModel +{ + + function get_categories($parent = 0) + { + if (!isset($this->categories)) die('not possible'); + if ($parent != 0) { + $html = '
    '; + } else { + $html = ''; + } + + for ($i = 0; $i < count($this->categories); $i++) { + $cat = $this->categories[$i]; + if ($cat->is_root_category == 1 && $parent == 0) { + $html .= '
  • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'

    '; + $html .= self::get_categories($cat->id); + $html .= "
  • \n"; + } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau + $select = ($cat->id == $this->categorie) ? ' selected' : ''; + $html .= '
  • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.''; + $html .= self::get_categories($cat->id); + $html .= "
  • \n"; + } else { + + } + } + + if ($html == '
      ') { + return ''; + } + if ($parent != 0) { + return $html.'
    '; + } else { + return $html; + } + } + + function get_products() + { + global $langs, $conf; + $html = ""; + $parity = "pair"; + $last_month = time() - (30 * 24 * 60 * 60); + foreach ($this->products as $product) { + $parity = ($parity == "impair") ? 'pair' : 'impair'; + + // check new product ? + $newapp = ''; + if ($last_month < strtotime($product->date_add)) { + $newapp .= ''.$langs->trans('New').' '; + } + + // check updated ? + if ($last_month < strtotime($product->date_upd) && $newapp == '') { + $newapp .= ''.$langs->trans('Updated').' '; + } + + // add image or default ? + if ($product->id_default_image != '') { + $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image; + $images = ''. + ''; + } else { + $images = ''; + } + + // free or pay ? + if ($product->price > 0) { + $price = '

    '.price(round((float) $product->price * $this->vat_rate, 2)).' €

    '; + $download_link = ''; + } else { + $price = $langs->trans('Free'); + $download_link = ''; + } + + //checking versions + if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { + if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { + //compatible + $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = ''; + } else { + //never compatible, module expired + $version = ''.$langs->trans('NotCompatible', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = 'NotCompatible'; + } + } else { + //need update + $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = 'NotCompatible'; + } + + //output template + $html .= ' +
    '.$newapp.$images.'
    +

    '.$product->name->language[$this->lang].'Details' + .'
    '.$version.'

    + '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

    '.$product->description_short->language[$this->lang].' + '.$product->description->language[$this->lang].' + '.$price.' + '.$download_link.' + '; + } + return $html; + } + + function get_previous_link($text = '<<') + { + return "$text"; + } + + function get_next_link($text = '>>') + { + return "$text"; + } +} \ No newline at end of file diff --git a/htdocs/dolistore/class/init.php b/htdocs/dolistore/class/init.php new file mode 100644 index 00000000000..df5773d9e7d --- /dev/null +++ b/htdocs/dolistore/class/init.php @@ -0,0 +1,72 @@ +CRUD Tutorial - Customer's list + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +* PrestaShop Webservice Library +* @package PrestaShopWebservice +*/ +// Here we define constants /!\ You need to replace this parameters +//https://dolistorecatalogpublickey1234567@vmdevwww.dolistore.com/api/ +define('DEBUG', true); // Debug mode +define('PS_SHOP_PATH', 'http://vmdevwww.dolistore.com/'); // Root path of your PrestaShop store +define('PS_WS_AUTH_KEY', 'dolistorecatalogpublickey1234567'); // Auth key (Get it in your Back Office) +require_once('./PSWebServiceLibrary.php'); +// Here we make the WebService Call +try +{ + $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); + + // Here we set the option array for the Webservice : we want customers resources + $opt['resource'] = 'categories'; + $opt['id'] = '1'; + + // Call + $xml = $webService->get($opt); + // Here we get the elements from children of customers markup "customer" + $resources = $xml->categories->children(); +} +catch (PrestaShopWebserviceException $e) +{ + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) echo 'Bad ID'; + else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; + else echo 'Other error'; +} +// We set the Title +echo "

    Categories's List

    "; +echo ''; +// if $resources is set we can lists element in it otherwise do nothing cause there's an error +if (isset($resources)) +{ + echo ''; + foreach ($resources as $resource) + { + // Iterates on the found IDs + echo ''; + } +} +echo '
    Id
    '.$resource->attributes().'
    '; +?> + \ No newline at end of file diff --git a/htdocs/dolistore/core/modules/modDolistore.class.php b/htdocs/dolistore/core/modules/modDolistore.class.php new file mode 100644 index 00000000000..a582b93a038 --- /dev/null +++ b/htdocs/dolistore/core/modules/modDolistore.class.php @@ -0,0 +1,159 @@ +. + * + * 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 3 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, see . + * + * + * Classe de description et activation du module DOLISTORE + */ + + +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; + +class modDolistore extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $conf, $langs; + + $this->db = $db; + $this->numero = 66666; + + + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = /* $langs->trans( */preg_replace('/^mod/i', '', get_class($this))/* ) */; + + $this->boxes = array(); + + + $this->description = $langs->trans("DOLISTOREdescription"); + + $this->descriptionlong = $langs->trans("DOLISTOREdescriptionLong"); + + $this->family = "interface"; + + $this->module_position = 1; + $this->version = 'dolibarr'; + $this->picto = 'dolistore@dolistore'; + $this->special=1; + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Dependances + $this->depends = array(); + $this->requiredby = array(); + $this->langfiles = array('dolistore@dolistore'); + + // Config pages + //$this->config_page_url = array("index.php?page=config@dolistore"); + + + + $this->module_parts = array( + 'triggers' => 0, + // Set this to 1 if module overwrite template dir (core/tpl) + 'tpl' => 0, + ); + + + + + + // Main menu entries + $r = 0; + + $this->menu[$r] = array( + //'fk_menu' => -1, // Put 0 if this is a top menu + 'fk_menu' => 'fk_mainmenu=home,fk_leftmenu=setup', + 'type' => 'left', // This is a left menu entry + 'titre' => 'DOLISTOREMENU', + 'mainmenu' => 'home', + 'leftmenu' => 'setup', + 'url' => '/dolistore/index.php?mainmenu=home&leftmenu=setup', + 'langs' => 'dolistore@dolistore', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position' => 1, + 'enabled' => '$leftmenu=="setup" && $conf->dolistore->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. + //'perms' => '$user->rights->edi->message->view', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms' => '', + 'target' => '', + 'user' => 0); // 0=Menu for internal users, 1=external users, 2=both + + $r++; + + // Constantes + $this->const = array(); + + + $r = 0; + $this->const[$r][0] = 'MAIN_MODULE_'.strtoupper($this->name).'_API_SRV'; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "https://www.dolistore.com"; + $this->const[$r][3] = "Server URL"; + $this->const[$r][4] = 0; + $this->const[$r][5] = 1; // supprime la constante à la désactivation du module + $r++; + + $this->const[$r][0] = 'MAIN_MODULE_'.strtoupper($this->name).'_API_KEY'; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "dolistorecatalogpublickey1234567"; + $this->const[$r][3] = "API key to authenticate"; + $this->const[$r][4] = 0; + $this->const[$r][5] = 1; // supprime la constante à la désactivation du module + $r++; + + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function init($options = '') + { + global $conf; + + $this->remove($options); + + $sql = array(); + + return $this->_init($sql, $options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function remove($options = '') + { + $sql = array(); + + return $this->_remove($sql, $options); + } +} \ No newline at end of file diff --git a/htdocs/dolistore/css/dolistore.css b/htdocs/dolistore/css/dolistore.css new file mode 100644 index 00000000000..18549c3ed83 --- /dev/null +++ b/htdocs/dolistore/css/dolistore.css @@ -0,0 +1,234 @@ + +div.divsearchfield { + float: left; + margin: 4px 12px 4px 2px; + padding-left: 2px; +} + +.margeCoteGauche,.margeCote{ + padding-right: 20px!important; +} +.margeCote,.margeCoteDroite{ + padding-left: 20px!important; +} +.nomargesupinf{ + margin-top: 0; + margin-bottom: 0; +} +#category-tree-left{ + display: none; + vertical-align: top; + width: 24%; +} +#listing-content{ + box-sizing: border-box; + display: inline-block; + width: 100%; +} +.tree{ + margin: 0px 0px 0px 0px; + padding:0px; + list-style: none; line-height: 2em; font-family: Arial; +} +.tree li{ + font-size: 16px; + position: relative;list-style: none; +} +.tree li:before{ + position: absolute; + left: -15px; + top: -4px; + content: ''; + display: block; + border-left: 1px solid #ddd; + height: 1em; + border-bottom: 1px solid #ddd; + width: 10px; +} +.tree li:after{ + position: absolute; + left: -15px; + bottom: -7px; + content: ''; + display: block; + border-left: 1px solid #ddd; + height: 100%; +} + +.tree li.root{ + margin: 0px 0px 0px 0px; +} +.tree li.root:before{ + display: none; +} + +.tree li.root:after{ + display: none; +} +.tree li:last-child:after{ + display: none +} +.blockUI { + cursor: auto!important; +} +.newAppParent{ + position: relative; + overflow: hidden; + min-height: 100px; +} +.newApp, .updatedApp{ + background-color: orange; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.35); + box-sizing: border-box; + color: white; + display: block; + font-size: 18px; + font-weight: bold; + left: -34px; + padding: 5px 0; + position: absolute; + text-align: center; + text-shadow: 0 0 5px rgba(0, 0, 0, 0.35); + top: 22px; + transform: rotate(-45deg); + width: 150px; +} +.updatedApp{ + background-color: greenyellow; +} +.notcompatible { + color: red; +} +.compatibleafterupdate { + color: orange; +} +.compatible { + background-image: url("../img/compatible.png"); + background-position: left center; + background-repeat: no-repeat; + color: green; + display: inline-block; + height: 32px; + line-height: 32px; + padding-left: 35px; +} +tr.app { + height:250px; +} + +div#newsDoli.tabBar { + margin-top: 50px; + margin-right: 30px; +} +.selected { + text-decoration: underline!important; +} +.searchDolistore, .searchDolistore:hover { + padding-left: 30px; + padding-right: 30px; + font-weight: bold; +} +.searchDolistore:hover { + text-decoration: underline!important; +} + +.score{ + font-size: 16px; + font-weight: bold; +} +.formReviewArea{ + display:none; +} +.formReview div.divsearchfield{ + float: none; +} +.input100{ + box-sizing: border-box; + width: 100%; +} +.input50{ + box-sizing: border-box; + width: 49%; +} +textarea.row4{ + min-height: 100px; +} + + +.reviewList { + max-height: 150px; + overflow-y: scroll; +} + +.reviewRow{ + margin-bottom: 20px; +} +.reviewRow .reviewMarge { + float:left; + width: 220px; + padding: 0 20px 20px 0; +} +.reviewRow .score { + font-size: 48px; + display: block; + text-align: center; +} +.reviewRow .reviewDate { + color:grey; +} +.reviewRow:after{ + clear: both; + content:''; + display: block; +} +h2.appTitle small{ + font-weight: normal; +} +tr.NotCompatible{ + /* IE 8 */ + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=25)"; + + /* IE 5-7 */ + filter: alpha(opacity=25); + + /* Netscape */ + -moz-opacity: 0.25; + + /* Safari 1.x */ + -khtml-opacity: 0.25; + + /* Good browsers */ + opacity: 0.25; +} +tr.NotCompatible:hover{ + /* IE 8 */ + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + + /* IE 5-7 */ + filter: alpha(opacity=100); + + /* Netscape */ + -moz-opacity: 1; + + /* Safari 1.x */ + -khtml-opacity: 1; + + /* Good browsers */ + opacity: 1; +} +@media only screen and (min-width: 1150px) { + #categorieArea{ + display:none; + } + #category-tree-left{ + display:inline-block; + } + #listing-content{ + width: 75%; + } +} +span.details{ + font-size: 12px; + margin-left: 10px; + vertical-align: super; +} \ No newline at end of file diff --git a/htdocs/dolistore/img/Download-128.png b/htdocs/dolistore/img/Download-128.png new file mode 100644 index 0000000000000000000000000000000000000000..89756d1f012c1aee0605d4b07cd36c38b04f62e1 GIT binary patch literal 761 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSEX7WqAsj$Z!;#Vf4nJ za0`PlBg3pY5)2GXvproLLn`LHy?d}%*ippwqCH2a3`c8&!g5XyrA7~EiJ9Okl_x<`m4E#~1 zT)~U=>;8XamNBRnQFD*~^Y1acMaDG^pZvn8{SwMfc@NUL7OeH+yucZ9wb5YpoBsD6;#-`r4YJAS+xoy8sb6xB zzPGPyVBNNO!{ryZyFjk#zT=*_{o?kmU;f3H$t4__civ-X|DnG6@Aq~0)>kovZ}{@h z`j7KOE+YmD<_2Rp@w?(sdP$vh$Mg9_C6WCMg02T2th%193QW5Up00i_>zopr06va6 A*#H0l literal 0 HcmV?d00001 diff --git a/htdocs/dolistore/img/NoImageAvailable.png b/htdocs/dolistore/img/NoImageAvailable.png new file mode 100644 index 0000000000000000000000000000000000000000..9a88d4362da95325a581414a98c520e4080cb203 GIT binary patch literal 11231 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 LrhMINi?II#Y zKuKPxKa+~0haf2+A3(ZboE(@qJRa%liorX(xVqx)k&ZaLBNnH6T^;bwL>E`0BLVsG zL8+qgS@Fa$s^7<0s+AWi5rTL`ELJ2EVMIFk zRRt;_VDi~Khz)X)YDGpID1^LFs!abZfy4VG%N2Y)Ce?vq#S9)6kHM)+S_RVS{~yZX zd_oJLFyOCz|EI7ZB8>-N!vFy&pT;t?r)fB}L02oOwOJ;jhj5CR2>AP-3i zcSYJpvbii!B-rr*Pp1o2bFnq0LNI6PHkD!^x_0xUm1$U%N6naEx{7xJ2V zAGxfxbD^xs#j29QsvG-Xjb7bSxko+yWLwqZlkowr%I$oWtrdl+78p!>D1b_e5X;*l zr6Cc!jD5fnfMJwhzt0=R?7e4dWnyf75C2V`um+z6$7lOkEZWj8!8>xlKWbTHuWzU6 z2oyMUX`6_?4>K&;@D@f&I+bl6YJa^%XL&_=ZB*K#_xqI{hR3g$%`2~^_l!JNJV^iD zeaZ;2z4^4+)R(e8m=mpcc{JDP4R4)iIHUBgzHyCiD(x4)J(>d!e$-{OqsIa57&rb< zgP#NK-x7!`Z}ra$HTLJQv&O3zY~UK^C!cKiDPh)9Bwt^f?~3y~Jp!M$S+KEaMV1^i zK`fP2@c)HAa=)x;^JZ;M9<_0?sGk>f;_|liuSUS<)=an$+3i(ht#j&LL@jBVr&(qd zIqlz?Ukn?jAvH5CvTD}#(J`OnG~qvM3!AQnp3&DL$Ie?k+^eB19VAu7?)k+mW7Mhn zyf#6$XW_w(5@wE7HV$_1^<=JW@1a%-oF>Kn@U&AWwJHr3{31|OR`l-ck>Kfp&V#ok zK^~GWnG<^0^qZKlXNASb{qLU3uS4)0;kuo<$}PE#nFHNp+LT-Vt)q|IUq6b91;rj3 zH_>-ly?X5zW2y-TT-eQljh5#KSsEMBKVl~zUe#ArJq)^|oKku&Nr5X@YCAG*$EiI_ z1i2hajLxi}pBRg?mFdOReS5%?WVaP8JL0`<$yE`gO#M&4r`@z%ue4&q$T(eESU@Gd zpS{sj)^Ki)9UVw|{n`-XbA%EtOP4Hp_3 zzfK5D@Ig&IXy+l=nq&{_m~biiviM7#{=M$(i*x?fU8v^qISFTM#YLZ!C$3KPusEs*%jq9mp&`c-Fnw87Q6{{4q$Hn*_XCM z_`??oa_!lS3-qp)dL!#yjwdjWy!5+?gsoAFDKd2y{&Td{f$GP*VsDQ1#D_x zw^7lQeCKTHnc{D4cF*YQSO3ER^~kQnAPpF0h1Z6=L?mL{8hpxAt0Ldzn(-F8?NU5; z1Zo8cPM01q+k@WHr3gpe_|i;R8d<+=Q+?K7z(hCCa*mn1`(GVF=*4#_xCI?&4j&4> z+$o>Ct(hWyVNqtCsR)*lz?_#Cj@HyG(7K+6+dAU12`l?wwq%$cT5sz5-O)P9?zVK= z^PM-7tty8|q=oXs!Hbx};OY}6M~!yetDh~HZu{qUt@cJZdXT{0&NzQ*d{TZZCF-_w zHQ75qTXeAoQ}({hu(jq9BKulit-ZMU3z5S;lT-7DOza|x%f~6+vWNSi5TR}7uKMMw zqWz$_4w4G_TQbo5d}G66E|@2RT8`pwR KLDci)SlJ(Mu5>g2 literal 0 HcmV?d00001 diff --git a/htdocs/dolistore/img/dolistore.png b/htdocs/dolistore/img/dolistore.png new file mode 100644 index 0000000000000000000000000000000000000000..d3fc61e72939cfbac8e625c856768e945a254954 GIT binary patch literal 11317 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 literal 0 HcmV?d00001 diff --git a/htdocs/dolistore/img/follow.png b/htdocs/dolistore/img/follow.png new file mode 100644 index 0000000000000000000000000000000000000000..78383c1157fe4345d5ca4b14377a4542e13c4fa6 GIT binary patch literal 2869 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 Yc>G=Dk4nMX*&kUy?*QgG&uHbp0c}UCaR2}S literal 0 HcmV?d00001 diff --git a/htdocs/dolistore/img/object_dolistore.png b/htdocs/dolistore/img/object_dolistore.png new file mode 100644 index 0000000000000000000000000000000000000000..213d0e0a3b745c3f64b6dee834fa5fd317da233b GIT binary patch literal 1851 zcmaJ?c~BEq99~2YQ4mA~6`eIONR=d;NC=5WBv}Fx!X*mc=2#@aW<#<-5=0@io&f_Y zf<**HZSkOJL=Y;d9LBqXh}4scXlE2l#j94kQPKWUx-+}){oZ`v_dDP0rpWMMd%HNVG{3mXs7Q7o4MJ69OoLi$FD+ELXAB9MVT!HnBG!Q%T@Q2%f|teF`d0 z7zy$)B?2-i5Lp8GL7*RvLYw8wWHNm~Iz)r05S>b+lW9!$EIJ#4z|Rkf@TQc;v!h}D zXJ3THAtm6rf=#8Sr>9fWXHhWaYATJzVwpAQbTWY;t2A<4q$bN%9zzN+qLL_O3S5TC zL9?PrjHTin5)tXA6i~$%S-I+SnTUc>)glFzMuE&J4FQG1|A(UJ7qkkGM!v@TpTepb zjRK)YBPuLaDIppc?_qYOVDprS2*;E$7?wO##mEE<$5aWJ0^}`VfI^W(CO6w3@j@Y6 zAXnicxdaiw91@{Gk;$ZN*pK1Q=Q3bFK9^6U!TdlTi_Z0@@fa`(dz@AUXyZn>ZsNm$FGEg(EVf!yCXZS zE~LHkKYj;|s4|A66qv5uQWf`KD!#~Kx4PX{7t&!(g-&Fo` zQ9^P+W!jVLdat|>d-lBKsx?9RKd)@$C8RiUM{ile%+_qYyaF$w zxb=$oSBLlK(OYS~2hCK6q`08?3;P@UZec)c7O+Nx>XF31$ z{H4d^F??uyEH6sq@>t+^Bha(fuv5jKOXX}b1PXC_r15zHGxZSyW>@Ox*Sn|3^TCRR=Vvixewa@+**OSD}zHXmgujZ5u9}JcDFiwcSOxic*@8^ z;89Qi)PlD+GbYdI_a2l@2-&%+;9Okq+cAGT3|?n%N84og)_>Uc-VOq)lAkVmb~bmw P{5ul_g~La=t91VW#hTZW literal 0 HcmV?d00001 diff --git a/htdocs/dolistore/index.php b/htdocs/dolistore/index.php new file mode 100644 index 00000000000..1295801b436 --- /dev/null +++ b/htdocs/dolistore/index.php @@ -0,0 +1,115 @@ +. + * + * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); + * it under the terms of the GNU General Public License as published bypliance with the License. + * the Free Software Foundation; either version 3 of the License, or + * + * 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, see . + * or see http://www.gnu.org/ + */ + +if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); +/** + * \file htdocs/commande/info.php + * \ingroup commande + * \brief Page des informations d'une commande + */ +$res = 0; +if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); +if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); +if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); +if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); +if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res) die("Include of main fails"); + +// CORE + +global $lang, $user, $conf; + + +dol_include_once('/dolistore/class/dolistore.class.php'); +$options = array(); +$options['per_page'] = 20; +$options['categorie'] = GETPOST('categorie', 'int') + 0; +$options['start'] = GETPOST('start', 'int') + 0; +$options['end'] = GETPOST('end', 'int') + 0; +$options['search'] = GETPOST('search_keyword', 'alpha'); +$dolistore = new Dolistore($options); +/* + * View + */ + +/* * ************************************************* + * VIEW + * + * Put here all code to build page + * ************************************************** */ + +// llxHeader('', iconv(iconv_get_encoding($langs->trans($lbl_folder)), $character_set_client . "//TRANSLIT", $langs->trans($lbl_folder)) . ' (' . $info->Nmsgs . ') ', ''); + +$morejs = array("/dolistore/js/dolistore.js.php", + "/dolistore/js/fancybox/jquery.fancybox.pack.js", + "/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.js"); +$morecss = array("/dolistore/css/dolistore.css", + "/dolistore/js/fancybox/jquery.fancybox.css", + "/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.css"); +llxHeader('', $langs->trans('DOLISTOREMENU'), '', '', '', '', $morejs, $morecss, 0, 0); +?>
    + + +
    + + +
    trans('Extensions disponibles sur le Dolistore') ?>
    +
    + trans('DOLISTOREdescriptionLong') ?>

    + +
    +
    +
      + get_categories(); ?> +
    +
    +
    + + + + + + + + get_products($categorie); ?> + + + + + + +
    get_previous_link() ?> get_next_link() ?> trans('AchatTelechargement') ?>
    get_previous_link() ?> get_next_link() ?> trans('AchatTelechargement') ?>
    +
    +
    +. + * + * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); + * it under the terms of the GNU General Public License as published bypliance with the License. + * the Free Software Foundation; either version 3 of the License, or + * + * 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, see . + * or see http://www.gnu.org/ + */ +$res = 0; +if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); +if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); +if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); +if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); +if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res) die("Include of main fails"); + +global $langs; + +ob_start(); +?> + form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, $nameforformuserfile); +} +else print ' '; + +print ''; +// End Add new file area + + print ''; // End top panel, toolbar @@ -408,7 +428,6 @@ print ''; if ($action == 'delete_section') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); - } // End confirm @@ -628,35 +647,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php'; ?> -
    -use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) -{ - if (empty($section) || $section == -1) - { - ?> - - form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, 'formuserfile'); -} -else print ' '; - - - -// End Add new file area -?> -
    global->MAIN_UPLOAD_DOC)) -{ - // Define relativepath and upload_dir - $relativepath=''; - if ($ecmdir->id) $relativepath=$ecmdir->getRelativePath(); - else $relativepath=$section_dir; - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; - - if (empty($_FILES['userfile']['tmp_name'])) - { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); - } - - if (! $error) - { - if (dol_mkdir($upload_dir) >= 0) - { - $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']); - if (is_numeric($resupload) && $resupload > 0) - { - $result=$ecmdir->changeNbOfFiles('+'); - } - else - { - $langs->load("errors"); - if ($resupload < 0) // Unknown error - { - setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors'); - } - else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus - { - setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors'); - } - else // Known error - { - setEventMessages($langs->trans($resupload), null, 'errors'); - } - } - } - else - { - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToCreateDir",$upload_dir), null, 'errors'); - } - } -} @@ -158,7 +111,6 @@ if ($action == 'add' && $user->rights->ecm->setup) } else { - //TODO: Translate setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors'); $action = "create"; } @@ -207,6 +159,8 @@ if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes') } // Refresh directory view +// This refresh list of dirs, not list of files (for preformance reason). List of files is refresh only if dir was not synchronized. +// To refresh content of dir with cache, just open the dir in edit mode. if ($action == 'refreshmanual') { $ecmdirtmp = new EcmDirectory($db); @@ -352,8 +306,9 @@ if ($action == 'refreshmanual') //print $_SESSION["dol_screenheight"]; $maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466)?($_SESSION["dol_screenheight"]-136):660; // Also into index.php file -$morejs=array(); -if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs=array("/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js"); +//$morejs=array(); +$morejs=array('includes/jquery/plugins/blockUI/jquery.blockUI.js','core/js/blockUI.js'); // Used by ecm/tpl/enabledfiletreeajax.tpl.pgp +if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs[]="/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js"; llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,'',0,0); @@ -399,6 +354,8 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax)) $classviewhide='inline-block'; + + $head = ecm_prepare_dasboard_head(''); dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), 1, ''); @@ -411,11 +368,11 @@ dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans '; +print '
    '; // Toolbar $url=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); -print ''; +print ''; print ''; print ''; @@ -501,7 +458,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti } -// End left banner +// End left panel ?>
    diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php index bbcbb7090a4..3dc5e09bf08 100644 --- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php +++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php @@ -24,6 +24,8 @@ '."\n"; print ''."\n"; } - // jQuery blockUI - if (! empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) || defined('REQUIRE_JQUERY_BLOCKUI')) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - } // Flot if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && ! defined('DISABLE_JQUERY_FLOT')) { From 083cb33a6c5d5c3d75a5d31fcd5eb8057d43b0c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Aug 2017 23:16:20 +0200 Subject: [PATCH 0049/1137] Clean ecm code --- htdocs/core/ajax/ajaxdirpreview.php | 71 +++++++++++++++++------ htdocs/core/ajax/ajaxdirtree.php | 17 ++++-- htdocs/ecm/index.php | 30 +++++----- htdocs/ecm/index_auto.php | 4 +- htdocs/ecm/tpl/enablefiletreeajax.tpl.php | 6 +- htdocs/theme/eldy/style.css.php | 22 +------ htdocs/theme/md/style.css.php | 21 +------ 7 files changed, 88 insertions(+), 83 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 74d9db0ec6d..203bd71e645 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -39,11 +39,11 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; - $action=GETPOST('action','aZ09'); - $file=urldecode(GETPOST('file')); - $section=GETPOST("section"); - $module=GETPOST("module"); - $urlsource=GETPOST("urlsource"); + $action=GETPOST('action','aZ09'); + $file=urldecode(GETPOST('file','alpha')); + $section=GETPOST("section",'alpha'); + $module=GETPOST("module",'alpha'); + $urlsource=GETPOST("urlsource",'alpha'); $search_doc_ref=GETPOST('search_doc_ref','alpha'); $sortfield = GETPOST("sortfield",'alpha'); @@ -56,7 +56,9 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; - $upload_dir = dirname(str_replace("../","/", $conf->ecm->dir_output.'/'.$file)); + $rootdirfordoc = $conf->ecm->dir_output; + + $upload_dir = dirname(str_replace("../", "/", $rootdirfordoc.'/'.$file)); $ecmdir = new EcmDirectory($db); $result=$ecmdir->fetch($section); @@ -68,7 +70,9 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call } else // For no ajax call { - $ecmdir = new EcmDirectory($db); + $rootdirfordoc = $conf->ecm->dir_output; + + $ecmdir = new EcmDirectory($db); $relativepath=''; if ($section > 0) { @@ -80,7 +84,7 @@ else // For no ajax call } } $relativepath=$ecmdir->getRelativePath(); - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + $upload_dir = $rootdirfordoc.'/'.$relativepath; } if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php'; @@ -95,8 +99,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id; //print 'xxx'.$upload_dir; // Security: -// On interdit les remontees de repertoire ainsi que les pipe dans -// les noms de fichiers. +// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers. if (preg_match('/\.\./',$upload_dir) || preg_match('/[<>|]/',$upload_dir)) { dol_syslog("Refused to deliver file ".$upload_dir); @@ -105,6 +108,16 @@ if (preg_match('/\.\./',$upload_dir) || preg_match('/[<>|]/',$upload_dir)) exit; } +// Check permissions +if ($modulepart == 'ecm') +{ + if (! $user->rights->ecm->read) accessforbidden(); +} +if ($modulepart == 'medias') +{ + // Always allowed +} + /* * Action @@ -153,7 +166,7 @@ if ($type == 'directory') $excludefiles = array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview.*\.png)$','^temp$','^payments$','^CVS$','^thumbs$'); $sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC); - // Right area. If module is defined, we are in automatic ecm. + // Right area. If module is defined here, we are in automatic ecm. $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport'); // TODO change for multicompany sharing @@ -197,20 +210,33 @@ if ($type == 'directory') $filter=preg_quote($search_doc_ref, '/'); $filearray=dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting,1); - $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url,1); + $perm=$user->rights->ecm->upload; + + $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$perm,1,$textifempty,$maxlengthname,$url,1); } // Manual list else { - $relativepath=$ecmdir->getRelativePath(); - $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + if ($module == 'medias') + { + $relativepath=GETPOST('file','alpha'); + $upload_dir = $dolibarr_main_data_root.'/medias/'.$relativepath; + } + else + { + $relativepath=$ecmdir->getRelativePath(); + $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + } // If $section defined with value 0 - if ($section === '0' || empty($section)) + if (($section === '0' || empty($section)) && ($module != 'medias')) { $filearray=array(); } - else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview.*\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1); + else + { + $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview.*\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1); + } if ($section) { @@ -222,7 +248,18 @@ if ($type == 'directory') else if ($section === '0') $textifempty='
    '.$langs->trans("DirNotSynchronizedSyncFirst").'

    '; else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); - $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); + if ($module == 'medias') + { + $modulepart='medias'; + $perm=($user->rights->websites->creer || $user->rights->emailing->creer); + } + else + { + $modulepart='ecm'; + $perm=$user->rights->ecm->upload; + } + + $formfile->list_of_documents($filearray,'',$modulepart,$param,1,$relativepath,$perm,1,$textifempty,$maxlengthname,'',$url); } } diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 14b05c75905..c376bee9da3 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -45,13 +45,14 @@ if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/','',$selecteddir); $langs->load("ecm"); -// Define selecteddir (fullpath). +// Define fullpathselecteddir. +$fullpathselecteddir=''; if ($modulepart == 'ecm') $fullpathselecteddir=$conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : ''); +if ($modulepart == 'medias') $fullpathselecteddir=$dolibarr_main_data_root.'/medias/'.($selecteddir != '/' ? $selecteddir : ''); // Security: -// On interdit les remontees de repertoire ainsi que les pipe dans -// les noms de fichiers. +// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers. if (preg_match('/\.\./',$fullpathselecteddir) || preg_match('/[<>|]/',$fullpathselecteddir)) { dol_syslog("Refused to deliver file ".$original_file); @@ -63,9 +64,12 @@ if (preg_match('/\.\./',$fullpathselecteddir) || preg_match('/[<>|]/',$fullpaths // Check permissions if ($modulepart == 'ecm') { - if (! $user->rights->ecm->read) accessforbidden(); + if (! $user->rights->ecm->read) accessforbidden(); +} +if ($modulepart == 'medias') +{ + // Always allowed } - /* @@ -97,7 +101,8 @@ foreach($sqltree as $keycursor => $val) if (file_exists($fullpathselecteddir)) { $files = @scandir($fullpathselecteddir); - if ($files) + + if ($files) { natcasesort($files); if ( count($files) > 2 ) /* The 2 accounts for . and .. */ diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index a7113a1895a..94b1781ab81 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2017 Laurent Destailleur * Copyright (C) 2008-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -61,7 +61,6 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="fullname"; -if ($module == 'invoice_supplier' && $sortfield == "fullname") $sortfield="level1name"; $ecmdir = new EcmDirectory($db); if ($section) @@ -346,16 +345,11 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax)) } -//if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden'; -//else $classviewhide='visible'; -$classviewhide='inline-block'; - - - - -$head = ecm_prepare_dasboard_head(''); -dol_fiche_head($head, 'index', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), 1, ''); - +if ($module != 'medias') +{ + $head = ecm_prepare_dasboard_head(''); + dol_fiche_head($head, 'index', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), -1, ''); +} // Start container of all panels ?> @@ -394,7 +388,7 @@ print '
    '; // To attach new file if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section)) { - if (empty($section) || $section == -1) + if ((empty($section) || $section == -1) && ($module != 'medias')) { ?> "; + $retstring.=""; } // Zone de saisie manuelle de la date @@ -4786,14 +4798,20 @@ class Form // Icone calendrier if (! $disabled) { - //$retstring.=''; + /* Not required. Managed by option buttonImage of jquery + $retstring.=img_object($langs->trans("SelectDate"),'calendarday','id="'.$prefix.'id" class="datecallink"'); + $retstring.="";*/ + } + else + { + $retstring.=''; } - else $retstring.=''; $retstring.=''."\n"; $retstring.=''."\n"; @@ -4801,7 +4819,7 @@ class Form } else { - print "Bad value of MAIN_POPUP_CALENDAR"; + $retstring.="Bad value of MAIN_POPUP_CALENDAR"; } } // Show date with combo selects diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 478d66f2c2a..28b908aa13c 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -46,7 +46,7 @@ else header('Cache-Control: no-cache'); ?> /* - * ================================================================= + * ================================================================= * Purpose: * Pour la saisie des dates par calendrier Input: base "/theme/eldy" dateFieldID * "dateo" Nom du champ format "dd/MM/yyyy" Format issu de Dolibarr de @@ -63,7 +63,7 @@ function showDP(base,dateFieldID,format,codelang) showDP.datefieldID=dateFieldID; // Must be after the close var dateField=getObjectFromID(dateFieldID); - + // get positioning var thetop=getTop(dateField)+dateField.offsetHeight; @@ -86,7 +86,7 @@ function showDP(base,dateFieldID,format,codelang) showDP.box.style.position="absolute"; showDP.box.style.top=thetop + "px"; showDP.box.style.left=theleft + "px"; - + if (dateField.value) // Si il y avait valeur initiale dans champ { selDate=getDateFromFormat(dateField.value,format); @@ -129,7 +129,7 @@ function resetDP(base,dateFieldID,format,codelang) var dateField=getObjectFromID(dateFieldID); dateField.value = formatDate(new Date(), format); dpChangeDay(dateFieldID,format); - + var alreadybox=getObjectFromID("DPCancel"); if (alreadybox) showDP(base,dateFieldID,format,codelang); } @@ -147,25 +147,26 @@ function loadMonth(base,month,year,ymd,codelang) } var req=null; - + req=loadXMLDoc(theURL,null,false); if (req.responseText == '') alert('Failed to get URL '.theURL); // alert(theURL+' - '+req.responseText); // L'url doit avoir la meme racine // que la pages et elements sinon pb de securite. - showDP.box.innerHTML=req.responseText; + showDP.box.innerHTML=req.responseText; } function closeDPBox() { document.body.removeChild(showDP.box); displaySelectBoxes(); - showDP.box=null; - showDP.datefieldID=null; + showDP.box=null; + showDP.datefieldID=null; } function dpChangeDay(dateFieldID,format) { showDP.datefieldID=dateFieldID; + console.log("Call dpChangeDay, we save date into detailed fields."); var thefield=getObjectFromID(showDP.datefieldID); var thefieldday=getObjectFromID(showDP.datefieldID+"day"); @@ -200,7 +201,7 @@ function dpClickDay(year,month,day,format) var thefieldmonth=getObjectFromID(showDP.datefieldID+"month"); var thefieldyear=getObjectFromID(showDP.datefieldID+"year"); - var dt = new Date(year, month-1, day); + var dt = new Date(year, month-1, day); thefield.value=formatDate(dt,format); if(thefield.onchange) thefield.onchange.call(thefield); @@ -238,7 +239,7 @@ function getTop(theitem){ offsetTop += offsetTrail.offsetTop; offsetTrail = offsetTrail.offsetParent; } - if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") + if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") offsetTop += document.body.TopMargin; return offsetTop; } @@ -251,7 +252,7 @@ function getLeft(theitem){ offsetLeft += offsetTrail.offsetLeft; offsetTrail = offsetTrail.offsetParent; } - if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") + if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") offsetLeft += document.body.leftMargin; return offsetLeft; } @@ -260,16 +261,16 @@ function getLeft(theitem){ // Create XMLHttpRequest object and load url // Used by calendar or other ajax processes // Return req built or false if error -function loadXMLDoc(url,readyStateFunction,async) +function loadXMLDoc(url,readyStateFunction,async) { // req must be defined by caller with // var req = false; - + // branch for native XMLHttpRequest object (Mozilla, Safari...) if (window.XMLHttpRequest) { req = new XMLHttpRequest(); - + // if (req.overrideMimeType) { // req.overrideMimeType('text/xml'); // } @@ -286,7 +287,7 @@ function loadXMLDoc(url,readyStateFunction,async) try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} - } + } } // If XMLHttpRequestObject req is ok, call URL @@ -321,9 +322,9 @@ function loadXMLDoc(url,readyStateFunction,async) */ function hideSelectBoxes() { var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); - if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) - { - for(var i = 0; i < document.all.length; i++) + if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) + { + for(var i = 0; i < document.all.length; i++) { if(document.all[i].tagName) if(document.all[i].tagName == "SELECT") @@ -337,9 +338,9 @@ function hideSelectBoxes() { */ function displaySelectBoxes() { var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); - if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) - { - for(var i = 0; i < document.all.length; i++) + if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1) + { + for(var i = 0; i < document.all.length; i++) { if(document.all[i].tagName) if(document.all[i].tagName == "SELECT") @@ -351,7 +352,7 @@ function displaySelectBoxes() { /* - * ================================================================= + * ================================================================= * Function: * formatDate (javascript object Date(), format) Purpose: Returns a date in the * output format specified. The format string can use the following tags: Field | @@ -366,10 +367,10 @@ function displaySelectBoxes() { function formatDate(date,format) { // alert('formatDate date='+date+' format='+format); - + // Force parametres en chaine format=format+""; - + var result=""; var year=date.getYear()+""; if (year.length < 4) { year=""+(year-0+1900); } @@ -402,7 +403,7 @@ function formatDate(date,format) else if (substr == 'mm') { result=result+(minute<0||minute>9?"":"0")+minute; } else if (substr == 'ss') { result=result+(seconde<0||seconde>9?"":"0")+seconde; } else { result=result+substr; } - + i+=substr.length; } @@ -412,22 +413,22 @@ function formatDate(date,format) /* - * ================================================================= + * ================================================================= * Function: * getDateFromFormat(date_string, format_string) Purpose: This function takes a * date string and a format string. It parses the date string with format and it * returns the date as a javascript Date() object. If date does not match - * format, it returns 0. The format string can use the following tags: + * format, it returns 0. The format string can use the following tags: * Field | Tags * -------------+----------------------------------- - * Year | yyyy (4 digits), yy (2 digits) - * Month | MM (2 digits) - * Day of Month | dd (2 digits) - * Hour (1-12) | hh (2 digits) - * Hour (0-23) | HH (2 digits) - * Minute | mm (2 digits) + * Year | yyyy (4 digits), yy (2 digits) + * Month | MM (2 digits) + * Day of Month | dd (2 digits) + * Hour (1-12) | hh (2 digits) + * Hour (0-23) | HH (2 digits) + * Minute | mm (2 digits) * Second | ss (2 digits) - * Author: Laurent Destailleur + * Author: Laurent Destailleur * Licence: GPL * ================================================================== */ @@ -440,7 +441,7 @@ function getDateFromFormat(val,format) format=format+""; if (val == '') return 0; - + var now=new Date(); var year=now.getYear(); if (year.length < 4) { year=""+(year-0+1900); } var month=now.getMonth()+1; @@ -466,37 +467,37 @@ function getDateFromFormat(val,format) } // alert('substr='+substr); - if (substr == "yyyy") year=getIntegerInString(val,d,4,4); - if (substr == "yy") year=""+(getIntegerInString(val,d,2,2)-0+1900); - if (substr == "MM" ||substr == "M") - { - month=getIntegerInString(val,d,1,2); - d -= 2- month.length; - } - if (substr == "dd") - { - day=getIntegerInString(val,d,1,2); - d -= 2- day.length; - } - if (substr == "HH" ||substr == "hh" ) - { - hour=getIntegerInString(val,d,1,2); - d -= 2- hour.length; - } - if (substr == "mm"){ - minute=getIntegerInString(val,d,1,2); - d -= 2- minute.length; - } - if (substr == "ss") - { - seconde=getIntegerInString(val,d,1,2); - d -= 2- seconde.length; - } - + if (substr == "yyyy") year=getIntegerInString(val,d,4,4); + if (substr == "yy") year=""+(getIntegerInString(val,d,2,2)-0+1900); + if (substr == "MM" ||substr == "M") + { + month=getIntegerInString(val,d,1,2); + d -= 2- month.length; + } + if (substr == "dd") + { + day=getIntegerInString(val,d,1,2); + d -= 2- day.length; + } + if (substr == "HH" ||substr == "hh" ) + { + hour=getIntegerInString(val,d,1,2); + d -= 2- hour.length; + } + if (substr == "mm"){ + minute=getIntegerInString(val,d,1,2); + d -= 2- minute.length; + } + if (substr == "ss") + { + seconde=getIntegerInString(val,d,1,2); + d -= 2- seconde.length; + } + i+=substr.length; d+=substr.length; } - + // Check if format param are ok if (year==null||year<1) { return 0; } if (month==null||(month<1)||(month>12)) { return 0; } @@ -504,15 +505,15 @@ function getDateFromFormat(val,format) if (hour==null||(hour<0)||(hour>24)) { return 0; } if (minute==null||(minute<0)||(minute>60)) { return 0; } if (seconde==null||(seconde<0)||(seconde>60)) { return 0; } - + // alert(year+' '+month+' '+day+' '+hour+' '+minute+' '+seconde); return new Date(year,month-1,day,hour,minute,seconde); } /* - * ================================================================= + * ================================================================= * Function: - * stringIsInteger(string) + * stringIsInteger(string) * Purpose: Return true if string is an integer * ================================================================== */ @@ -530,9 +531,9 @@ function stringIsInteger(str) } /* - * ================================================================= + * ================================================================= * Function: - * getIntegerInString(string,pos,minlength,maxlength) + * getIntegerInString(string,pos,minlength,maxlength) * Purpose: Return part of string from position i that is integer * ================================================================== */ @@ -549,10 +550,10 @@ function getIntegerInString(str,i,minlength,maxlength) /* - * ================================================================= + * ================================================================= * Purpose: - * Clean string to have it url encoded - * Input: s + * Clean string to have it url encoded + * Input: s * Author: Laurent Destailleur * Licence: GPL * ================================================================== @@ -566,11 +567,11 @@ function urlencode(s) { /* - * ================================================================= + * ================================================================= * Purpose: * Applique un delai avant execution. Used for autocompletion of companies. - * Input: funct, delay - * Author: Regis Houssin + * Input: funct, delay + * Author: Regis Houssin * Licence: GPL * ================================================================== */ @@ -581,11 +582,11 @@ function urlencode(s) { /* - * ================================================================= + * ================================================================= * Purpose: * Clean values of a "Sortable.serialize". Used by drag and drop. - * Input: expr - * Author: Regis Houssin + * Input: expr + * Author: Regis Houssin * Licence: GPL * ================================================================== */ @@ -599,12 +600,12 @@ function cleanSerialize(expr) { /* - * ================================================================= + * ================================================================= * Purpose: Display a temporary message in input text fields (For showing help message on * input field). * Input: fieldId * Input: message - * Author: Regis Houssin + * Author: Regis Houssin * Licence: GPL * ================================================================== */ @@ -617,11 +618,11 @@ function displayMessage(fieldId,message) { } /* - * ================================================================= + * ================================================================= * Purpose: Hide a temporary message in input text fields (For showing help message on - * input field). - * Input: fiedId - * Input: message + * input field). + * Input: fiedId + * Input: message * Author: Regis Houssin * Licence: GPL * ================================================================== @@ -673,7 +674,7 @@ function setConstant(url, code, input, entity, strict) { $(newvalue).removeClass("butAction"); $(newvalue).addClass("butActionRefused"); } - }); + }); // Show another element } else if (type == "showhide" || type == "show") { $.each(data, function(key, value) { @@ -734,7 +735,7 @@ function delConstant(url, code, input, entity, strict) { $(newvalue).removeClass("butActionRefused"); $(newvalue).addClass("butAction"); } - }); + }); // Hide another element } else if (type == "showhide" || type == "hide") { $.each(data, function(key, value) { @@ -816,13 +817,13 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } } -/* - * ================================================================= +/* + * ================================================================= * This is to allow to transform all select box into ajax autocomplete box - * with just one line: + * with just one line: * $(function() { $( "#idofmylist" ).combobox(); }); - * Do not use it on large combo boxes - * ================================================================= + * Do not use it on large combo boxes + * ================================================================= */ (function( $ ) { $.widget( "ui.combobox", { @@ -933,11 +934,11 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, /** * Function to output a dialog bog for copy/paste - * + * * @param string text Text to put into copy/paste area * @param string text2 Text to put under the copy/paste area */ -function copyToClipboard(text,text2) +function copyToClipboard(text,text2) { text = text.replace(/
    /g,"\n"); var newElem = '

    '+text2; @@ -951,7 +952,7 @@ function copyToClipboard(text,text2) /** * Show a popup HTML page. Use the "window.open" function. - * + * * @param string url Url * @param string title Title of popup * @return boolean False @@ -983,7 +984,7 @@ function document_preview(file, type, title) { var ValidImageTypes = ["image/gif", "image/jpeg", "image/png"]; console.log("document_preview A click was done. file="+file+", type="+type+", title="+title); - + if ($.inArray(type, ValidImageTypes) < 0) { var width='85%'; var object_width='100%'; @@ -1034,13 +1035,13 @@ function document_preview(file, type, title) } /* - * Provide a function to get an URL GET parameter in javascript - * + * Provide a function to get an URL GET parameter in javascript + * * @param string name Name of parameter * @param mixed valueifnotfound Value if not found * @return string Value */ -function getParameterByName(name, valueifnotfound) +function getParameterByName(name, valueifnotfound) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), @@ -1098,7 +1099,7 @@ function getParameterByName(name, valueifnotfound) } })(); -// Another solution, easier, to build a javascript rounding function +// Another solution, easier, to build a javascript rounding function function dolroundjs(number, decimals) { return +(Math.round(number + "e+" + decimals) + "e-" + decimals); } @@ -1146,10 +1147,10 @@ function price2numjs(amount) { amount = amount.replace(dec, '.'); //console.log("amount before="+amount+" rouding="+rounding) var res = Math.round10(amount, - rounding); - // Other solution is + // Other solution is // var res = dolroundjs(amount, rounding) console.log("res="+res) return res; } - + diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c100583dd76..f2f0aba9579 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1318,7 +1318,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs // Add datepicker default options if (! defined('DISABLE_DATE_PICKER')) { - print ''."\n"; + print ''."\n"; } // JS forced by modules (relative url starting with /) From 1fe23e3fec26f6fcbbd512c75e6aa3fda31b6405 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 09:24:26 +0200 Subject: [PATCH 0076/1137] Move french text into english --- .../install/mysql/data/llx_c_payment_term.sql | 29 +++++++++---------- htdocs/langs/en_US/bills.lang | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_payment_term.sql b/htdocs/install/mysql/data/llx_c_payment_term.sql index c7fd08a62d6..852ff9db4cb 100644 --- a/htdocs/install/mysql/data/llx_c_payment_term.sql +++ b/htdocs/install/mysql/data/llx_c_payment_term.sql @@ -23,21 +23,20 @@ -- -- --- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors --- de l'install et tous les sigles '--' sont supprimés. +-- Do not include comments at end of line, this file is parsed during install and string '--' are removed. -- -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (1,'RECEP', 1,1, 'Due Upon Receipt','Due Upon Receipt',0,1); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (2,'30D', 2,1, '30 jours','Réglement à 30 jours',0,30); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (3,'30DENDMONTH', 3,1, '30 jours fin de mois','Réglement à 30 jours fin de mois',1,30); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (4,'60D', 4,1, '60 jours','Réglement à 60 jours',0,60); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (5,'60DENDMONTH', 5,1, '60 jours fin de mois','Réglement à 60 jours fin de mois',1,60); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (6,'PT_ORDER', 6,1, 'A réception de commande','A réception de commande',0,1); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (7,'PT_DELIVERY', 7,1, 'Livraison','Règlement à la livraison',0,1); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (8,'PT_5050', 8,1, '50 et 50','Règlement 50% à la commande, 50% à la livraison',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (1 ,'RECEP', 1,1, 'Due upon receipt','Due upon receipt',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (2 ,'30D', 2,1, '30 days','Due in 30 days',0,30); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (3 ,'30DENDMONTH', 3,1, '30 days end of month','Due in 30 days, end of month',1,30); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (4 ,'60D', 4,1, '60 days','Due in 60 days, end of month',0,60); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (5 ,'60DENDMONTH', 5,1, '60 days end of month','Due in 60 days, end of month',1,60); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (6 ,'PT_ORDER', 6,1, 'Due on order','Due on order',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (7 ,'PT_DELIVERY', 7,1, 'Due on delivery','Due on delivery',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (8 ,'PT_5050', 8,1, '50 and 50','50% on order, 50% on delivery',0,1); --- add additional payment terms often needed in Austria -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (9,'10D', 9,1, '10 jours','Réglement à 10 jours',0,10); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (10,'10DENDMONTH', 10,1, '10 jours fin de mois','Réglement à 10 jours fin de mois',1,10); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (11,'14D', 11,1, '14 jours','Réglement à 14 jours',0,14); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (12,'14DENDMONTH', 12,1, '14 jours fin de mois','Réglement à 14 jours fin de mois',1,14); +-- Add additional payment terms often needed in Austria +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (9 ,'10D', 9,1, '10 days','Due in 10 days',0,10); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (10,'10DENDMONTH', 10,1, '10 days end of month','Due in 10 days, end of month',1,10); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (11,'14D', 11,1, '14 days','Due in 14 days',0,14); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (12,'14DENDMONTH', 12,1, '14 days end of month','Due in 14 days, end of month',1,14); diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 03ddb1f958e..44cb0143a1e 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -229,7 +229,7 @@ SendReminderBillByMail=Send reminder by email RelatedCommercialProposals=Related commercial proposals RelatedRecurringCustomerInvoices=Related recurring customer invoices MenuToValid=To valid -DateMaxPayment=Payment due before +DateMaxPayment=Payment due on DateInvoice=Invoice date DatePointOfTax=Point of tax NoInvoice=No invoice From e86d3d7905fd55be10c9cdc1e493cf628408e334 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 22 Aug 2017 09:47:33 +0200 Subject: [PATCH 0077/1137] Fix: Travis error "Missing parameter name" --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 42324ec2e3b..3fe6d5887f4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -288,8 +288,8 @@ function dol_dir_list_in_database($path, $filter="", $excludefilter=null, $sortc * Complete $filearray with data from database. * This will call doldir_list_indatabase to complate filearray. * - * @param $filearray Array of files get using dol_dir_list - * @param $relativedir Relative dir from DOL_DATA_ROOT + * @param array $filearray Array of files get using dol_dir_list + * @param string $relativedir Relative dir from DOL_DATA_ROOT * @return void */ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) From 9be342bd2532c8f6f5ff34fb2c5ab096d05cb227 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 10:02:45 +0200 Subject: [PATCH 0078/1137] Fix missing $form --- htdocs/accountancy/admin/fiscalyear_card.php | 4 ++-- htdocs/compta/facture/info.php | 2 ++ htdocs/compta/sociales/info.php | 2 ++ htdocs/contrat/info.php | 6 ++++-- htdocs/fichinter/info.php | 2 ++ htdocs/fourn/facture/info.php | 2 ++ htdocs/loan/info.php | 2 ++ htdocs/supplier_proposal/info.php | 12 +++++++----- 8 files changed, 23 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index fa817942a54..420246411c8 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -145,12 +145,12 @@ else if ($action == 'update') { * View */ +$form = new Form($db); + $title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card"); $helpurl = ""; llxHeader("",$title,$helpurl); -$form = new Form($db); - if ($action == 'create') { print load_fiche_titre($langs->trans("NewFiscalYear")); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 56f89a83154..fd43cc42982 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -39,6 +39,8 @@ $ref=GETPOST("ref",'alpha'); * View */ +$form = new Form($db); + $title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info'); $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; llxHeader('', $title, $helpurl); diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 91334134a2c..b67c844a7b9 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -60,6 +60,8 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) * View */ +$form = new Form($db); + if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $title = $langs->trans("SocialContribution") . ' - ' . $langs->trans("Info"); diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php index 35cca237b21..95ab0b9ca25 100644 --- a/htdocs/contrat/info.php +++ b/htdocs/contrat/info.php @@ -39,8 +39,10 @@ $result = restrictedArea($user, 'contrat', $id, ''); /* -* View -*/ + * View + */ + +$form = new Form($db); llxHeader('',$langs->trans("Contract"),""); diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index 87533644893..a32cda9bb57 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -52,6 +52,8 @@ if (! $object->fetch($id, $ref) > 0) * View */ +$form = new Form($db); + llxHeader('',$langs->trans("Intervention")); $object->fetch_thirdparty(); diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index f5ab9164042..73d6b94a0d6 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -46,6 +46,8 @@ $object = new FactureFournisseur($db); * View */ +$form = new Form($db); + $title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Info'); $helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; llxHeader('', $title, $helpurl); diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index 96da6182da6..64987afa8b5 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -43,6 +43,8 @@ $result = restrictedArea($user, 'loan', $id, '',''); * View */ +$form = new Form($db); + $title = $langs->trans("Loan") . ' - ' . $langs->trans("Info"); $help_url = 'EN:Module_Loan|FR:Module_Emprunt'; llxHeader("",$title,$help_url); diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 718b79ce4ae..8cee304e3bb 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -43,6 +43,8 @@ $result = restrictedArea($user, 'supplier_proposal', $id); * View */ +$form = new Form($db); + llxHeader('',$langs->trans('CommRequest'),'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'); $object = new SupplierProposal($db); @@ -57,8 +59,8 @@ dol_fiche_head($head, 'info', $langs->trans('CommRequest'), -1, 'supplier_propos // Supplier proposal card $linkback = '' . $langs->trans("BackToList") . ''; - - + + $morehtmlref='
    '; // Ref supplier //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); @@ -99,11 +101,11 @@ if (! empty($conf->projet->enabled)) } } $morehtmlref.='
    '; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + print '
    '; print '
    '; From 7c3640a4c344e06e4a6210605a5660f4db7dbf1d Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 19 Aug 2017 13:26:50 +0200 Subject: [PATCH 0079/1137] Bad ojbject for extrafields https://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/59536-extrafields-commande-dans-expedition --- htdocs/expedition/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6c93166c063..f15c091263e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -765,7 +765,7 @@ if ($action == 'create') print "".$langs->trans("DeliveryMethod").""; print ''; $expe->fetch_delivery_methods(); - print $form->selectarray("shipping_method_id",$expe->meths,GETPOST('shipping_method_id','int'),1,0,0,"",1); + print $form->selectarray("shipping_method_id", $expe->meths, GETPOST('shipping_method_id','int'),1,0,0,"",1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print "\n"; @@ -777,11 +777,11 @@ if ($action == 'create') // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print $expe->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'edit'); } From 749355abc2b96ac4d19c86c2c8be688cd5adfc50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 10:41:30 +0200 Subject: [PATCH 0080/1137] Update cron_run_jobs.php --- scripts/cron/cron_run_jobs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 5c32272bed1..a0d4cb7caee 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -55,9 +55,9 @@ $key=$argv[1]; if (! isset($argv[2]) || ! $argv[2]) { usage($path,$script_file); exit(-1); -} else { - $userlogin=$argv[2]; -} +} + +$userlogin=$argv[2]; // Global variables From d2955cb32f489f037c166fd3cf9a96ff82ae0ebd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 22 Aug 2017 08:31:23 +0200 Subject: [PATCH 0081/1137] Fix: virtualmin script update --- build/perl/virtualmin/README | 8 +++--- build/perl/virtualmin/dolibarr.pl | 45 +++++++++++++++++-------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/build/perl/virtualmin/README b/build/perl/virtualmin/README index 22db444a31f..6da04e5f0b8 100644 --- a/build/perl/virtualmin/README +++ b/build/perl/virtualmin/README @@ -1,8 +1,10 @@ README (English) ################################################## -Install script for Virtualmin Pro +Install script for Virtualmin Professional / GPL ################################################## -This script will install automatically Dolibarr from Virtualmin Pro -http://www.virtualmin.com +This script will install automatically Dolibarr from Virtualmin. +(Included in the professional version and can be added in the GPL version) + +https://www.virtualmin.com http://www.webmin.com/virtualmin.html \ No newline at end of file diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 32324d28e42..93439303833 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -1,7 +1,7 @@ #---------------------------------------------------------------------------- # \file dolibarr.pl # \brief Dolibarr script install for Virtualmin Pro -# \author (c)2009-2015 Regis Houssin +# \author (c)2009-2017 Regis Houssin #---------------------------------------------------------------------------- @@ -30,7 +30,12 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.8.1", "3.7.1", "3.6.4", "3.5.7" ); +return ( "5.0.4", "4.0.6", "3.9.4" ); +} + +sub script_dolibarr_release +{ +return 2; # for mysqli fix } sub script_dolibarr_category @@ -163,7 +168,7 @@ return ("tar", "gunzip"); } # script_dolibarr_install(&domain, version, &opts, &files, &upgrade-info) -# Actually installs dolibarr, and returns either 1 and an informational +# Actually installs joomla, and returns either 1 and an informational # message, or 0 and an error sub script_dolibarr_install { @@ -177,9 +182,9 @@ if ($opts->{'newdb'} && !$upgrade) { local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2); local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d); local $dbpass = $dbtype eq "mysql" ? &mysql_pass($d) : &postgres_pass($d, 1); -local $dbphptype = $dbtype eq "mysql" && $version >= 3.6 ? "mysql" : +local $dbphptype = $dbtype eq "mysql" && $version < 3.6 ? "mysql" : $dbtype eq "mysql" ? "mysqli" : "pgsql"; -local $dbhost = &get_database_host($dbtype); +local $dbhost = &get_database_host($dbtype, $d); local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass); return (0, "Database connection failed : $dberr") if ($dberr); @@ -206,9 +211,6 @@ $pgcharset = $tmpl->{'postgres_encoding'}; $charset = $dbtype eq "mysql" ? $mycharset : $pgcharset; $collate = $dbtype eq "mysql" ? $mycollate : "C"; -# Install filename -local $step = $version >= 3.8 ? "step" : "etape"; - $path = &script_path_url($d, $opts); if ($path =~ /^https:/ || $d->{'ssl'}) { $url = "https://$d->{'dom'}"; @@ -222,15 +224,11 @@ if ($opts->{'path'} =~ /\w/) { if (!$upgrade) { local $cdef = "$opts->{'dir'}/conf/conf.php.example"; - &run_as_domain_user($d, "cp ".quotemeta($cdef)." ".quotemeta($cfile)); + ©_source_dest_as_domain_user($d, $cdef, $cfile); &set_permissions_as_domain_user($d, 0777, $cfiledir); - &set_permissions_as_domain_user($d, 0666, $cfile); + ©_source_dest_as_domain_user($d, $cfile); &run_as_domain_user($d, "mkdir ".quotemeta($docdir)); &set_permissions_as_domain_user($d, 0777, $docdir); - if (!$version >= 3.7.2) { - &run_as_domain_user($d, "mkdir ".quotemeta($altdir)); - &set_permissions_as_domain_user($d, 0777, $altdir); - } } else { # Preserve old config file, documents and custom directory @@ -266,7 +264,8 @@ if ($upgrade) { [ "versionfrom", $upgrade->{'version'} ], [ "versionto", $ver ], ); - local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); + local $p = $ver >= 3.8 ? "step5" : "etape5"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Remove the installation directory. @@ -289,15 +288,17 @@ else { [ "main_force_https", $opts->{'forcehttps'} ], [ "dolibarr_main_db_character_set", $charset ], [ "dolibarr_main_db_collation", $collate ], - [ "main_use_alt_dir", "1" ], + [ "usealternaterootdir", "1" ], [ "main_alt_dir_name", "custom" ], ); - local $err = &call_dolibarr_wizard_page(\@params, $step."1", $d, $opts); + local $p = $ver >= 3.8 ? "step1" : "etape1"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Second page (Populate database) local @params = ( [ "action", "set" ] ); - local $err = &call_dolibarr_wizard_page(\@params, $step."2", $d, $opts); + local $p = $ver >= 3.8 ? "step2" : "etape2"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Third page (Add administrator account) @@ -306,7 +307,8 @@ else { [ "pass", $dompass ], [ "pass_verif", $dompass ], ); - local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); + local $p = $ver >= 3.8 ? "step5" : "etape5"; + local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts); return (-1, "Dolibarr wizard failed : $err") if ($err); # Remove the installation directory and protect config file. @@ -384,7 +386,10 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", - $ver >= 3.8 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : + $ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 4.0 ? "dolibarr\\-(4\\.0\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.9 ? "dolibarr\\-(3\\.9\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.8 ? "dolibarr\\-(3\\.8\\.[0-9\\.]+)\\.tgz" : $ver >= 3.7 ? "dolibarr\\-(3\\.7\\.[0-9\\.]+)\\.tgz" : $ver >= 3.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" : $ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" : From a17e4434beec2099f786ba668ba1d00a9e041f16 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 22 Aug 2017 08:35:16 +0200 Subject: [PATCH 0082/1137] Fix: wrong app name --- build/perl/virtualmin/dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 93439303833..08d02e8b2b8 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -168,7 +168,7 @@ return ("tar", "gunzip"); } # script_dolibarr_install(&domain, version, &opts, &files, &upgrade-info) -# Actually installs joomla, and returns either 1 and an informational +# Actually installs dolibarr, and returns either 1 and an informational # message, or 0 and an error sub script_dolibarr_install { From 7d57cd691356abe2777868305f58437d2eca825d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 11:38:32 +0200 Subject: [PATCH 0083/1137] Update productcustomerprice.class.php --- htdocs/product/class/productcustomerprice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 9c2ce3e99d2..89497b68315 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -672,7 +672,7 @@ class Productcustomerprice extends CommonObject // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CUSTOMER_PRODUCT_SELLPRICE_CREATE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('PRODUCT_CUSTOMER_PRICE_UPDATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // End call triggers } From 927da89c8975f75d1f4e6ea4b692fb94ec3e3fcb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 11:52:34 +0200 Subject: [PATCH 0084/1137] Revert bad change --- htdocs/install/mysql/tables/llx_product_customer_price_log.sql | 3 ++- htdocs/install/mysql/tables/llx_product_price.sql | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product_customer_price_log.sql b/htdocs/install/mysql/tables/llx_product_customer_price_log.sql index 3844b3e332f..deec2ac78b5 100644 --- a/htdocs/install/mysql/tables/llx_product_customer_price_log.sql +++ b/htdocs/install/mysql/tables/llx_product_customer_price_log.sql @@ -18,6 +18,8 @@ -- -- ============================================================================ +-- To log changes of prices per customer (llx_product_customer_price) + create table llx_product_customer_price_log ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -25,7 +27,6 @@ create table llx_product_customer_price_log datec datetime, fk_product integer NOT NULL, fk_soc integer DEFAULT 0 NOT NULL, - price_level smallint NULL DEFAULT 1, price double(24,8) DEFAULT 0, price_ttc double(24,8) DEFAULT 0, price_min double(24,8) DEFAULT 0, diff --git a/htdocs/install/mysql/tables/llx_product_price.sql b/htdocs/install/mysql/tables/llx_product_price.sql index a7f9ba38751..4e5920e1dff 100755 --- a/htdocs/install/mysql/tables/llx_product_price.sql +++ b/htdocs/install/mysql/tables/llx_product_price.sql @@ -18,6 +18,9 @@ -- -- ============================================================================ +-- To save customer prices (one price per product or several prices per segment/level) +-- TODO We should introduce table llx_product_price_log to store changes and keep in this table only last current price ! + create table llx_product_price ( rowid integer AUTO_INCREMENT PRIMARY KEY, From 5cf684f5a23f5c02bb791c56e4626073e88a567c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 13:14:10 +0200 Subject: [PATCH 0085/1137] NEW Popup for preview of image add a button "Original size" --- htdocs/core/js/lib_head.js.php | 33 ++++++++++++++++++++++++++++----- htdocs/langs/en_US/main.lang | 1 + htdocs/theme/eldy/style.css.php | 13 +++++++++++++ 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 28b908aa13c..c58cd3eba9e 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -983,6 +983,8 @@ function newpopup(url,title) { function document_preview(file, type, title) { var ValidImageTypes = ["image/gif", "image/jpeg", "image/png"]; + var showOriginalSizeButton = false; + console.log("document_preview A click was done. file="+file+", type="+type+", title="+title); if ($.inArray(type, ValidImageTypes) < 0) { @@ -991,7 +993,7 @@ function document_preview(file, type, title) var height = $( window ).height()*0.90; var object_height='98%'; - show_preview(); + show_preview('notimage'); } else { var object_width=0; @@ -1005,23 +1007,38 @@ function document_preview(file, type, title) width = $( window ).width()*0.90; if(object_width < width){ + console.log("Object width is small, we set width of popup according to image width."); width = object_width + 30 } height = $( window ).height()*0.85; if(object_height < height){ + console.log("Object height is small, we set height of popup according to image height."); height = object_height + 80 } + else + { + showOriginalSizeButton = true; + } - show_preview(); + show_preview('image'); }; img.src = file; } - function show_preview(){ - /* console.log("file="+file+" type="+type+" width="+width+" height="+height); */ + function show_preview(mode) { + console.log("mode="+mode+" file="+file+" type="+type+" width="+width+" height="+height); var newElem = ''; + optionsbuttons = {} + if (mode == 'image' && showOriginalSizeButton) + { + optionsbuttons = { + "trans("OriginalSize")); ?>": function() { console.log("Click on original size"); jQuery(".ui-dialog-content.ui-widget-content > object").css({ "max-height": "none" }); }, + "trans("Close")); ?>": function() { $( this ).dialog( "close" ); } + }; + } + $("#dialogforpopup").html(newElem); $("#dialogforpopup").dialog({ closeOnEscape: true, @@ -1029,8 +1046,14 @@ function document_preview(file, type, title) width: width, height: height, modal: true, - title: title + title: title, + buttons: optionsbuttons }); + + if (showOriginalSizeButton) + { + jQuery(".ui-dialog-content.ui-widget-content > object").css({ "max-height": "100%", "width": "auto", "margin-left": "auto", "margin-right": "auto", "display": "block" }); + } } } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 9d5040afd53..d59a6276d05 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -460,6 +460,7 @@ Discount=Discount Unknown=Unknown General=General Size=Size +OriginalSize=Original size Received=Received Paid=Paid Topic=Subject diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 07d73b86758..a4e0a2f6a66 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3148,6 +3148,19 @@ div.titre { font-size: px !important; } + +/* ============================================================================== */ +/* For content of image preview */ +/* ============================================================================== */ + +/* +.ui-dialog-content.ui-widget-content > object { + max-height: none; + width: auto; margin-left: auto; margin-right: auto; display: block; +} +*/ + + /* ============================================================================== */ /* Formulaire confirmation (When HTML is used) */ /* ============================================================================== */ From d9450477944a798a4dd6f8fa000f3ffca9896ab7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 13:15:56 +0200 Subject: [PATCH 0086/1137] Remove log --- htdocs/core/js/lib_head.js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index c58cd3eba9e..55055792510 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1027,7 +1027,7 @@ function document_preview(file, type, title) } function show_preview(mode) { - console.log("mode="+mode+" file="+file+" type="+type+" width="+width+" height="+height); + /* console.log("mode="+mode+" file="+file+" type="+type+" width="+width+" height="+height); */ var newElem = ''; optionsbuttons = {} From 14cd1507625de148d9b125743281f7c8fdfab3d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 14:47:01 +0200 Subject: [PATCH 0087/1137] NEW Introduce experimental feature to search dolistore from application --- htdocs/{ => admin}/dolistore/ajax/image.php | 132 +- .../class/PSWebServiceLibrary.class.php | 18 +- .../dolistore/class/dolistore.class.php | 624 ++--- htdocs/{ => admin}/dolistore/class/init.php | 0 .../{ => admin}/dolistore/css/dolistore.css | 0 .../dolistore/img/Download-128.png | Bin .../dolistore/img/NoImageAvailable.png | Bin .../{ => admin}/dolistore/img/compatible.png | Bin .../{ => admin}/dolistore/img/dolistore.png | Bin htdocs/{ => admin}/dolistore/img/follow.png | Bin .../dolistore/img/object_dolistore.png | Bin htdocs/admin/modules.php | 123 +- htdocs/core/class/conf.class.php | 3 + htdocs/core/lib/admin.lib.php | 39 +- .../core/modules/modDolistore.class.php | 159 -- htdocs/dolistore/index.php | 115 - htdocs/dolistore/js/dolistore.js.php | 79 - htdocs/dolistore/js/fancybox/blank.gif | Bin 43 -> 0 bytes .../js/fancybox/fancybox_loading.gif | Bin 6567 -> 0 bytes .../js/fancybox/fancybox_loading@2x.gif | Bin 13984 -> 0 bytes .../js/fancybox/fancybox_overlay.png | Bin 1003 -> 0 bytes .../dolistore/js/fancybox/fancybox_sprite.png | Bin 1362 -> 0 bytes .../js/fancybox/fancybox_sprite@2x.png | Bin 6553 -> 0 bytes .../js/fancybox/helpers/fancybox_buttons.png | Bin 1080 -> 0 bytes .../helpers/jquery.fancybox-buttons.css | 97 - .../helpers/jquery.fancybox-buttons.js | 122 - .../fancybox/helpers/jquery.fancybox-media.js | 201 -- .../helpers/jquery.fancybox-thumbs.css | 55 - .../helpers/jquery.fancybox-thumbs.js | 165 -- .../dolistore/js/fancybox/jquery.fancybox.css | 275 --- .../dolistore/js/fancybox/jquery.fancybox.js | 2018 ----------------- .../js/fancybox/jquery.fancybox.pack.js | 46 - htdocs/dolistore/langs/de_DE/dolistore.lang | 22 - htdocs/dolistore/langs/en_EN/dolistore.lang | 22 - htdocs/dolistore/langs/es_ES/dolistore.lang | 22 - htdocs/dolistore/langs/fr_FR/dolistore.lang | 22 - htdocs/dolistore/langs/it_IT/dolistore.lang | 22 - htdocs/langs/en_US/admin.lang | 18 +- 38 files changed, 544 insertions(+), 3855 deletions(-) rename htdocs/{ => admin}/dolistore/ajax/image.php (94%) rename htdocs/{ => admin}/dolistore/class/PSWebServiceLibrary.class.php (96%) rename htdocs/{ => admin}/dolistore/class/dolistore.class.php (95%) rename htdocs/{ => admin}/dolistore/class/init.php (100%) rename htdocs/{ => admin}/dolistore/css/dolistore.css (100%) rename htdocs/{ => admin}/dolistore/img/Download-128.png (100%) rename htdocs/{ => admin}/dolistore/img/NoImageAvailable.png (100%) rename htdocs/{ => admin}/dolistore/img/compatible.png (100%) rename htdocs/{ => admin}/dolistore/img/dolistore.png (100%) rename htdocs/{ => admin}/dolistore/img/follow.png (100%) rename htdocs/{ => admin}/dolistore/img/object_dolistore.png (100%) delete mode 100644 htdocs/dolistore/core/modules/modDolistore.class.php delete mode 100644 htdocs/dolistore/index.php delete mode 100644 htdocs/dolistore/js/dolistore.js.php delete mode 100644 htdocs/dolistore/js/fancybox/blank.gif delete mode 100644 htdocs/dolistore/js/fancybox/fancybox_loading.gif delete mode 100644 htdocs/dolistore/js/fancybox/fancybox_loading@2x.gif delete mode 100644 htdocs/dolistore/js/fancybox/fancybox_overlay.png delete mode 100644 htdocs/dolistore/js/fancybox/fancybox_sprite.png delete mode 100644 htdocs/dolistore/js/fancybox/fancybox_sprite@2x.png delete mode 100644 htdocs/dolistore/js/fancybox/helpers/fancybox_buttons.png delete mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-buttons.css delete mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-buttons.js delete mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-media.js delete mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.css delete mode 100644 htdocs/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.js delete mode 100644 htdocs/dolistore/js/fancybox/jquery.fancybox.css delete mode 100644 htdocs/dolistore/js/fancybox/jquery.fancybox.js delete mode 100644 htdocs/dolistore/js/fancybox/jquery.fancybox.pack.js delete mode 100644 htdocs/dolistore/langs/de_DE/dolistore.lang delete mode 100644 htdocs/dolistore/langs/en_EN/dolistore.lang delete mode 100644 htdocs/dolistore/langs/es_ES/dolistore.lang delete mode 100644 htdocs/dolistore/langs/fr_FR/dolistore.lang delete mode 100644 htdocs/dolistore/langs/it_IT/dolistore.lang diff --git a/htdocs/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php similarity index 94% rename from htdocs/dolistore/ajax/image.php rename to htdocs/admin/dolistore/ajax/image.php index 5bc6c9f2f0f..10ce4656c40 100644 --- a/htdocs/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -1,65 +1,67 @@ -. - * - * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); - * it under the terms of the GNU General Public License as published bypliance with the License. - * the Free Software Foundation; either version 3 of the License, or - * - * 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, see . - * or see http://www.gnu.org/ - */ - -if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); -/** - * \file htdocs/commande/info.php - * \ingroup commande - * \brief Page des informations d'une commande - */ -$res = 0; -if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); -if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); -if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); -if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); -if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res) die("Include of main fails"); - -// CORE - -global $lang, $user, $conf; - - -dol_include_once('/dolistore/class/dolistore.class.php'); -$dolistore = new Dolistore(); - -$id_product = GETPOST('id_product', 'int'); -$id_image = GETPOST('id_image', 'int'); -// quality : image resize with this in the URL : "cart_default", "home_default", "large_default", "medium_default", "small_default", "thickbox_default" -$quality = GETPOST('quality', 'alpha'); - -try { - $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; - $api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api); - //echo $url; - $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); - header('Content-type:image'); - print $request['response']; -} catch (PrestaShopWebserviceException $e) { - // Here we are dealing with errors - $trace = $e->getTrace(); - if ($trace[0]['args'][0] == 404) die('Bad ID'); - else if ($trace[0]['args'][0] == 401) die('Bad auth key'); - else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); -} \ No newline at end of file +. + * Copyright (C) 2008-2011 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); + * it under the terms of the GNU General Public License as published bypliance with the License. + * the Free Software Foundation; either version 3 of the License, or + * + * 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, see . + * or see http://www.gnu.org/ + */ + +if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); + + +/** + * \file htdocs/commande/info.php + * \ingroup commande + * \brief Page des informations d'une commande + */ +$res = 0; +if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); +if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); +if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); +if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); +if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) + $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only +if (!$res) die("Include of main fails"); + +// CORE + +global $lang, $user, $conf; + + +dol_include_once('/dolistore/class/dolistore.class.php'); +$dolistore = new Dolistore(); + +$id_product = GETPOST('id_product', 'int'); +$id_image = GETPOST('id_image', 'int'); +// quality : image resize with this in the URL : "cart_default", "home_default", "large_default", "medium_default", "small_default", "thickbox_default" +$quality = GETPOST('quality', 'alpha'); + +try { + $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; + $api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api); + //echo $url; + $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); + header('Content-type:image'); + print $request['response']; +} catch (PrestaShopWebserviceException $e) { + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + else if ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); +} \ No newline at end of file diff --git a/htdocs/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php similarity index 96% rename from htdocs/dolistore/class/PSWebServiceLibrary.class.php rename to htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 8f55f6fd323..bb59fa93929 100644 --- a/htdocs/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -45,8 +45,8 @@ class PrestaShopWebservice protected $version; /** @var array compatible versions of PrestaShop Webservice */ - const psCompatibleVersionsMin = '1.4.0.0'; - const psCompatibleVersionsMax = '1.6.99.99'; + const PSCOMPATIBLEVERSIONMIN = '1.4.0.0'; + const PSCOMPATIBLEVERSIONMAX = '1.6.99.99'; /** * PrestaShopWebservice constructor. Throw an exception when CURL is not installed/activated @@ -152,8 +152,8 @@ class PrestaShopWebservice { $this->version = $headerArray['PSWS-Version']; if ( - version_compare(PrestaShopWebservice::psCompatibleVersionsMin, $headerArray['PSWS-Version']) == 1 || - version_compare(PrestaShopWebservice::psCompatibleVersionsMax, $headerArray['PSWS-Version']) == -1 + version_compare(PrestaShopWebservice::PSCOMPATIBLEVERSIONMIN, $headerArray['PSWS-Version']) == 1 || + version_compare(PrestaShopWebservice::PSCOMPATIBLEVERSIONMAX, $headerArray['PSWS-Version']) == -1 ) throw new PrestaShopWebserviceException('This library is not compatible with this version of PrestaShop. Please upgrade/downgrade this library'); } @@ -218,8 +218,9 @@ class PrestaShopWebservice * 'resource' => Resource name
    * 'postXml' => Full XML string to add resource

    * Examples are given in the tutorial

    - * @param array $options - * @return SimpleXMLElement status_code, response + * + * @param array $options Options + * @return SimpleXMLElement status_code, response */ public function add($options) { @@ -406,4 +407,7 @@ class PrestaShopWebservice /** * @package PrestaShopWebservice */ -class PrestaShopWebserviceException extends Exception { } \ No newline at end of file +class PrestaShopWebserviceException extends Exception +{ + +} diff --git a/htdocs/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php similarity index 95% rename from htdocs/dolistore/class/dolistore.class.php rename to htdocs/admin/dolistore/class/dolistore.class.php index 35900d66f7d..3b3abadd3e4 100644 --- a/htdocs/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -1,308 +1,316 @@ -. - * - * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); - * it under the terms of the GNU General Public License as published bypliance with the License. - * the Free Software Foundation; either version 3 of the License, or - * - * 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, see . - * or see http://www.gnu.org/ - */ -dol_include_once('/core/lib/admin.lib.php'); -dol_include_once('/dolistore/class/PSWebServiceLibrary.class.php'); - -class Dolistore extends DolistoreModel -{ - // params - public $start // beginning of pagination - , $end // end of pagination - , $per_page // pagination: display per page - , $categorie // the current categorie - , $search // the search keywords - // setups - , $url // the url of this page - , $shop_url // the url of the shop - , $vat_rate // the vat rate used in the shop (prices are provided without vat) - , $lang // the integer representing the lang in the store - , $debug_api; // usefull if no dialog - - function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) - { - global $conf, $langs; - - $this->start = $options['start']; - $this->end = $options['end']; - $this->per_page = $options['per_page']; - $this->categorie = $options['categorie']; - $this->search = $options['search']; - - $this->url = dol_buildpath('/dolistore/index.php', 2); - $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; - $this->vat_rate = 1.2; // 20% de TVA - $this->debug_api = false; - - if ($this->end == 0) { - $this->end = $this->per_page; - } - - $lang = explode('_', $langs->defaultlang); - $lang = $lang[0]; - $lang_array = ['fr', 'en', 'es', 'it', 'de']; - if (!in_array($lang, $lang_array)) { - $lang = 'en'; - } - $this->lang = array_search($lang, $lang_array) + 1; // 1=fr 2=en ... - - try { - $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); - - // Here we set the option array for the Webservice : we want products resources - $opt = array(); - $opt['resource'] = 'products'; - // make a search to limit the id returned. - if ($this->search != '') { - $opt2 = array(); - $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; - // Call - $xml = $this->api->get($opt2); - $products = array(); - foreach ($xml->products->children() as $product) { - $products[] = (int) $product['id']; - } - $opt['filter[id]'] = '['.implode('|', $products).']'; - } elseif ($this->categorie != 0) { - $opt2 = array(); - $opt2['resource'] = 'categories'; - $opt2['id'] = $this->categorie; - // Call - $xml = $this->api->get($opt2); - $products = array(); - foreach ($xml->category->associations->products->children() as $product) { - $products[] = (int) $product->id; - } - $opt['filter[id]'] = '['.implode('|', $products).']'; - } - $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; - $opt['sort'] = 'id_desc'; - $opt['filter[active]'] = '[1]'; - $opt['limit'] = "$this->start,$this->end"; - // Call - $xml = $this->api->get($opt); - $this->products = $xml->products->children(); - - - // Here we set the option array for the Webservice : we want categories resources - $opt = array(); - $opt['resource'] = 'categories'; - $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; - $opt['sort'] = 'id_asc'; - // Call - $xml = $this->api->get($opt); - $this->categories = $xml->categories->children(); - } catch (PrestaShopWebserviceException $e) { - // Here we are dealing with errors - $trace = $e->getTrace(); - if ($trace[0]['args'][0] == 404) die('Bad ID'); - else if ($trace[0]['args'][0] == 401) die('Bad auth key'); - else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); - } - } - - function get_previous_url() - { - $param_array = array(); - if ($this->start < $this->per_page) { - $sub = 0; - } else { - $sub = $this->per_page; - } - $param_array['start'] = $this->start - $sub; - $param_array['end'] = $this->end - $sub; - if ($this->categorie != 0) { - $param_array['categorie'] = $this->categorie; - } - $param = http_build_query($param_array); - return $this->url."?$param"; - } - - function get_next_url() - { - $param_array = array(); - if (count($this->products) < $this->per_page) { - $add = 0; - } else { - $add = $this->per_page; - } - $param_array['start'] = $this->start + $add; - $param_array['end'] = $this->end + $add; - if ($this->categorie != 0) { - $param_array['categorie'] = $this->categorie; - } - $param = http_build_query($param_array); - return $this->url."?$param"; - } - - function version_compare($v1, $v2) - { - $v1 = explode('.', $v1); - $v2 = explode('.', $v2); - $ret = 0; - $level = 0; - $count1 = count($v1); - $count2 = count($v2); - $maxcount = max($count1, $count2); - while ($level < $maxcount) { - $operande1 = isset($v1[$level]) ? $v1[$level] : 'x'; - $operande2 = isset($v2[$level]) ? $v2[$level] : 'x'; - $level++; - if (strtoupper($operande1) == 'X' || strtoupper($operande2) == 'X' || $operande1 == '*' || $operande2 == '*') { - break; - } - if ($operande1 < $operande2) { - $ret = -$level; - break; - } - if ($operande1 > $operande2) { - $ret = $level; - break; - } - } - //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
    '."\n"; - return $ret; - } -} - -class DolistoreModel -{ - - function get_categories($parent = 0) - { - if (!isset($this->categories)) die('not possible'); - if ($parent != 0) { - $html = '
      '; - } else { - $html = ''; - } - - for ($i = 0; $i < count($this->categories); $i++) { - $cat = $this->categories[$i]; - if ($cat->is_root_category == 1 && $parent == 0) { - $html .= '
    • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'

      '; - $html .= self::get_categories($cat->id); - $html .= "
    • \n"; - } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau - $select = ($cat->id == $this->categorie) ? ' selected' : ''; - $html .= '
    • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.''; - $html .= self::get_categories($cat->id); - $html .= "
    • \n"; - } else { - - } - } - - if ($html == '
        ') { - return ''; - } - if ($parent != 0) { - return $html.'
      '; - } else { - return $html; - } - } - - function get_products() - { - global $langs, $conf; - $html = ""; - $parity = "pair"; - $last_month = time() - (30 * 24 * 60 * 60); - foreach ($this->products as $product) { - $parity = ($parity == "impair") ? 'pair' : 'impair'; - - // check new product ? - $newapp = ''; - if ($last_month < strtotime($product->date_add)) { - $newapp .= ''.$langs->trans('New').' '; - } - - // check updated ? - if ($last_month < strtotime($product->date_upd) && $newapp == '') { - $newapp .= ''.$langs->trans('Updated').' '; - } - - // add image or default ? - if ($product->id_default_image != '') { - $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image; - $images = ''. - ''; - } else { - $images = ''; - } - - // free or pay ? - if ($product->price > 0) { - $price = '

      '.price(round((float) $product->price * $this->vat_rate, 2)).' €

      '; - $download_link = ''; - } else { - $price = $langs->trans('Free'); - $download_link = ''; - } - - //checking versions - if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { - if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { - //compatible - $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max, - $product->dolibarr_min, $product->dolibarr_max).''; - $compatible = ''; - } else { - //never compatible, module expired - $version = ''.$langs->trans('NotCompatible', DOL_VERSION, - $product->dolibarr_min, $product->dolibarr_max).''; - $compatible = 'NotCompatible'; - } - } else { - //need update - $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, - $product->dolibarr_min, $product->dolibarr_max).''; - $compatible = 'NotCompatible'; - } - - //output template - $html .= ' -
      '.$newapp.$images.'
      -

      '.$product->name->language[$this->lang].'Details' - .'
      '.$version.'

      - '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

      '.$product->description_short->language[$this->lang].' - '.$product->description->language[$this->lang].' - '.$price.' - '.$download_link.' - '; - } - return $html; - } - - function get_previous_link($text = '<<') - { - return "$text"; - } - - function get_next_link($text = '>>') - { - return "$text"; - } -} \ No newline at end of file +. + * + * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); + * it under the terms of the GNU General Public License as published bypliance with the License. + * the Free Software Foundation; either version 3 of the License, or + * + * 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, see . + * or see http://www.gnu.org/ + */ + +include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class.php'; + +/** + * Class DolistoreModel + */ +class Dolistore extends DolistoreModel +{ + // params + public $start // beginning of pagination + , $end // end of pagination + , $per_page // pagination: display per page + , $categorie // the current categorie + , $search // the search keywords + // setups + , $url // the url of this page + , $shop_url // the url of the shop + , $vat_rate // the vat rate used in the shop (prices are provided without vat) + , $lang // the integer representing the lang in the store + , $debug_api; // usefull if no dialog + + function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) + { + global $conf, $langs; + + $this->start = $options['start']; + $this->end = $options['end']; + $this->per_page = $options['per_page']; + $this->categorie = $options['categorie']; + $this->search = $options['search']; + + $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; + $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; + $this->vat_rate = 1.2; // 20% de TVA + $this->debug_api = false; + + if ($this->end == 0) { + $this->end = $this->per_page; + } + + $lang = explode('_', $langs->defaultlang); + $lang = $lang[0]; + $lang_array = ['fr', 'en', 'es', 'it', 'de']; + if (!in_array($lang, $lang_array)) { + $lang = 'en'; + } + $this->lang = array_search($lang, $lang_array) + 1; // 1=fr 2=en ... + + try { + $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); + + // Here we set the option array for the Webservice : we want products resources + $opt = array(); + $opt['resource'] = 'products'; + // make a search to limit the id returned. + if ($this->search != '') { + $opt2 = array(); + $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->products->children() as $product) { + $products[] = (int) $product['id']; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } elseif ($this->categorie != 0) { + $opt2 = array(); + $opt2['resource'] = 'categories'; + $opt2['id'] = $this->categorie; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->category->associations->products->children() as $product) { + $products[] = (int) $product->id; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } + $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; + $opt['sort'] = 'id_desc'; + $opt['filter[active]'] = '[1]'; + $opt['limit'] = "$this->start,$this->end"; + // Call + $xml = $this->api->get($opt); + $this->products = $xml->products->children(); + + + // Here we set the option array for the Webservice : we want categories resources + $opt = array(); + $opt['resource'] = 'categories'; + $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; + $opt['sort'] = 'id_asc'; + // Call + $xml = $this->api->get($opt); + $this->categories = $xml->categories->children(); + } catch (PrestaShopWebserviceException $e) { + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + else if ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); + } + } + + function get_previous_url() + { + $param_array = array(); + if ($this->start < $this->per_page) { + $sub = 0; + } else { + $sub = $this->per_page; + } + $param_array['start'] = $this->start - $sub; + $param_array['end'] = $this->end - $sub; + if ($this->categorie != 0) { + $param_array['categorie'] = $this->categorie; + } + $param = http_build_query($param_array); + return $this->url."&".$param; + } + + function get_next_url() + { + $param_array = array(); + if (count($this->products) < $this->per_page) { + $add = 0; + } else { + $add = $this->per_page; + } + $param_array['start'] = $this->start + $add; + $param_array['end'] = $this->end + $add; + if ($this->categorie != 0) { + $param_array['categorie'] = $this->categorie; + } + $param = http_build_query($param_array); + return $this->url."&".$param; + } + + function version_compare($v1, $v2) + { + $v1 = explode('.', $v1); + $v2 = explode('.', $v2); + $ret = 0; + $level = 0; + $count1 = count($v1); + $count2 = count($v2); + $maxcount = max($count1, $count2); + while ($level < $maxcount) { + $operande1 = isset($v1[$level]) ? $v1[$level] : 'x'; + $operande2 = isset($v2[$level]) ? $v2[$level] : 'x'; + $level++; + if (strtoupper($operande1) == 'X' || strtoupper($operande2) == 'X' || $operande1 == '*' || $operande2 == '*') { + break; + } + if ($operande1 < $operande2) { + $ret = -$level; + break; + } + if ($operande1 > $operande2) { + $ret = $level; + break; + } + } + //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'
      '."\n"; + return $ret; + } +} + + +/** + * Class DolistoreModel + */ +class DolistoreModel +{ + + function get_categories($parent = 0) + { + if (!isset($this->categories)) die('not possible'); + if ($parent != 0) { + $html = '
        '; + } else { + $html = ''; + } + + for ($i = 0; $i < count($this->categories); $i++) { + $cat = $this->categories[$i]; + if ($cat->is_root_category == 1 && $parent == 0) { + $html .= '
      • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'

        '; + $html .= self::get_categories($cat->id); + $html .= "
      • \n"; + } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau + $select = ($cat->id == $this->categorie) ? ' selected' : ''; + $html .= '
      • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.''; + $html .= self::get_categories($cat->id); + $html .= "
      • \n"; + } else { + + } + } + + if ($html == '
          ') { + return ''; + } + if ($parent != 0) { + return $html.'
        '; + } else { + return $html; + } + } + + function get_products() + { + global $langs, $conf; + $html = ""; + $parity = "pair"; + $last_month = time() - (30 * 24 * 60 * 60); + foreach ($this->products as $product) { + $parity = ($parity == "impair") ? 'pair' : 'impair'; + + // check new product ? + $newapp = ''; + if ($last_month < strtotime($product->date_add)) { + $newapp .= ''.$langs->trans('New').' '; + } + + // check updated ? + if ($last_month < strtotime($product->date_upd) && $newapp == '') { + $newapp .= ''.$langs->trans('Updated').' '; + } + + // add image or default ? + if ($product->id_default_image != '') { + $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image; + $images = ''. + ''; + } else { + $images = ''; + } + + // free or pay ? + if ($product->price > 0) { + $price = '

        '.price(round((float) $product->price * $this->vat_rate, 2)).' €

        '; + $download_link = ''; + } else { + $price = $langs->trans('Free'); + $download_link = ''; + } + + //checking versions + if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { + if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { + //compatible + $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = ''; + } else { + //never compatible, module expired + $version = ''.$langs->trans('NotCompatible', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = 'NotCompatible'; + } + } else { + //need update + $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = 'NotCompatible'; + } + + //output template + $html .= ' +
        '.$newapp.$images.'
        +

        '.$product->name->language[$this->lang].'Details' + .'
        '.$version.'

        + '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

        '.$product->description_short->language[$this->lang].' + '.$product->description->language[$this->lang].' + '.$price.' + '.$download_link.' + '; + } + return $html; + } + + function get_previous_link($text = '<<') + { + return "$text"; + } + + function get_next_link($text = '>>') + { + return "$text"; + } +} diff --git a/htdocs/dolistore/class/init.php b/htdocs/admin/dolistore/class/init.php similarity index 100% rename from htdocs/dolistore/class/init.php rename to htdocs/admin/dolistore/class/init.php diff --git a/htdocs/dolistore/css/dolistore.css b/htdocs/admin/dolistore/css/dolistore.css similarity index 100% rename from htdocs/dolistore/css/dolistore.css rename to htdocs/admin/dolistore/css/dolistore.css diff --git a/htdocs/dolistore/img/Download-128.png b/htdocs/admin/dolistore/img/Download-128.png similarity index 100% rename from htdocs/dolistore/img/Download-128.png rename to htdocs/admin/dolistore/img/Download-128.png diff --git a/htdocs/dolistore/img/NoImageAvailable.png b/htdocs/admin/dolistore/img/NoImageAvailable.png similarity index 100% rename from htdocs/dolistore/img/NoImageAvailable.png rename to htdocs/admin/dolistore/img/NoImageAvailable.png diff --git a/htdocs/dolistore/img/compatible.png b/htdocs/admin/dolistore/img/compatible.png similarity index 100% rename from htdocs/dolistore/img/compatible.png rename to htdocs/admin/dolistore/img/compatible.png diff --git a/htdocs/dolistore/img/dolistore.png b/htdocs/admin/dolistore/img/dolistore.png similarity index 100% rename from htdocs/dolistore/img/dolistore.png rename to htdocs/admin/dolistore/img/dolistore.png diff --git a/htdocs/dolistore/img/follow.png b/htdocs/admin/dolistore/img/follow.png similarity index 100% rename from htdocs/dolistore/img/follow.png rename to htdocs/admin/dolistore/img/follow.png diff --git a/htdocs/dolistore/img/object_dolistore.png b/htdocs/admin/dolistore/img/object_dolistore.png similarity index 100% rename from htdocs/dolistore/img/object_dolistore.png rename to htdocs/admin/dolistore/img/object_dolistore.png diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index a59d6fca3bb..40beaeadec2 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; $langs->load("errors"); $langs->load("admin"); @@ -46,6 +47,17 @@ $search_status=GETPOST('search_status','alpha'); $search_nature=GETPOST('search_nature','alpha'); $search_version=GETPOST('search_version','alpha'); + +// For dolistore search +$options = array(); +$options['per_page'] = 20; +$options['categorie'] = GETPOST('categorie', 'int') + 0; +$options['start'] = GETPOST('start', 'int') + 0; +$options['end'] = GETPOST('end', 'int') + 0; +$options['search'] = GETPOST('search_keyword', 'alpha'); +$dolistore = new Dolistore($options); + + if (! $user->admin) accessforbidden(); @@ -240,6 +252,11 @@ if ($action == 'reset' && $user->admin) * View */ +$form = new Form($db); + +$morejs = array("/admin/dolistore/js/dolistore.js.php"); +$morecss = array("/admin/dolistore/css/dolistore.css"); + // Set dir where external modules are installed if (! dol_is_dir($dirins)) { @@ -247,10 +264,8 @@ if (! dol_is_dir($dirins)) } $dirins_ok=(dol_is_dir($dirins)); -$form = new Form($db); - $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$help_url); +llxHeader('',$langs->trans("Setup"),$help_url, '', '', '', $morejs, $morecss, 0, 0); $arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers")); $arrayofwarnings=array(); // Array of warning each module want to show when activated @@ -423,24 +438,9 @@ print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup'); if ($mode=='common') print ''.$langs->trans("ModulesDesc")."
        \n"; if ($mode=='marketplace') print ''.$langs->trans("ModulesMarketPlaceDesc")."
        \n"; if ($mode=='deploy') print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
        \n"; +if ($mode=='develop') print ''.$langs->trans("ModulesDevelopDesc")."
        \n"; - -$h = 0; - -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=common"; -$head[$h][1] = $langs->trans("AvailableModules"); -$head[$h][2] = 'common'; -$h++; - -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace"; -$head[$h][1] = $langs->trans("ModulesMarketPlaces"); -$head[$h][2] = 'marketplace'; -$h++; - -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy"; -$head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther"); -$head[$h][2] = 'deploy'; -$h++; +$head = modules_prepare_head(); print "
        \n"; @@ -817,7 +817,6 @@ if ($mode == 'marketplace') print ''.$langs->trans("URL").''; print ''; - print "\n"; $url='https://www.dolistore.com'; print ''; @@ -825,17 +824,57 @@ if ($mode == 'marketplace') print ''.$url.''; print ''; - - print "\n"; - $url='https://partners.dolibarr.org'; - print ''; - print ''.$langs->trans("DoliPartnersDesc").''; - print ''.$url.''; - print ''; - print "\n"; dol_fiche_end(); + + print '
        '; + + if ($conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''.$langs->trans('DOLISTOREdescriptionLong').''; + + + ?> +

        + +
        +
        + +
        trans('Mot-cle') ?>: +
        +
        +


        +
        +
        +
        +
          + get_categories(); ?> +
        +
        +
        + + + + + + + + get_products($categorie); ?> + + + + + + +
        get_previous_link() ?> get_next_link() ?> trans('AchatTelechargement') ?>
        get_previous_link() ?> get_next_link() ?> trans('AchatTelechargement') ?>
        +
        + + \n"; + print "\n"; + //print ''.$langs->trans("Logo").''; + print ''.$langs->trans("DevelopYourModuleDesc").''; + print ''.$langs->trans("URL").''; + print ''; + + print "\n"; + $url='https://partners.dolibarr.org'; + print ''; + print ''.$langs->trans("DoliPartnersDesc").''; + print ''.$url.''; + print ''; + + print "\n"; + + dol_fiche_end(); +} + + + llxFooter(); $db->close(); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 77c24ff4109..15a17feaea8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -579,6 +579,9 @@ class Conf $conf->global->AGENDA_DEFAULT_FILTER_TYPE='0'; // 'AC_NON_AUTO' does not exists when AGENDA_DEFAULT_FILTER_TYPE is not on. } + $conf->global->MAIN_MODULE_DOLISTORE_API_SRV='https://www.dolistore.com'; + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY='dolistorecatalogpublickey1234567'; + // For backward compatibility if (isset($this->product)) $this->produit=$this->product; if (isset($this->facture)) $this->invoice=$this->facture; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 2f604a5c702..d2c466287ff 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -532,6 +532,43 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not } + + +/** + * Prepare array with list of tabs + * + * @return array Array of tabs to show + */ +function modules_prepare_head() +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=common"; + $head[$h][1] = $langs->trans("AvailableModules"); + $head[$h][2] = 'common'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace"; + $head[$h][1] = $langs->trans("ModulesMarketPlaces"); + $head[$h][2] = 'marketplace'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy"; + $head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther"); + $head[$h][2] = 'deploy'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=develop"; + $head[$h][1] = $langs->trans("ModulesDevelopYourModule"); + $head[$h][2] = 'develop'; + $h++; + + return $head; +} + + /** * Prepare array with list of tabs * @@ -564,7 +601,7 @@ function security_prepare_head() $head[$h][2] = 'filedownload'; $h++; */ - + $head[$h][0] = DOL_URL_ROOT."/admin/proxy.php"; $head[$h][1] = $langs->trans("ExternalAccess"); $head[$h][2] = 'proxy'; diff --git a/htdocs/dolistore/core/modules/modDolistore.class.php b/htdocs/dolistore/core/modules/modDolistore.class.php deleted file mode 100644 index a582b93a038..00000000000 --- a/htdocs/dolistore/core/modules/modDolistore.class.php +++ /dev/null @@ -1,159 +0,0 @@ -. - * - * 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 3 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, see . - * - * - * Classe de description et activation du module DOLISTORE - */ - - -include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; - -class modDolistore extends DolibarrModules -{ - - /** - * Constructor. Define names, constants, directories, boxes, permissions - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - global $conf, $langs; - - $this->db = $db; - $this->numero = 66666; - - - // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = /* $langs->trans( */preg_replace('/^mod/i', '', get_class($this))/* ) */; - - $this->boxes = array(); - - - $this->description = $langs->trans("DOLISTOREdescription"); - - $this->descriptionlong = $langs->trans("DOLISTOREdescriptionLong"); - - $this->family = "interface"; - - $this->module_position = 1; - $this->version = 'dolibarr'; - $this->picto = 'dolistore@dolistore'; - $this->special=1; - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - - // Data directories to create when module is enabled - $this->dirs = array(); - - // Dependances - $this->depends = array(); - $this->requiredby = array(); - $this->langfiles = array('dolistore@dolistore'); - - // Config pages - //$this->config_page_url = array("index.php?page=config@dolistore"); - - - - $this->module_parts = array( - 'triggers' => 0, - // Set this to 1 if module overwrite template dir (core/tpl) - 'tpl' => 0, - ); - - - - - - // Main menu entries - $r = 0; - - $this->menu[$r] = array( - //'fk_menu' => -1, // Put 0 if this is a top menu - 'fk_menu' => 'fk_mainmenu=home,fk_leftmenu=setup', - 'type' => 'left', // This is a left menu entry - 'titre' => 'DOLISTOREMENU', - 'mainmenu' => 'home', - 'leftmenu' => 'setup', - 'url' => '/dolistore/index.php?mainmenu=home&leftmenu=setup', - 'langs' => 'dolistore@dolistore', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position' => 1, - 'enabled' => '$leftmenu=="setup" && $conf->dolistore->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - //'perms' => '$user->rights->edi->message->view', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'perms' => '', - 'target' => '', - 'user' => 0); // 0=Menu for internal users, 1=external users, 2=both - - $r++; - - // Constantes - $this->const = array(); - - - $r = 0; - $this->const[$r][0] = 'MAIN_MODULE_'.strtoupper($this->name).'_API_SRV'; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "https://www.dolistore.com"; - $this->const[$r][3] = "Server URL"; - $this->const[$r][4] = 0; - $this->const[$r][5] = 1; // supprime la constante à la désactivation du module - $r++; - - $this->const[$r][0] = 'MAIN_MODULE_'.strtoupper($this->name).'_API_KEY'; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "dolistorecatalogpublickey1234567"; - $this->const[$r][3] = "API key to authenticate"; - $this->const[$r][4] = 0; - $this->const[$r][5] = 1; // supprime la constante à la désactivation du module - $r++; - - } - - /** - * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. - * It also creates data directories - * - * @param string $options Options when enabling module ('', 'noboxes') - * @return int 1 if OK, 0 if KO - */ - function init($options = '') - { - global $conf; - - $this->remove($options); - - $sql = array(); - - return $this->_init($sql, $options); - } - - /** - * Function called when module is disabled. - * Remove from database constants, boxes and permissions from Dolibarr database. - * Data directories are not deleted - * - * @param string $options Options when enabling module ('', 'noboxes') - * @return int 1 if OK, 0 if KO - */ - function remove($options = '') - { - $sql = array(); - - return $this->_remove($sql, $options); - } -} \ No newline at end of file diff --git a/htdocs/dolistore/index.php b/htdocs/dolistore/index.php deleted file mode 100644 index 1295801b436..00000000000 --- a/htdocs/dolistore/index.php +++ /dev/null @@ -1,115 +0,0 @@ -. - * - * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); - * it under the terms of the GNU General Public License as published bypliance with the License. - * the Free Software Foundation; either version 3 of the License, or - * - * 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, see . - * or see http://www.gnu.org/ - */ - -if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1); -/** - * \file htdocs/commande/info.php - * \ingroup commande - * \brief Page des informations d'une commande - */ -$res = 0; -if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); -if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); -if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); -if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); -if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res) die("Include of main fails"); - -// CORE - -global $lang, $user, $conf; - - -dol_include_once('/dolistore/class/dolistore.class.php'); -$options = array(); -$options['per_page'] = 20; -$options['categorie'] = GETPOST('categorie', 'int') + 0; -$options['start'] = GETPOST('start', 'int') + 0; -$options['end'] = GETPOST('end', 'int') + 0; -$options['search'] = GETPOST('search_keyword', 'alpha'); -$dolistore = new Dolistore($options); -/* - * View - */ - -/* * ************************************************* - * VIEW - * - * Put here all code to build page - * ************************************************** */ - -// llxHeader('', iconv(iconv_get_encoding($langs->trans($lbl_folder)), $character_set_client . "//TRANSLIT", $langs->trans($lbl_folder)) . ' (' . $info->Nmsgs . ') ', ''); - -$morejs = array("/dolistore/js/dolistore.js.php", - "/dolistore/js/fancybox/jquery.fancybox.pack.js", - "/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.js"); -$morecss = array("/dolistore/css/dolistore.css", - "/dolistore/js/fancybox/jquery.fancybox.css", - "/dolistore/js/fancybox/helpers/jquery.fancybox-thumbs.css"); -llxHeader('', $langs->trans('DOLISTOREMENU'), '', '', '', '', $morejs, $morecss, 0, 0); -?>
        - - -
        - - -
        trans('Extensions disponibles sur le Dolistore') ?>
        -
        - trans('DOLISTOREdescriptionLong') ?>

        - -
        -
        -
        trans('Mot-cle') ?>: -
        -
        -


        -
        -
        -
        -
          - get_categories(); ?> -
        -
        -
        - - - - - - - - get_products($categorie); ?> - - - - - - -
        get_previous_link() ?> get_next_link() ?> trans('AchatTelechargement') ?>
        get_previous_link() ?> get_next_link() ?> trans('AchatTelechargement') ?>
        -
        -
        -. - * - * This program is free software; you can redistribute it and/or modifyion 2.0 (the "License"); - * it under the terms of the GNU General Public License as published bypliance with the License. - * the Free Software Foundation; either version 3 of the License, or - * - * 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, see . - * or see http://www.gnu.org/ - */ -$res = 0; -if (!$res && file_exists("../main.inc.php")) $res = @include("../main.inc.php"); -if (!$res && file_exists("../../main.inc.php")) $res = @include("../../main.inc.php"); -if (!$res && file_exists("../../../main.inc.php")) $res = @include("../../../main.inc.php"); -if (!$res && file_exists("../../../../main.inc.php")) $res = @include("../../../../main.inc.php"); -if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) - $res = @include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only -if (!$res) die("Include of main fails"); - -global $langs; - -ob_start(); -?>'; - } print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice); } } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index e7d8a7cf538..f793bb2601d 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -40,6 +40,7 @@ * Ex: array('disabled'=> * Ex: array('show'=> * Ex: array('update_textarea'=> + * Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) * @return string Script */ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array()) @@ -140,6 +141,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value // Disable an element if (options.option_disabled) { + console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled) if (ui.item.disabled) { $("#" + options.option_disabled).prop("disabled", true); if (options.error) { @@ -148,28 +150,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt if (options.warning) { $.jnotify(options.warning, "warning", false); // Output with jnotify the warning message } - } else { + } else { $("#" + options.option_disabled).removeAttr("disabled"); } } if (options.disabled) { + console.log("Make action disabled on each "+options.option_disabled) $.each(options.disabled, function(key, value) { $("#" + value).prop("disabled", true); }); } if (options.show) { + console.log("Make action show on each "+options.show) $.each(options.show, function(key, value) { $("#" + value).show().trigger("show"); }); } // Update an input if (ui.item.update) { + console.log("Make action update on each ui.item.update") // loop on each "update" fields $.each(ui.item.update, function(key, value) { $("#" + key).val(value).trigger("change"); }); } if (ui.item.textarea) { + console.log("Make action textarea on each ui.item.textarea") $.each(ui.item.textarea, function(key, value) { if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") { CKEDITOR.instances[key].setData(value); @@ -181,12 +187,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt }); } console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'"); - + $("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code. } ,delay: 500 }).data("ui-autocomplete")._renderItem = function( ul, item ) { - + return $("
      • ") .data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0 .append( \'\' + item.label + "" ) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 5e9786f2ba4..f14af2b838f 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -26,7 +26,7 @@ * $langs * $dateSelector * $forceall (0 by default, 1 for supplier invoices/orders) - * $senderissupplier (0 by default, 1 for supplier invoices/orders) + * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) */ @@ -52,7 +52,7 @@ if (in_array($object->element,array('propal', 'supplier_proposal','facture','fac ?> -lines) == 0 || $forcetoshowtitlelines); if ($nolinesbefore) { ?> @@ -94,7 +94,7 @@ if ($nolinesbefore) { global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); else @@ -108,7 +108,7 @@ if ($nolinesbefore) { ?>   - @@ -200,20 +200,22 @@ else { } else { + // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum if ($senderissupplier != 2) { $ajaxoptions=array( 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key - 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done - 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done + 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) ); $alsoproductwithnosupplierprice=0; } - else + else { $ajaxoptions = array(); $alsoproductwithnosupplierprice=1; } + $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); } echo ''; @@ -263,13 +265,13 @@ else { "> - + multicurrency->enabled)) { $colspan++;?> "> - + "> @@ -306,7 +308,7 @@ else { rights->margins->creer) { if (! empty($conf->global->DISPLAY_MARGIN_RATES)) @@ -561,9 +563,9 @@ jQuery(document).ready(function() { $("#idprod, #idprodfournprice").change(function() { console.log("#idprod, #idprodfournprice change triggered"); - + setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva - + jQuery('#trlinefordates').show(); global->MARGIN_TYPE)) { if ($conf->global->MARGIN_TYPE == '1') print 'bestsupplierprice'; @@ -598,7 +600,7 @@ jQuery(document).ready(function() { if ($conf->global->MARGIN_TYPE == 'costprice') print 'costprice'; } ?>'; console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice); - + var i = 0; $(data).each(function() { if (this.id != 'pmpprice' && this.id != 'costprice') @@ -615,7 +617,7 @@ jQuery(document).ready(function() { //console.log("id="+this.id+"-price="+this.price); if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice) { - if (this.price > 0) { + if (this.price > 0) { defaultkey = this.id; defaultprice = this.price; pmppriceid = this.id; pmppricevalue = this.price; //console.log("pmppricevalue="+pmppricevalue); } @@ -634,22 +636,22 @@ jQuery(document).ready(function() { options += ''; }); options += ''; - + console.log("finally selected defaultkey="+defaultkey+" defaultprice="+defaultprice); - + $("#fournprice_predef").html(options).show(); if (defaultkey != '') { $("#fournprice_predef").val(defaultkey); } - + /* At loading, no product are yet selected, so we hide field of buying_price */ $("#buying_price").hide(); - + /* Define default price at loading */ var defaultprice = $("#fournprice_predef").find('option:selected').attr("price"); $("#buying_price").val(defaultprice); - + $("#fournprice_predef").change(function() { console.log("change on fournprice_predef"); /* Hide field buying_price according to choice into list (if 'inputprice' or not) */ diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e9da56d2093..1d099ee9265 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1157,7 +1157,7 @@ class CommandeFournisseur extends CommonOrder // insert products details into database for ($i=0;$i<$num;$i++) { - $result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set + $result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set $this->lines[$i]->desc, $this->lines[$i]->subprice, $this->lines[$i]->qty, @@ -1393,7 +1393,7 @@ class CommandeFournisseur extends CommonOrder if ($fk_product > 0) { - if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) { // Check quantity is enough dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index bbc91bc3871..74d96158f65 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -346,21 +346,29 @@ if (empty($reshook)) { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) } - - if (GETPOST('idprodfournprice') > 0) + if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + { + $idprod=$reg[1]; + $res=$productsupplier->fetch($idprod); + // Call to init properties of $productsupplier + // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price + $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist + } + elseif (GETPOST('idprodfournprice') > 0) { - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); } if ($idprod > 0) { - $res=$productsupplier->fetch($idprod); - $label = $productsupplier->label; $desc = $productsupplier->description; @@ -381,8 +389,8 @@ if (empty($reshook)) $tva_tx, $localtax1_tx, $localtax2_tx, + $idprod, $productsupplier->id, - GETPOST('idprodfournprice'), $productsupplier->fourn_ref, $remise_percent, 'HT', @@ -2074,6 +2082,7 @@ elseif (! empty($object->id)) // Add free products/services form global $forceall, $senderissupplier, $dateSelector; $forceall=1; $senderissupplier=1; $dateSelector=0; + if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. // Show object lines $inputalsopricewithtax=0; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e90af97cfd9..8402b298f93 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -201,7 +201,7 @@ if (empty($reshook)) } $model=$object->modelpdf; $ret = $object->fetch($id); // Reload to get new records - + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } @@ -945,21 +945,30 @@ if (empty($reshook)) if (GETPOST('prod_entry_mode') != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { - $idprod=0; $productsupplier=new ProductFournisseur($db); - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1) + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - if (GETPOST('idprodfournprice') > 0) + if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + { + $idprod=$reg[1]; + $res=$productsupplier->fetch($idprod); + // Call to init properties of $productsupplier + // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price + $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist + } + elseif (GETPOST('idprodfournprice') > 0) { - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); } //Replaces $fk_unit with the product's if ($idprod > 0) { - $result=$productsupplier->fetch($idprod); - $label = $productsupplier->label; $desc = $productsupplier->description; @@ -974,10 +983,29 @@ if (empty($reshook)) $type = $productsupplier->type; $price_base_type = 'HT'; - // TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first) - $result=$object->addline($desc, $productsupplier->fourn_pu, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $productsupplier->fk_unit); + // TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first) + $result=$object->addline( + $desc, + $productsupplier->fourn_pu, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $qty, + $idprod, + $remise_percent, + $date_start, + $date_end, + 0, + $tva_npr, + $price_base_type, + $type, + -1, + 0, + $array_options, + $productsupplier->fk_unit + ); } - if ($idprod == -2 || $idprod == 0) + if ($idprod == -99 || $idprod == 0) { // Product not selected $error++; @@ -1019,7 +1047,7 @@ if (empty($reshook)) } $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - + $result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise); } @@ -1518,7 +1546,7 @@ if ($action == 'create') if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid)))) { // Deposit - if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) + if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) { print '
        '; $tmp=' '; @@ -1548,12 +1576,12 @@ if ($action == 'create') } } */ - + /* Not yet supporter for supplier if ($societe->id > 0) { // Replacement - if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) + if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { print ''; print '
        '; @@ -1603,7 +1631,7 @@ if ($action == 'create') if ($societe->id > 0) { // Credit note - if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) + if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) { print '
        '; $tmp='textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); print $desc; - + print '
        '; print '    0 ? 'checked':'').' /> "; print '
            0 ? 'checked':'').' /> "; print '
        '; - + print '
        '; } } @@ -2029,7 +2057,7 @@ else $object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); print '
        '; print '
        '; @@ -2229,9 +2257,9 @@ else // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print ''; - + print '
        '; print '
        '; print '
        '; @@ -2245,12 +2273,12 @@ else print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ''; print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; print ''; - + // Multicurrency Amount VAT print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ''; print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; print ''; - + // Multicurrency Amount TTC print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ''; print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; @@ -2288,13 +2316,13 @@ else print ''.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).''; print ''; - + /* * List of payments */ - + $totalpaye = 0; - + $sign = 1; if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = - 1; @@ -2387,9 +2415,9 @@ else { print ''.$langs->trans('AlreadyPaid').' :'.price($totalpaye).''; print ''.$langs->trans("Billed").' :'.price($object->total_ttc).''; - + $resteapayer = $object->total_ttc - $totalpaye; - + print ''.$langs->trans('RemainderToPay').' :'; print ''.price($resteapayer).''; } @@ -2402,7 +2430,7 @@ else dol_print_error($db); } - if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE) + if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE) { // Total already paid print ''; @@ -2453,7 +2481,7 @@ else dol_print_error($db); } */ - + // Paye partiellement 'escompte' if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { print ''; @@ -2502,7 +2530,7 @@ else print ' :'; print '' . price($resteapayeraffiche) . ''; print ' '; - } + } else // Credit note { // Total already paid back @@ -2534,9 +2562,9 @@ else print '
        '; print '
        '; print '
        '; - + print '

        '; - + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $blocname = 'contacts'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index fee2d3b4a1c..26729ecf866 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -579,7 +579,7 @@ if (empty($reshook)) { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) @@ -594,8 +594,9 @@ if (empty($reshook)) } elseif (GETPOST('idprodfournprice') > 0) { - //$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), -1); // We force qty to -1 to be sure to find if a supplier price exist + //$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); $res=$productsupplier->fetch($idprod); } @@ -605,7 +606,7 @@ if (empty($reshook)) $price_base_type = $productsupplier->fourn_price_base_type; $type = $productsupplier->type; $label = $productsupplier->label; - $desc = $productsupplier->description; + $desc = $productsupplier->description; if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); From 4c243d3b9e16062866079144d9674ccc49310797 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 15:18:54 +0200 Subject: [PATCH 0107/1137] Fix index declaration must be moved into the .key.sql files. --- .../install/mysql/migration/6.0.0-7.0.0.sql | 6 ++++++ .../mysql/tables/llx_holiday_config.key.sql | 20 +++++++++++++++++++ .../mysql/tables/llx_holiday_config.sql | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 htdocs/install/mysql/tables/llx_holiday_config.key.sql diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index b027f560aa0..5759423abbb 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -190,3 +190,9 @@ ALTER TABLE llx_extrafields ADD COLUMN fk_user_author integer; ALTER TABLE llx_extrafields ADD COLUMN fk_user_modif integer; ALTER TABLE llx_extrafields ADD COLUMN datec datetime; ALTER TABLE llx_extrafields ADD COLUMN tms timestamp; + +ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); +ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name); + + + diff --git a/htdocs/install/mysql/tables/llx_holiday_config.key.sql b/htdocs/install/mysql/tables/llx_holiday_config.key.sql new file mode 100644 index 00000000000..cda95c87f39 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_holiday_config.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2012 Laurent Destailleur +-- +-- 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 3 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, see . +-- +-- =================================================================== + +ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name); + diff --git a/htdocs/install/mysql/tables/llx_holiday_config.sql b/htdocs/install/mysql/tables/llx_holiday_config.sql index 2f08bf5aa41..4ef6f15c7df 100644 --- a/htdocs/install/mysql/tables/llx_holiday_config.sql +++ b/htdocs/install/mysql/tables/llx_holiday_config.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_holiday_config ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, -name VARCHAR( 255 ) NOT NULL UNIQUE, +name VARCHAR(128) NOT NULL, value TEXT NULL ) ENGINE=innodb; \ No newline at end of file From 52a8692a8508fcef88fe4b36067af3bfdc84030a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 16:07:11 +0200 Subject: [PATCH 0108/1137] FIX #7226 --- .../class/fournisseur.commande.class.php | 22 ++- htdocs/fourn/commande/dispatch.php | 144 +++++++++++++----- 2 files changed, 123 insertions(+), 43 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1d099ee9265..d7d1e542b3a 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2832,8 +2832,9 @@ class CommandeFournisseur extends CommonOrder $supplierorderdispatch = new CommandeFournisseurDispatch($this->db); $filter=array('t.fk_commande'=>$this->id); if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) { - $filter['t.status']=1; + $filter['t.status']=1; // Restrict to lines with status validated } + $ret=$supplierorderdispatch->fetchAll('','',0,0,$filter); if ($ret<0) { @@ -2844,20 +2845,27 @@ class CommandeFournisseur extends CommonOrder { if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0) { - //Build array with quantity deliverd by product + $date_liv = dol_now(); + + // Build array with quantity deliverd by product foreach($supplierorderdispatch->lines as $line) { $qtydelivered[$line->fk_product]+=$line->qty; } foreach($this->lines as $line) { $qtywished[$line->fk_product]+=$line->qty; } - - $date_liv = dol_now(); - //Compare array - $diff_array=array_diff_assoc($qtydelivered,$qtywished); + $diff_array=array_diff_assoc($qtydelivered,$qtywished); // Warning: $diff_array is done only on common keys. + $keysinwishednotindelivered=array_diff(array_keys($qtywished),array_keys($qtydelivered)); // To check we also have same number of keys + $keysindeliverednotinwished=array_diff(array_keys($qtydelivered),array_keys($qtywished)); // To check we also have same number of keys + /*var_dump(array_keys($qtydelivered)); + var_dump(array_keys($qtywished)); + var_dump($diff_array); + var_dump($keysinwishednotindelivered); + var_dump($keysindeliverednotinwished); + exit;*/ - if (count($diff_array)==0) //No diff => mean everythings is received + if (count($diff_array)==0 && count($keysinwishednotindelivered)==0 && count($keysindeliverednotinwished)==0) //No diff => mean everythings is received { if ($closeopenorder) { diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c87b3a62bed..c6a6034c684 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -28,6 +28,7 @@ * \ingroup commande * \brief Page to dispatch receiving */ + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php'; require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; @@ -84,17 +85,33 @@ if ($id > 0 || ! empty($ref)) { * Actions */ -if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(1); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(1); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error++; + $action = ''; + } + } + + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -102,19 +119,42 @@ if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } -if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(0); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(0); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error ++; + $action = ''; + } + } + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -122,19 +162,42 @@ if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANC $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } -if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(2); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(2); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error ++; + $action = ''; + } + } + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -142,6 +205,14 @@ if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_ $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) { @@ -150,10 +221,10 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) $db->begin(); $pos = 0; - foreach ($_POST as $key => $value) + foreach ($_POST as $key => $value) { // without batch module enabled - if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) + if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $pos ++; @@ -184,7 +255,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) } } // with batch module enabled - if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) + if (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $pos ++; @@ -286,11 +357,11 @@ if ($id > 0 || ! empty($ref)) { $title = $langs->trans("SupplierOrder"); dol_fiche_head($head, 'dispatch', $title, 0, 'order'); - + // Supplier order card $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
        '; // Ref supplier $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); @@ -331,14 +402,14 @@ if ($id > 0 || ! empty($ref)) { } } $morehtmlref.='
        '; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + print '
        '; print '
        '; - + print ''; // Date @@ -362,7 +433,7 @@ if ($id > 0 || ! empty($ref)) { print "
        "; print '
        '; - + // if ($mesg) print $mesg; print '
        '; @@ -382,7 +453,7 @@ if ($id > 0 || ! empty($ref)) { print '
        '; print ''; print ''; - + print '
        '; print ''; @@ -585,10 +656,10 @@ if ($id > 0 || ! empty($ref)) { print ''; print "
        \n"; - if ($nbproduct) + if ($nbproduct) { $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); - + print '
        '; print $langs->trans("Comment") . ' : '; print '
        '; print ' '.$checkboxlabel; - + print '
        0 || ! empty($ref)) { if (! $nbproduct) { if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED)) print '
        '.$langs->trans("NoPredefinedProductToDispatch").'
        '; // No predefined line at all - else + else print '
        '.$langs->trans("NoMorePredefinedProductToDispatch").'
        '; // No predefined line that remain to be dispatched. } @@ -618,7 +689,7 @@ if ($id > 0 || ! empty($ref)) { dol_fiche_end(); - + // List of lines already dispatched $sql = "SELECT p.ref, p.label,"; $sql .= " e.rowid as warehouse_id, e.label as entrepot,"; @@ -699,7 +770,8 @@ if ($id > 0 || ! empty($ref)) { // Add button to check/uncheck disaptching print '
        '; - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) + { if (empty($objp->status)) { print '' . $langs->trans("Approve") . ''; print '' . $langs->trans("Deny") . ''; From 6b5b10fc949fd04451a595a59cb14c33beca904c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 16:28:34 +0200 Subject: [PATCH 0109/1137] FIX #7224 --- htdocs/product/class/productcustomerprice.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 5b9050077c9..b3066df8188 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -169,12 +169,12 @@ class Productcustomerprice extends CommonObject $sql .= " " . (empty($this->price_min_ttc) ? '0' : "'" . $this->price_min_ttc . "'") . ","; $sql .= " " . (! isset($this->price_base_type) ? 'NULL' : "'" . $this->db->escape($this->price_base_type) . "'") . ","; $sql .= " ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").","; - $sql .= " " . (! isset($this->tva_tx) ? 'NULL' : "'" . $this->tva_tx . "'") . ","; + $sql .= " " . (! isset($this->tva_tx) ? 'NULL' : (empty($this->tva_tx)?0:$this->tva_tx)) . ","; $sql .= " " . (! isset($this->recuperableonly) ? 'NULL' : "'" . $this->recuperableonly . "'") . ","; $sql .= " " . (empty($this->localtax1_type) ? "'0'" : "'" . $this->localtax1_type . "'") . ","; - $sql .= " " . (! isset($this->localtax1_tx) ? 'NULL' : "'" . $this->localtax1_tx . "'") . ","; + $sql .= " " . (! isset($this->localtax1_tx) ? 'NULL' : (empty($this->localtax1_tx)?0:$this->localtax1_tx)) . ","; $sql .= " " . (empty($this->localtax2_type) ? "'0'" : "'" . $this->localtax2_type . "'") . ","; - $sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : "'" . $this->localtax2_tx . "'") . ","; + $sql .= " " . (! isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx)?0:$this->localtax2_tx)) . ","; $sql .= " " . $user->id . ","; $sql .= " " . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . ""; $sql .= ")"; @@ -656,10 +656,10 @@ class Productcustomerprice extends CommonObject $sql .= " price_min_ttc=" . (isset($this->price_min_ttc) ? $this->price_min_ttc : "null") . ","; $sql .= " price_base_type=" . (isset($this->price_base_type) ? "'" . $this->db->escape($this->price_base_type) . "'" : "null") . ","; $sql .= " default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null").","; - $sql .= " tva_tx=" . (isset($this->tva_tx) ? $this->tva_tx : "null") . ","; + $sql .= " tva_tx=" . (isset($this->tva_tx) ? (empty($this->tva_tx)?0:$this->tva_tx) : "null") . ","; $sql .= " recuperableonly=" . (isset($this->recuperableonly) ? $this->recuperableonly : "null") . ","; - $sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? $this->localtax1_tx : "null") . ","; - $sql .= " localtax2_tx=" . (isset($this->localtax2_tx) ? $this->localtax2_tx : "null") . ","; + $sql .= " localtax1_tx=" . (isset($this->localtax1_tx) ? (empty($this->localtax1_tx)?0:$this->localtax1_tx) : "null") . ","; + $sql .= " localtax2_tx=" . (isset($this->localtax2_tx) ? (empty($this->localtax2_tx)?0:$this->localtax2_tx) : "null") . ","; $sql .= " localtax1_type=" . (! empty($this->localtax1_type) ? "'".$this->localtax1_type."'": "'0'") . ","; $sql .= " localtax2_type=" . (! empty($this->localtax2_type) ? "'".$this->localtax2_type."'": "'0'") . ","; $sql .= " fk_user=" . $user->id . ","; From 947acfffe204575feeee6eb5bb38cd88bd09424a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 16:53:29 +0200 Subject: [PATCH 0110/1137] FIX #7173 --- htdocs/adherents/subscription.php | 52 +++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0c9c8467f1f..c7904667846 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -113,7 +113,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights if ($result < 0) { $langs->load("errors"); - $errmsg=$langs->trans($company->error); setEventMessages($company->error, $company->errors, 'errors'); } else @@ -123,7 +122,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights } else { - $errmsg=$object->error; + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -211,7 +210,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]); } - $subscription=$_POST["subscription"]; // Amount of subscription + $subscription=price2num(GETPOST("subscription",'alpha')); // Amount of subscription $label=$_POST["label"]; // Payment informations @@ -229,6 +228,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $error++; $langs->load("errors"); $errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription")); + setEventMessages($errmsg, null, 'errors'); $action='addsubscription'; } if (GETPOST('end') && ! $datesubend) @@ -236,6 +236,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $error++; $langs->load("errors"); $errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription")); + setEventMessages($errmsg, null, 'errors'); $action='addsubscription'; } if (! $datesubend) @@ -246,16 +247,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $error++; $errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")); + setEventMessages($errmsg, null, 'errors'); $action='addsubscription'; } + $amount = price2num(GETPOST("subscription",'alpha')); + // Check if a payment is mandatory or not if (! $error && $adht->subscription) // Member type need subscriptions { - if (! is_numeric($_POST["subscription"])) + if (! is_numeric($amount)) { // If field is '' or not a numeric value $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); + setEventMessages($errmsg, null, 'errors'); $error++; $action='addsubscription'; } @@ -273,7 +278,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); } - if ($errmsg) $action='addsubscription'; + if ($errmsg) + { + setEventMessages($errmsg, null, 'errors'); + $action='addsubscription'; + } } } } @@ -319,6 +328,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $error++; $errmsg=$db->lasterror(); + setEventMessages($errmsg, null, 'errors'); } } else @@ -326,14 +336,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $error++; $errmsg=$acct->error; $errmsgs=$acct->errors; - } + setEventMessages($errmsg, $errmsgs, 'errors'); + } } else { $error++; $errmsg=$acct->error; $errmsgs=$acct->errors; - } + setEventMessages($errmsg, $errmsgs, 'errors'); + } } // If option choosed, we create invoice @@ -351,6 +363,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $langs->load("errors"); $errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst"); + setEventMessages($errmsg, null, 'errors'); $error++; } } @@ -361,6 +374,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $errmsg=$customer->error; $errmsgs=$acct->errors; + setEventMessages($errmsg, $errmsgs, 'errors'); $error++; } } @@ -378,6 +392,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $error++; $errmsg='ErrorNoPaymentTermRECEPFound'; + setEventMessages($errmsg, null, 'errors'); } } $invoice->socid=$object->fk_soc; @@ -389,12 +404,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $invoice->linked_objects = array_merge($invoice->linked_objects, $_POST['other_linked_objects']); } - + $result=$invoice->create($user); if ($result <= 0) { $errmsg=$invoice->error; $errmsgs=$invoice->errors; + setEventMessages($errmsg, $errmsgs, 'errors'); $error++; } } @@ -415,6 +431,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! if ($result <= 0) { $errmsg=$invoice->error; + setEventMessages($errmsg, null, 'errors'); $error++; } } @@ -427,6 +444,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $errmsg=$invoice->error; $errmsgs=$invoice->errors; + setEventMessages($errmsg, $errmsgs, 'errors'); $error++; } } @@ -454,6 +472,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! { $errmsg=$paiement->error; $errmsgs=$paiement->errors; + setEventMessages($errmsg, $errmsgs, 'errors'); $error++; } } @@ -535,6 +554,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! if ($result < 0) { $errmsg=$object->error; + setEventMessages($errmsg, null, 'errors'); } } @@ -581,12 +601,12 @@ if ($rowid > 0) dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'rowid', $linkback); - + print '
        '; print '
        '; - + print '
        '; print ''; @@ -624,13 +644,13 @@ if ($rowid > 0) } print '
        '; - + print '
        '; print '
        '; - + print '
        '; print ''; - + // Birthday print ''; @@ -677,7 +697,7 @@ if ($rowid > 0) } } print ''; - + // Third party Dolibarr if (! empty($conf->societe->enabled)) { @@ -752,7 +772,7 @@ if ($rowid > 0) print "\n"; print '
        '; - + dol_fiche_end(); print ''; From 1b1d1a8d0b093f0bc34d717acce479048afea69e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 16:57:07 +0200 Subject: [PATCH 0111/1137] FIX #7156 --- htdocs/societe/soc.php | 55 ++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b9c962a5168..06846d34203 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -140,7 +140,7 @@ if (empty($reshook)) if (!$errors) { // TODO Move the merge function into class of object. - + $db->begin(); // Recopy some data @@ -157,26 +157,29 @@ if (empty($reshook)) { if (empty($object->$property)) $object->$property = $soc_origin->$property; } - + // Concat some data $listofproperties=array( - 'note_public', 'note_private' + 'note_public', 'note_private' ); foreach ($listofproperties as $property) { $object->$property = dol_concatdesc($object->$property, $soc_origin->$property); } - + // Merge extrafields - foreach ($soc_origin->array_options as $key => $val) + if (is_array($soc_origin->array_options)) { - if (empty($object->array_options[$key])) $object->array_options[$key] = $val; + foreach ($soc_origin->array_options as $key => $val) + { + if (empty($object->array_options[$key])) $object->array_options[$key] = $val; + } } // TODO Merge categories $object->update($object->id, $user); - - // Move links + + // Move links $objects = array( 'Adherent' => '/adherents/class/adherent.class.php', 'Societe' => '/societe/class/societe.class.php', @@ -487,7 +490,7 @@ if (empty($reshook)) if (empty($object->fournisseur)) $object->code_fournisseur=''; $result = $object->create($user); - + if ($result >= 0) { if ($object->particulier) @@ -557,7 +560,7 @@ if (empty($reshook)) $object->code_fournisseur = null; $object->code_client = null; } - + $error=$object->error; $errors=$object->errors; } @@ -852,7 +855,7 @@ else $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm'); $object->client = GETPOST('client')?GETPOST('client'):$object->client; - + if(empty($duplicate_code_error)) { $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; @@ -860,7 +863,7 @@ else else { setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings'); } - + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); @@ -1136,7 +1139,7 @@ else print ''; print ''; print ''; - + // Skype if (! empty($conf->skype->enabled)) { @@ -1216,7 +1219,7 @@ else print ''; - + } elseif($mysoc->localtax1_assuj=="1") { @@ -1230,7 +1233,7 @@ else print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1); print ''; } - + // Type - Size print ''; - + } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { @@ -1774,7 +1777,7 @@ else print ''; } print ''; - + } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { @@ -1788,7 +1791,7 @@ else } print ''; } - + // VAT Code print ''; print ''; - + if($object->localtax1_assuj=="1" && (! isOnlyOneLocalTax(1))) { print ''; @@ -2144,7 +2147,7 @@ else print ''; } print ''; - + } } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") @@ -2154,7 +2157,7 @@ else print ''; if($object->localtax2_assuj=="1" && (! isOnlyOneLocalTax(2))) { - + print ''; print ''; print ''; @@ -2167,7 +2170,7 @@ else print ''; } print ''; - + } } /* @@ -2178,7 +2181,7 @@ else print ''; } */ - + // VAT Code print ''; print ''; */ + // Project + print ""; + // Ref print ''; + if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) + { + // Thirdparty + print ''; + } + // Label task print "\n"; - // Project - print ""; - - if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) - { - // Thirdparty - print ''; - } - // Planned Workload print ''; print "\n"; @@ -834,6 +840,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $workloadforid[$projectstatic->id]=1; } + $projectstatic->id=$lines[$i]->fk_project; + $projectstatic->ref=$lines[$i]->projectref; + $projectstatic->title=$lines[$i]->projectlabel; + $projectstatic->public=$lines[$i]->public; + $projectstatic->thirdparty_name=$lines[$i]->thirdparty_name; + print ''."\n"; // User @@ -843,6 +855,21 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; */ + // Project + print '"; + + if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) + { + // Thirdparty + print ''; + } + // Ref print '\n"; - // Project - print '"; - - if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) - { - // Thirdparty - print ''; - } - // Planned Workload print ''; print "\n"; diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index a30768709f9..8b380645f73 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -12,13 +12,13 @@ PrivateProject=Project contacts ProjectsImContactFor=Projects I'm explicitely a contact of AllAllowedProjects=All project I can read (mine + public) AllProjects=All projects -MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type). +MyProjectsDesc=This view is limited to projects you are a contact for. ProjectsPublicDesc=This view presents all projects you are allowed to read. TasksOnProjectsPublicDesc=This view presents all tasks on projects you are allowed to read. ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed to read. ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything). TasksOnProjectsDesc=This view presents all tasks on all projects (your user permissions grant you permission to view everything). -MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type). +MyTasksDesc=This view is limited to projects or tasks you are a contact for. OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible). ClosedProjectsAreHidden=Closed projects are not visible. TasksPublicDesc=This view presents all projects and tasks you are allowed to read. diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 45d7aa237ad..73197025df6 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -439,10 +439,10 @@ print '
        '; print '
        '.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
        '.fieldLabel('Web','url').'
        '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1); print '
        '.fieldLabel('ThirdPartyType','typent_id').''."\n"; $sortparam=(empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. @@ -1751,7 +1754,7 @@ else $formcompany->select_localtax(1,$object->localtax1_value, "lt1"); print ''; } - + print ''.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if (! isOnlyOneLocalTax(2)) @@ -1761,7 +1764,7 @@ else print ''; } print '
        '.fieldLabel('VATIntra','intra_vat').''; @@ -2090,7 +2093,7 @@ else print '
        '.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print yn($object->localtax2_assuj); print '
        '.$object->localtax1_value.'
        '.$object->localtax2_value.'
        '.$langs->trans('VATIntra').''; @@ -2573,10 +2576,10 @@ else // Subsidiaries list if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES)) - { + { $result=show_subsidiaries($conf,$langs,$db,$object); } - + // Contacts list if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { From d90a23efb69efc9f6aeec5c93a10ae2f042de8f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 17:00:50 +0200 Subject: [PATCH 0112/1137] Fix for old php --- htdocs/admin/dolistore/class/dolistore.class.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index acf86766e25..482bd124a40 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -56,13 +56,11 @@ class Dolistore extends DolistoreModel $this->end = $this->per_page; } - $lang = explode('_', $langs->defaultlang); - $lang = $lang[0]; - $lang_array = ['fr', 'en', 'es', 'it', 'de']; - if (!in_array($lang, $lang_array)) { - $lang = 'en'; - } - $this->lang = array_search($lang, $lang_array) + 1; // 1=fr 2=en ... + $langtmp = explode('_', $langs->defaultlang); + $lang = $langtmp[0]; + $lang_array = array('fr'=>1, 'en'=>2, 'es'=>3, 'it'=>4, 'de'=>5); + if (! in_array($lang, array_keys($lang_array))) $lang = 'en'; + $this->lang = $lang_array[$lang]; // 1=fr 2=en ... try { $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, From 9079d2890c429ac8012a70a3546f238d1330e1b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 18:13:42 +0200 Subject: [PATCH 0113/1137] Fix ajout du code devise Franc Pacifique --- htdocs/install/mysql/data/llx_c_currencies.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index d9b1390bb32..cb34f60291f 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -154,7 +154,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', NULL, 1, 'Franc pacifique (XPF)'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', '[70]', 1, 'Franc pacifique (XPF)'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar'); From ccb5344d32b803dd8abb02d27e2888f856f24612 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 18:52:03 +0200 Subject: [PATCH 0114/1137] Fix links --- htdocs/core/boxes/box_activity.php | 494 +++++++++--------- .../install/mysql/data/llx_c_currencies.sql | 2 +- 2 files changed, 248 insertions(+), 248 deletions(-) diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index ae3e270101e..02b1d1880c8 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -97,181 +97,95 @@ class box_activity extends ModeleBoxes $cumuldata = array(); - // list the summary of the bills - if (! empty($conf->facture->enabled) && $user->rights->facture->lire) + + // list the summary of the propals + if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $facturestatic=new Facture($db); + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + $propalstatic=new Propal($db); - // part 1 - $cachedir = DOL_DATA_ROOT.'/facture/temp'; - $filename = '/boxactivity-invoice'.$fileid; + $cachedir = DOL_DATA_ROOT.'/propale/temp'; + $filename = '/boxactivity-propal'.$fileid; + $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); + $data = array(); + if ($refresh) + { + $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ")"; + $sql.= " WHERE p.entity = ".$conf->entity; + $sql.= " AND p.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'"; + $sql.= " AND p.date_cloture IS NULL"; // just unclosed + $sql.= " GROUP BY p.fk_statut"; + $sql.= " ORDER BY p.fk_statut DESC"; - $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); - $data = array(); - if ($refresh) - { - $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; - $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= ")"; - $sql.= " WHERE f.entity = ".$conf->entity; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1"; - $sql.= " GROUP BY f.fk_statut"; - $sql.= " ORDER BY f.fk_statut DESC"; + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $j=0; - while ($j < $num) { - $data[$j]=$db->fetch_object($result); - $j++; - } - if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - dol_filecache($cachedir, $filename, $data); - } - $db->free($result); - } else { - dol_print_error($db); - } - } else { - $data = dol_readcachefile($cachedir, $filename); - } + $j=0; + while ($j < $num) { + $data[$j]=$db->fetch_object($result); + $j++; + } + if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { + dol_filecache($cachedir, $filename, $data); + } + $db->free($result); + } else { + dol_print_error($db); + } + } + else + { + $data = dol_readcachefile($cachedir, $filename); + } - $cumuldata=array_merge($cumuldata, $data); - if (! empty($data)) { - $j=0; - while ($line < count($cumuldata)) { - $billurl="viewstatut=2&paye=1&year=".$data[$j]->annee; - $this->info_box_contents[$line][0] = array( - 'td' => 'align="left" width="16"', - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - 'logo' => 'bill', - ); + $cumuldata=array_merge($cumuldata, $data); + if (! empty($data)) + { + $j=0; + while ($line < count($cumuldata)) + { + $this->info_box_contents[$line][0] = array( + 'td' => 'align="left" width="16"', + 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, + 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), + 'logo' => 'object_propal' + ); - $this->info_box_contents[$line][1] = array( - 'td' => '', - 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee, - ); + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), + ); - $this->info_box_contents[$line][2] = array( - 'td' => 'class="right"', - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), - 'text' => $data[$j]->nb, - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - ); + $this->info_box_contents[$line][2] = array( + 'td' => 'class="right"', + 'text' => $data[$j]->nb, + 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, + ); + $totalnb += $data[$j]->nb; - $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', - 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency) - ); + $this->info_box_contents[$line][3] = array( + 'td' => 'class="right"', + 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), + ); + $totalMnt += $data[$j]->Mnttot; + $this->info_box_contents[$line][4] = array( + 'td' => 'align="right" width="18"', + 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3), + ); - // We add only for the current year - if ($data[$j]->annee == date("Y")) { - $totalnb += $data[$j]->nb; - $totalMnt += $data[$j]->Mnttot; - } - $this->info_box_contents[$line][4] = array( - 'td' => 'align="right" width="18"', - 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3), - ); - $line++; - $j++; - } - if (count($data)==0) - $this->info_box_contents[$line][0] = array( - 'td' => 'align="center"', - 'text'=>$langs->trans("NoRecordedInvoices"), - ); - } - - // part 2 - $cachedir = DOL_DATA_ROOT.'/facture/temp'; - $filename = '/boxactivity-invoice2'.$fileid; - - $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); - - if ($refresh) { - $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_soc = s.rowid"; - $sql.= " AND paye=0"; - $sql.= " GROUP BY f.fk_statut"; - $sql.= " ORDER BY f.fk_statut DESC"; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $j=0; - while ($j < $num) { - $data[$j]=$db->fetch_object($result); - $j++; - } - if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - dol_filecache($cachedir, $filename, $data); - } - $db->free($result); - } else { - dol_print_error($db); - } - } else { - $data = dol_readcachefile($cachedir, $filename); - } - - $cumuldata=array_merge($cumuldata, $data); - if (! empty($data)) { - $j=0; - - while ($line < count($cumuldata)) { - $billurl="viewstatut=".$data[$j]->fk_statut."&paye=0"; - $this->info_box_contents[$line][0] = array( - 'td' => 'align="left" width="16"', - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - 'logo' => 'bill', - ); - - $this->info_box_contents[$line][1] = array( - 'td' => '', - 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), - ); - - $this->info_box_contents[$line][2] = array( - 'td' => 'class="right"', - 'text' => $data[$j]->nb, - 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", - ); - $totalnb += $data[$j]->nb; - $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', - 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), - ); - $totalMnt += $objp->Mnttot; - $this->info_box_contents[$line][4] = array( - 'td' => 'align="right" width="18"', - 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3), - ); - $line++; - $j++; - } - if ($num==0) - $this->info_box_contents[$line][0] = array( - 'td' => 'align="center"', - 'text'=>$langs->trans("NoRecordedInvoices"), - ); - } else { - $this->info_box_contents[0][0] = array( - 'td' => '', - 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), - ); - } + $line++; + $j++; + } + } } // list the summary of the orders @@ -295,12 +209,10 @@ class box_activity extends ModeleBoxes if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'"; - $sql.= " AND c.facture=0"; $sql.= " GROUP BY c.fk_statut"; $sql.= " ORDER BY c.fk_statut DESC"; $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); $j=0; @@ -359,94 +271,182 @@ class box_activity extends ModeleBoxes } } - // list the summary of the propals - if (! empty($conf->propal->enabled) && $user->rights->propale->lire) + + // list the summary of the bills + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { - include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; - $propalstatic=new Propal($db); + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $facturestatic=new Facture($db); - $cachedir = DOL_DATA_ROOT.'/propale/temp'; - $filename = '/boxactivity-propal'.$fileid; - $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); - $data = array(); - if ($refresh) - { - $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; - $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= ")"; - $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " AND p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'"; - $sql.= " AND p.date_cloture IS NULL"; // just unclosed - $sql.= " GROUP BY p.fk_statut"; - $sql.= " ORDER BY p.fk_statut DESC"; + // part 1 + $cachedir = DOL_DATA_ROOT.'/facture/temp'; + $filename = '/boxactivity-invoice'.$fileid; - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); + $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); + $data = array(); + if ($refresh) + { + $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ")"; + $sql.= " WHERE f.entity = ".$conf->entity; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " AND f.fk_soc = s.rowid"; + $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1"; + $sql.= " GROUP BY f.fk_statut"; + $sql.= " ORDER BY f.fk_statut DESC"; - $j=0; - while ($j < $num) { - $data[$j]=$db->fetch_object($result); - $j++; - } - if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - dol_filecache($cachedir, $filename, $data); - } - $db->free($result); - } else { - dol_print_error($db); - } - } - else - { - $data = dol_readcachefile($cachedir, $filename); - } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $j=0; + while ($j < $num) { + $data[$j]=$db->fetch_object($result); + $j++; + } + if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { + dol_filecache($cachedir, $filename, $data); + } + $db->free($result); + } else { + dol_print_error($db); + } + } else { + $data = dol_readcachefile($cachedir, $filename); + } - $cumuldata=array_merge($cumuldata, $data); - if (! empty($data)) - { - $j=0; - while ($line < count($cumuldata)) - { - $this->info_box_contents[$line][0] = array( - 'td' => 'align="left" width="16"', - 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, - 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), - 'logo' => 'object_propal' - ); + $cumuldata=array_merge($cumuldata, $data); + if (! empty($data)) { + $j=0; + while ($line < count($cumuldata)) { + $billurl="search_status=2&paye=1&year=".$data[$j]->annee; + $this->info_box_contents[$line][0] = array( + 'td' => 'align="left" width="16"', + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + 'logo' => 'bill', + ); - $this->info_box_contents[$line][1] = array( - 'td' => '', - 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), - ); + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee, + ); - $this->info_box_contents[$line][2] = array( - 'td' => 'class="right"', - 'text' => $data[$j]->nb, - 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), - 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, - ); - $totalnb += $data[$j]->nb; + $this->info_box_contents[$line][2] = array( + 'td' => 'class="right"', + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0), + 'text' => $data[$j]->nb, + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + ); - $this->info_box_contents[$line][3] = array( - 'td' => 'class="right"', - 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), - ); - $totalMnt += $data[$j]->Mnttot; - $this->info_box_contents[$line][4] = array( - 'td' => 'align="right" width="18"', - 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3), - ); + $this->info_box_contents[$line][3] = array( + 'td' => 'class="right"', + 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency) + ); - $line++; - $j++; - } - } + // We add only for the current year + if ($data[$j]->annee == date("Y")) { + $totalnb += $data[$j]->nb; + $totalMnt += $data[$j]->Mnttot; + } + $this->info_box_contents[$line][4] = array( + 'td' => 'align="right" width="18"', + 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3), + ); + $line++; + $j++; + } + if (count($data)==0) + $this->info_box_contents[$line][0] = array( + 'td' => 'align="center"', + 'text'=>$langs->trans("NoRecordedInvoices"), + ); + } + + // part 2 + $cachedir = DOL_DATA_ROOT.'/facture/temp'; + $filename = '/boxactivity-invoice2'.$fileid; + + $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); + + if ($refresh) { + $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_soc = s.rowid"; + $sql.= " AND paye=0"; + $sql.= " GROUP BY f.fk_statut"; + $sql.= " ORDER BY f.fk_statut DESC"; + + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $j=0; + while ($j < $num) { + $data[$j]=$db->fetch_object($result); + $j++; + } + if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { + dol_filecache($cachedir, $filename, $data); + } + $db->free($result); + } else { + dol_print_error($db); + } + } else { + $data = dol_readcachefile($cachedir, $filename); + } + + $cumuldata=array_merge($cumuldata, $data); + if (! empty($data)) { + $j=0; + + while ($line < count($cumuldata)) { + $billurl="search_status=".$data[$j]->fk_statut."&paye=0"; + $this->info_box_contents[$line][0] = array( + 'td' => 'align="left" width="16"', + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + 'logo' => 'bill', + ); + + $this->info_box_contents[$line][1] = array( + 'td' => '', + 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), + ); + + $this->info_box_contents[$line][2] = array( + 'td' => 'class="right"', + 'text' => $data[$j]->nb, + 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0), + 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills", + ); + $totalnb += $data[$j]->nb; + $this->info_box_contents[$line][3] = array( + 'td' => 'class="right"', + 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), + ); + $totalMnt += $objp->Mnttot; + $this->info_box_contents[$line][4] = array( + 'td' => 'align="right" width="18"', + 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3), + ); + $line++; + $j++; + } + if ($num==0) + $this->info_box_contents[$line][0] = array( + 'td' => 'align="center"', + 'text'=>$langs->trans("NoRecordedInvoices"), + ); + } else { + $this->info_box_contents[0][0] = array( + 'td' => '', + 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql), + ); + } } // Add the sum in the bottom of the boxes diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index cb34f60291f..db1ba19aa6e 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -154,7 +154,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VEF' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'VND', '[8363]', 1, 'Viet Nam Dong'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XAF', NULL, 1, 'Communaute Financiere Africaine (BEAC) CFA Franc'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XOF', NULL, 1, 'Communaute Financiere Africaine (BCEAO) Franc'); -INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', '[70]', 1, 'Franc pacifique (XPF)'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XPF', '[70]', 1, 'Franc CFP'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'YER', '[65020]', 1, 'Yemen Rial'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ZWD', '[90,36]', 1, 'Zimbabwe Dollar'); From ab37794f616a4f8df4a5a5ba5d6b308b55015b1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 19:34:26 +0200 Subject: [PATCH 0115/1137] Fix text --- htdocs/core/class/html.formmail.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index f2e861ea932..4ec9c91aa80 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -473,7 +473,7 @@ class FormMail extends Form $out.= ' <'.$this->tomail.'>'; if ($this->withtofree) { - $out.= '
        '.$langs->trans("or").' withto) :"").'" />'; + $out.= '
        '.$langs->trans("and").' withto) :"").'" />'; } } else @@ -489,7 +489,7 @@ class FormMail extends Form } if (! empty($this->withto) && is_array($this->withto)) { - if (! empty($this->withtofree)) $out.= " ".$langs->trans("or")." "; + if (! empty($this->withtofree)) $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withto; foreach($tmparray as $key => $val) @@ -522,7 +522,7 @@ class FormMail extends Form $out.= 'withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />'; if (! empty($this->withtocc) && is_array($this->withtocc)) { - $out.= " ".$langs->trans("or")." "; + $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtocc; foreach($tmparray as $key => $val) @@ -551,7 +551,7 @@ class FormMail extends Form $out.= 'withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; if (! empty($this->withtoccc) && is_array($this->withtoccc)) { - $out.= " ".$langs->trans("or")." "; + $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time $tmparray = $this->withtoccc; foreach($tmparray as $key => $val) From 9f5718f00a5842008b923298d82cdef24ac54f6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2017 19:38:06 +0200 Subject: [PATCH 0116/1137] Fix php unit --- htdocs/admin/dolistore/class/dolistore.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 482bd124a40..5e0aa546cc0 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -306,11 +306,11 @@ class DolistoreModel function get_previous_link($text = '<<') { - return "$text"; + return ''.$text.''; } function get_next_link($text = '>>') { - return "$text"; + return ''.$text.''; } } From 7da1b215f36508062c22d12559f8297d2a6c7a1b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Aug 2017 21:01:14 +0200 Subject: [PATCH 0117/1137] Fix: avoid error "A non-numeric value encountered" --- htdocs/compta/bank/document.php | 16 +++++++--------- htdocs/core/class/dolgraph.class.php | 5 +++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 084cddf51cd..befccb3c4d3 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -3,7 +3,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * * 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 @@ -62,9 +62,7 @@ $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST("page", 'int'); -if ($page == -1) { - $page = 0; -} +if (empty($page) || $page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -122,21 +120,21 @@ if ($id > 0 || !empty($ref)) { $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
        '; print '
        '; - + print ''; print ''; print ''; print "
        ' . $langs->trans("NbOfAttachedFiles") . '' . count($filearray) . '
        ' . $langs->trans("TotalSizeOfAttachedFiles") . '' . $totalsize . ' ' . $langs->trans("bytes") . '
        \n"; print '
        '; - + dol_fiche_end(); - + $modulepart = 'bank'; $permission = $user->rights->banque->modifier; $permtoedit = $user->rights->banque->modifier; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 4fad0149a5b..d603d1b6cc1 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -25,7 +25,7 @@ /** * Class to build graphs. - * Usage is: + * Usage is: * $dolgraph=new DolGraph(); * $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'
        '.$langs->transnoentities('Tracking_IndicatorDefGraph').'%'); * $dolgraph->SetMaxValue(50); @@ -570,6 +570,7 @@ class DolGraph function GetFloorMinValue() { $min = $this->GetMinValueInData(); + if ($min == '') $min=0; if ($min != 0) $min--; $size=dol_strlen(abs(floor($min))); $factor=1; @@ -868,7 +869,7 @@ class DolGraph return; } $this->stringtoshow.='
        '."\n"; - + $this->stringtoshow.=''."\n"; + } + + print '
        '; + print ''; + print ''; + + dol_fiche_head($head, 'common_emailing', '', -1); + + print $langs->trans("EMailsDesc")."
        \n"; + print "
        \n"; + + + clearstatcache(); + $var=true; + + print ''; + print ''; + + // Method + + print ''; + + // Host server + + print ''; + + // Port + + print ''; + + // ID + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + + $mainstmpid=(! empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING)?$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING:''); + print ''; + } + + // PW + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + + $mainsmtppw=(! empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING)?$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING:''); + print ''; + } + + // TLS + + print ''; + + // STARTTLS + + print ''; + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '.$langs->trans("MAIN_MAIL_SENDMODE").''; + + // SuperAdministrator access only + if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) + { + print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING',$listofmethods,$conf->global->MAIN_MAIL_SENDMODE_EMAILING); + } + else + { + $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; + if (empty($text)) $text = $langs->trans("Undefined"); + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print ''; + } + print '
        '; + if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') + { + print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); + print ''; + print $langs->trans("SeeLocalSendMailSetup"); + } + else + { + $mainserver = (! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:''); + $smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined"); + if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); + else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver); + print ''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) + { + print ''; + print ''; + print ''.$langs->trans("SeeLocalSendMailSetup").''; + } + else + { + $text = ! empty($mainserver) ? $mainserver : $smtpserver; + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print ''; + } + } + print '
        '; + if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') + { + print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); + print ''; + print $langs->trans("SeeLocalSendMailSetup"); + } + else + { + $mainport = (! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); + $smtpport = ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined"); + if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); + else print $langs->trans("MAIN_MAIL_SMTP_PORT",$smtpport); + print ''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) + { + print ''; + print ''; + print ''.$langs->trans("SeeLocalSendMailSetup").''; + } + else + { + $text = (! empty($mainport) ? $mainport : $smtpport); + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print ''; + } + } + print '
        '.$langs->trans("MAIN_MAIL_SMTPS_ID").''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) + { + print ''; + } + else + { + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING,$htmltext,1,'superadmin'); + print ''; + } + print '
        '.$langs->trans("MAIN_MAIL_SMTPS_PW").''; + // SuperAdministrator access only + if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) + { + print ''; + } + else + { + $htmltext = $langs->trans("ContactSuperAdminForChange"); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING,$htmltext,1,'superadmin'); + print ''; + } + print '
        '.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + if (function_exists('openssl_open')) + { + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING:0),1); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
        '.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) + { + if (function_exists('openssl_open')) + { + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING:0),1); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
        '; + + dol_fiche_end(); + + print '
        '; + print ''; + print '     '; + print ''; + print '
        '; + + print '
        '; +} +else +{ + dol_fiche_head($head, 'common_emailing', '', -1); + + print $langs->trans("EMailsDesc")."
        \n"; + print "
        \n"; + + + $var=true; + + print ''; + print ''; + + // Method + + print ''; + + if (! empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + // Host server + + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) + { + print ''; + } + else + { + print ''; + } + + // Port + + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail')) + { + print ''; + } + else + { + print ''; + } + + // SMTPS ID + + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + print ''; + } + + // SMTPS PW + + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + print ''; + } + + // TLS + + print ''; + + // STARTTLS + + print ''; + } + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '.$langs->trans("MAIN_MAIL_SENDMODE").''; + $text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; + if (empty($text)) $text=$langs->trans("Undefined").img_warning(); + print $text; + print '
        '.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
        '.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:'').'
        '.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
        '.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:'').'
        '.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING.'
        '.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
        '.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + if (function_exists('openssl_open')) + { + print yn($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
        '.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) + { + if (function_exists('openssl_open')) + { + print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING); + } + else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } + else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
        '; + + dol_fiche_end(); + + + if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) + { + print '
        '; + /* + // Warning 1 + if ($linuxlike) + { + $sendmailoption=ini_get('mail.force_extra_parameters'); + if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) + { + print info_admin($langs->trans("SendmailOptionNotComplete")); + } + }*/ + // Warning 2 + print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA")); + } + + + // Boutons actions + print '
        '; + + print ''.$langs->trans("Modify").''; + + if (! empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || ! $linuxlike) + { + if (function_exists('fsockopen') && $port && $server) + { + print ''.$langs->trans("DoTestServerAvailability").''; + } + } + else + { + print ''.$langs->trans("DoTestServerAvailability").''; + } + + print ''.$langs->trans("DoTestSend").''; + + if (! empty($conf->fckeditor->enabled)) + { + print ''.$langs->trans("DoTestSendHTML").''; + } + } + + print '
        '; + + + if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && ! in_array($action, array('testconnect', 'test', 'testhtml'))) + { + $text = $langs->trans("WarningPHPMail"); + print info_admin($text); + } + + // Run the test to connect + if ($action == 'testconnect') + { + print load_fiche_titre($langs->trans("DoTestServerAvailability")); + + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mail = new CMailFile('','','',''); + $result=$mail->check_server_port($server,$port); + if ($result) print '
        '.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'
        '; + else + { + $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port); + + if ($mail->error) { + $errormsg .= ' - '.$mail->error; + } + + setEventMessages($errormsg, null, 'errors'); + } + print '
        '; + } + + // Show email send test form + if ($action == 'test' || $action == 'testhtml') + { + print '
        '; + print load_fiche_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend")); + + dol_fiche_head(''); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->trackid=(($action == 'testhtml')?"testhtml":"test"); + $formmail->withfromreadonly=0; + $formmail->withsubstit=0; + $formmail->withfrom=1; + $formmail->witherrorsto=1; + $formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1)); + $formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty + $formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty + $formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test")); + $formmail->withtopicreadonly=0; + $formmail->withfile=2; + $formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->transnoentities("PredefinedMailTestHtml"):$langs->transnoentities("PredefinedMailTest"))); + $formmail->withbodyreadonly=0; + $formmail->withcancel=1; + $formmail->withdeliveryreceipt=1; + $formmail->withfckeditor=($action == 'testhtml'?1:0); + $formmail->ckeditortoolbar='dolibarr_mailings'; + // Tableau des substitutions + $formmail->substit=$substitutionarrayfortest; + // Tableau des parametres complementaires du post + $formmail->param["action"]="send"; + $formmail->param["models"]="body"; + $formmail->param["mailid"]=0; + $formmail->param["returnurl"]=$_SERVER["PHP_SELF"]; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + } + + print $formmail->get_form('addfile','removefile'); + + dol_fiche_end(); + } +} + + +llxFooter(); + +$db->close(); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index dabc0f5f730..f0cbb91c6c3 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -410,6 +410,14 @@ $head[$h][1] = $langs->trans("OutGoingEmailSetup"); $head[$h][2] = 'common'; $h++; +if ($conf->mailing->enabled) +{ + $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; + $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing"); + $head[$h][2] = 'common_emailing'; + $h++; +} + $head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; $head[$h][1] = $langs->trans("DictionaryEMailTemplates"); $head[$h][2] = 'templates'; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 1998808bf11..58bc00e3f0f 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -345,7 +345,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO } // Send mail - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid); + if (empty($sendcontext)) $sendcontext = 'standard'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'',$sendcontext); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 3b3efe96fb0..b05b8a162a1 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -38,8 +38,7 @@ class CMailFile { public $sendcontext; public $sendmode; - public $sendsetup; - + var $subject; // Topic: Subject of email var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '' or 'John Doe ' or ''). Note that with gmail smtps, value here is forced by google to account (but not the reply-to). // Sender: Who send the email ("Sender" has sent emails on behalf of "From"). @@ -115,14 +114,15 @@ class CMailFile global $conf, $dolibarr_main_data_root; $this->sendcontext = $sendcontext; - + + // Define this->sendmode $this->sendmode = ''; - if ($this->sendcontext == 'emailing') $this->sendmode = $conf->global->EMAILING_MAIL_SENDMODE; + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + $this->sendmode = $conf->global->MAIN_MAIL_SENDMODE_EMAILING; + } if (empty($this->sendmode)) $this->sendmode=$conf->global->MAIN_MAIL_SENDMODE; if (empty($this->sendmode)) $this->sendmode='mail'; - - $this->sendsetup = array(); - // We define end of line (RFC 821). $this->eol="\r\n"; @@ -145,7 +145,7 @@ class CMailFile $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars) dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG); - dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: subject=".$subject.", deliveryreceipt=".$deliveryreceipt.", msgishtml=".$msgishtml, LOG_DEBUG); if (empty($subject)) { @@ -157,7 +157,7 @@ class CMailFile { dol_syslog("CMailFile::CMailfile: Try to send an email with empty body"); $msg='.'; // Avoid empty message (with empty message conten show a multipart structure) - } + } // Detect if message is HTML (use fast method) if ($msgishtml == -1) @@ -230,7 +230,7 @@ class CMailFile $this->addr_bcc = $addr_bcc; $this->deliveryreceipt = $deliveryreceipt; $this->trackid = $trackid; - + $smtp_headers = $this->write_smtpheaders(); if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n @@ -339,7 +339,7 @@ class CMailFile $this->phpmailer->SetReplyTo($this->getValidAddress($from,0,1)); // Set property with this->phpmailer->setReplyTo after constructor if you want to use another value than the From // TODO Add trackid into smtp header // TODO if (! empty($moreinheader)) ... - + if (! empty($this->html)) { if (!empty($css)) @@ -487,9 +487,7 @@ class CMailFile { require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); - $hookmanager->initHooks(array( - 'maildao' - )); + $hookmanager->initHooks(array('maildao')); $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (! empty($reshook)) { @@ -532,6 +530,22 @@ class CMailFile return false; } + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS'; + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING'; + } + // Action according to choosed sending method if ($this->sendmode == 'mail') { @@ -548,9 +562,9 @@ class CMailFile @ini_set('sendmail_from',$this->getValidAddress($this->addr_from,2)); } - // Forcage parametres - if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_set('SMTP',$conf->global->MAIN_MAIL_SMTP_SERVER); - if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_set('smtp_port',$conf->global->MAIN_MAIL_SMTP_PORT); + // Force parameters + if (! empty($conf->global->$keyforsmtpserver)) ini_set('SMTP',$conf->global->$keyforsmtpserver); + if (! empty($conf->global->$keyforsmtpport)) ini_set('smtp_port',$conf->global->$keyforsmtpport); $dest=$this->getValidAddress($this->addr_to,2); if (! $dest) @@ -610,9 +624,9 @@ class CMailFile @ini_restore('sendmail_from'); } - // Forcage parametres - if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_restore('SMTP'); - if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_restore('smtp_port'); + // Restore parameters + if (! empty($conf->global->$keyforsmtpserver)) ini_restore('SMTP'); + if (! empty($conf->global->$keyforsmtpport)) ini_restore('smtp_port'); } else if ($this->sendmode == 'smtps') { @@ -622,28 +636,30 @@ class CMailFile $this->smtps->setTransportType(0); // Only this method is coded in SMTPs library // Clean parameters - if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP'); - if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); - - // TODO Manage alternative parameters + if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP'); + if (empty($conf->global->$keyforsmtpport)) $conf->global->$keyforsmtpport=ini_get('smtp_port'); // If we use SSL/TLS - $server=$conf->global->MAIN_MAIL_SMTP_SERVER; - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server; - $port=$conf->global->MAIN_MAIL_SMTP_PORT; + $server=$conf->global->$keyforsmtpserver; + $secure=''; + if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $secure='ssl'; + if (! empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) $secure='tls'; + $server=($secure?$secure.'://':'').$server; + + $port=$conf->global->$keyforsmtpport; $this->smtps->setHost($server); $this->smtps->setPort($port); // 25, 465...; $loginid=''; $loginpass=''; - if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) + if (! empty($conf->global->$keyforsmtpid)) { - $loginid = $conf->global->MAIN_MAIL_SMTPS_ID; + $loginid = $conf->global->$keyforsmtpid; $this->smtps->setID($loginid); } - if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) + if (! empty($conf->global->$keyforsmtppw)) { - $loginpass = $conf->global->MAIN_MAIL_SMTPS_PW; + $loginpass = $conf->global->$keyforsmtppw; $this->smtps->setPW($loginpass); } @@ -651,14 +667,14 @@ class CMailFile $from=$this->smtps->getFrom('org'); if (! $from) { - $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT."
        Sender address '$from' invalid"; + $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
        Sender address '$from' invalid"; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res=false; } $dest=$this->smtps->getTo(); if (! $dest) { - $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->MAIN_MAIL_SMTP_PORT."
        Recipient address '$dest' invalid"; + $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
        Recipient address '$dest' invalid"; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res=false; } @@ -666,7 +682,7 @@ class CMailFile if ($res) { if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->smtps->setDebug(true); - + $result=$this->smtps->sendMsg(); //print $result; @@ -684,26 +700,24 @@ class CMailFile } else if ($this->sendmode == 'swiftmailer') { - // Use Swift Mailer library // ------------------------------------------ require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; - // Forcage parametres - if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP'); - if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); + // Clean parameters + if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP'); + if (empty($conf->global->$keyforsmtpport)) $conf->global->$keyforsmtpport=ini_get('smtp_port'); // If we use SSL/TLS - $server=$conf->global->MAIN_MAIL_SMTP_SERVER; + $server=$conf->global->$keyforsmtpserver; $secure=''; - //var_dump(stream_get_transports()); - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl'; - if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls'; + if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $secure='ssl'; + if (! empty($conf->global->$keyforstarttls) && function_exists('openssl_open')) $secure='tls'; - $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure); + $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->$keyforsmtpport, $secure); - if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID); - if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW); + if (! empty($conf->global->$keyforsmtpid)) $this->transport->setUsername($conf->global->$keyforsmtpid); + if (! empty($conf->global->$keyforsmtppw)) $this->transport->setPassword($conf->global->$keyforsmtppw); //$smtps->_msgReplyTo = 'reply@web.com'; // Create the Mailer using your created Transport @@ -1026,7 +1040,7 @@ class CMailFile $out.= $this->eol; $out.= "--" . $this->related_boundary . $this->eol; } - + if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part { $out.= "Content-Type: multipart/alternative; boundary=\"".$this->alternative_boundary."\"".$this->eol; @@ -1036,7 +1050,7 @@ class CMailFile $out.= $this->eol.$strContentAltText.$this->eol; $out.= "--" . $this->alternative_boundary . $this->eol; } - + $out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol; $out.= $this->eol.$strContent.$this->eol; @@ -1154,13 +1168,30 @@ class CMailFile function check_server_port($host,$port) { global $conf; + $_retVal=0; $timeout=5; // Timeout in seconds if (function_exists('fsockopen')) { + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS'; + if ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') + { + $keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING'; + $keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING'; + $keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING'; + $keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING'; + $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING'; + $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING'; + } + // If we use SSL/TLS - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host; + if (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $host='ssl://'.$host; // tls smtp start with no encryption //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; @@ -1355,7 +1386,7 @@ class CMailFile if ($email) { $i++; - + $newemail=''; if ($format == 4) { diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index c92558bf1d3..cfaa88363a4 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -358,8 +358,11 @@ class SMTPs // This is done here because '@fsockopen' will not give me this // information if it failes to connect because it can't find the HOST $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host=preg_replace('@tls://@i','',$host); // Remove prefix // @CHANGE LDR include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -373,7 +376,7 @@ class SMTPs { //See if we can connect to the SMTP server if ($this->socket = @fsockopen( - $this->getHost(), // Host to 'hit', IP or domain + preg_replace('@tls://@i','',$this->getHost()), // Host to 'hit', IP or domain $this->getPort(), // which Port number to use $this->errno, // actual system level error $this->errstr, // and any text that goes with the error @@ -416,16 +419,17 @@ class SMTPs // This improvment as provided by 'SirSir' to // accomodate both SMTP AND ESMTP capable servers $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix - if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)) - { - $host=preg_replace('@tls://@i','',$host); // Remove prefix - $host='tls://'.$host; - } + $host=preg_replace('@tls://@i','',$host); // Remove prefix + + if ($usetls) $host='tls://'.$host; + if ( $_retVal = $this->socket_send_str('EHLO ' . $host, '250') ) { - if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)) + if ($usetls) { /* The following dialog illustrates how a client and server can start a TLS STARTTLS session @@ -443,7 +447,7 @@ class SMTPs // Second pass EHLO C: EHLO client-domain.com S: 250-server-domain.com - S: 250 AUTH LOGIN + S: 250 AUTH LOGIN C: socket_send_str('STARTTLS', 220)) @@ -456,7 +460,7 @@ class SMTPs $this->_setErr(132, 'STARTTLS connection failed.'); return $_retVal; } - // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time + // Most server servers expect a 2nd pass of EHLO after TLS is established to get another time // the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS. if (!$_retVal = $this->socket_send_str('EHLO '.$host, '250')) { @@ -514,8 +518,12 @@ class SMTPs { // Send the RFC821 specified HELO. $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host=preg_replace('@tls://@i','',$host); // Remove prefix + $_retVal = $this->socket_send_str('HELO ' . $host, '250'); } @@ -1237,8 +1245,11 @@ class SMTPs */ $host=$this->getHost(); + $usetls = preg_match('@tls://@i',$host); + $host=preg_replace('@tcp://@i','',$host); // Remove prefix $host=preg_replace('@ssl://@i','',$host); // Remove prefix + $host=preg_replace('@tls://@i','',$host); // Remove prefix $host=dol_getprefix('email'); diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 1e4f1446fa7..a78b7bbc6c8 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -156,4 +156,7 @@ NoContactWithCategoryFound=No contact/address with a category found NoContactLinkedToThirdpartieWithCategoryFound=No contact/address with a category found OutGoingEmailSetup=Outgoing email setup InGoingEmailSetup=Incoming email setup +OutGoingEmailSetupForEmailing=Outgoing email setup (for mass emailing) +DefaultOutgoingEmailSetup=Default outgoing email setup + From 982fca541d3d693c88063d4c129c095bb1a3e8e3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 24 Aug 2017 08:33:40 +0200 Subject: [PATCH 0120/1137] Fix: (Agenda) Allowed if link to third party is empty --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index f55f60c7f69..57eefa49018 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -375,7 +375,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh $check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object - $checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...). + $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet','project'); // Test for project object $checktask = array('projet_task'); $nocheck = array('barcode','stock','fournisseur'); // No test From 7da6f93d7e5d972fc693c6c6431d9aef63f3d45e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Aug 2017 13:23:15 +0200 Subject: [PATCH 0121/1137] FIX select of category FIX pb with extrafield list and key '0' --- htdocs/core/class/commonobject.class.php | 12 +++++ htdocs/core/class/extrafields.class.php | 18 ++++---- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/install/mysql/migration/repair.sql | 3 +- htdocs/langs/en_US/admin.lang | 10 ++--- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/societe/list.php | 45 +++++++++++-------- 8 files changed, 57 insertions(+), 37 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0693b3dd336..50ccf362de6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4352,6 +4352,12 @@ abstract class CommonObject $this->array_options[$key] = null; } break; + /*case 'select': // Not required, we chosed value='0' for undefined values + if ($value=='-1') + { + $this->array_options[$key] = null; + } + break;*/ case 'price': $this->array_options[$key] = price2num($this->array_options[$key]); break; @@ -4485,6 +4491,12 @@ abstract class CommonObject $this->array_options["options_".$key] = null; } break; + /*case 'select': // Not required, we chosed value='0' for undefined values + if ($value=='-1') + { + $this->array_options[$key] = null; + } + break;*/ case 'price': $this->array_options["options_".$key] = price2num($this->array_options["options_".$key]); break; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 3fcb909fc51..a66648df2c2 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -348,7 +348,7 @@ class ExtraFields $sql .= " " . $user->id . ","; $sql .= "'" . $this->db->idate(dol_now()) . "'"; $sql.=')'; - + dol_syslog(get_class($this)."::create_label", LOG_DEBUG); if ($this->db->query($sql)) { @@ -721,8 +721,8 @@ class ExtraFields { $array_name_label[$tab->name]=$tab->label; } - - + + // Old usage $this->attribute_type[$tab->name]=$tab->type; @@ -740,8 +740,8 @@ class ExtraFields $this->attribute_list[$tab->name]=$tab->list; $this->attribute_hidden[$tab->name]=$tab->ishidden; $this->attribute_entityid[$tab->name]=$tab->entity; - - + + // New usage $this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type; @@ -759,8 +759,8 @@ class ExtraFields $this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list; $this->attributes[$tab->elementtype]['ishidden'][$tab->name]=$tab->ishidden; $this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity; - - + + if (!empty($conf->multicompany->enabled)) { $sql_entity_name='SELECT label FROM '.MAIN_DB_PREFIX.'entity WHERE rowid='.$tab->entity; $resql_entity_name=$this->db->query($sql_entity_name); @@ -944,10 +944,10 @@ class ExtraFields $out.=''; foreach ($param['options'] as $key => $val) { - if ($key == '') continue; + if ((string) $key == '') continue; list($val, $parent) = explode('|', $val); $out.='
        "; + print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print "'; $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); print $taskstatic->getNomUrl(1,'withproject'); print ''; + $thirdpartystatic->id=$lines[$i]->socid; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + print $thirdpartystatic->getNomUrl(1, 'project', 10); + print '"; for ($k = 0 ; $k < $level ; $k++) print "   "; @@ -654,21 +669,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); print ""; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print "'; - $thirdpartystatic->id=$lines[$i]->socid; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project', 10); - print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); @@ -745,7 +745,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr // Warning print ''; if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); - else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $langs->transnoentitiesnoconv("AssignTaskToUser", '...'))); + else if ($disabledtask) + { + $titleassigntask = $langs->trans("AssignTaskToMe"); + if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...'); + + print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask)); + } print '
        '; + print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print "'; + $thirdpartystatic->id=$lines[$i]->thirdparty_id; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + print $thirdpartystatic->getNomUrl(1, 'project'); + print ''; $taskstatic->id=$lines[$i]->id; @@ -864,26 +891,6 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); print "'; - $projectstatic->id=$lines[$i]->fk_project; - $projectstatic->ref=$lines[$i]->projectref; - $projectstatic->title=$lines[$i]->projectlabel; - $projectstatic->public=$lines[$i]->public; - $projectstatic->thirdparty_name=$lines[$i]->thirdparty_name; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print "'; - $thirdpartystatic->id=$lines[$i]->thirdparty_id; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project'); - print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); @@ -961,7 +968,13 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ // Warning print ''; if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); - else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $langs->transnoentitiesnoconv("AssignTaskToUser", '...'))); + else if ($disabledtask) + { + $titleassigntask = $langs->trans("AssignTaskToMe"); + if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...'); + + print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask)); + } print '
        '."\n"; print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) print ''; +print ''; +print ''; print ''; print ''; print ''; @@ -458,13 +458,13 @@ print ''; print "\n"; print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) { print ''; } +print ''; +print ''; print ''; print ''; /*print ''; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index b4fcd68a3c9..01e4b71eda8 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -434,10 +434,10 @@ print '
        '; print '
        '.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("ProjectRef").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").'
        '."\n"; print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ''; +print ''; +print ''; print ''; print ''; print ''; @@ -454,13 +454,13 @@ print ''; print "\n"; print ''; -print ''; -print ''; print ''; if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) { print ''; } +print ''; +print ''; print ''; print ''; /*print ''; From 99a27162fb2d07dbbfb8389035a84729fd89ada8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Aug 2017 18:28:03 +0200 Subject: [PATCH 0130/1137] Complete module template --- htdocs/langs/en_US/modulebuilder.lang | 1 + htdocs/modulebuilder/index.php | 60 ++++++++++++- .../template/class/actions_mymodule.class.php | 84 +++++++++++++++---- .../template/core/boxes/README.md | 1 + .../core/modules/modMyModule.class.php | 9 +- .../template/core/triggers/README.md | 1 + 6 files changed, 135 insertions(+), 21 deletions(-) create mode 100644 htdocs/modulebuilder/template/core/boxes/README.md create mode 100644 htdocs/modulebuilder/template/core/triggers/README.md diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 62251069c08..7f986e036c1 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -40,6 +40,7 @@ PathToModuleDocumentation=Path to file of module/application documentation SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed. FileNotYetGenerated=File not yet generated SpecificationFile=File with business rules +LanguageFile=File for language ConfirmDeleteProperty=Are you sure you want to delete the property %s ? This will change code in PHP class but also remove column from table definition of object. NotNull=Not NULL SearchAll=Used for 'search all' diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 0ba9bbaa071..4ef05cb6e2b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -146,7 +146,10 @@ if ($dirins && $action == 'initmodule' && $modulename) 'MyModule'=>$modulename, 'MYMODULE'=>strtoupper($modulename), 'My module'=>$modulename, - 'htdocs/modulebuilder/template/'=>strtolower($modulename), + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template/'=>strtolower($modulename), '---Put here your own copyright and developer email---'=>dol_print_date($now,'%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') ); @@ -293,7 +296,10 @@ if ($dirins && $action == 'initobject' && $module && $objectname) 'MyModule'=>$module, 'MYMODULE'=>strtoupper($module), 'My module'=>$module, - 'htdocs/modulebuilder/template/'=>strtolower($modulename), + 'my module'=>$module, + 'mon module'=>$module, + 'Mon module'=>$module, + 'htdocs/modulebuilder/template/'=>strtolower($modulename), 'myobject'=>strtolower($objectname), 'MyObject'=>$objectname ); @@ -908,6 +914,11 @@ elseif (! empty($module)) $head2[$h][2] = 'specifications'; $h++; + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread?'@'.$dirread:''); + $head2[$h][1] = $langs->trans("Languages"); + $head2[$h][2] = 'languages'; + $h++; + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:''); $head2[$h][1] = $langs->trans("Objects"); $head2[$h][2] = 'objects'; @@ -1151,6 +1162,51 @@ elseif (! empty($module)) } } + if ($tab == 'languages') + { + if ($action != 'editfile' || empty($file)) + { + $langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$'); + + foreach ($langfiles as $langfile) + { + $pathtofile = $modulelowercase.'/langs/'.$langfile['relativename']; + print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
        '; + } + } + else + { + // Edit text language file + + //print $langs->trans("UseAsciiDocFormat").'
        '; + + $fullpathoffile=dol_buildpath($file, 0); + + $content = file_get_contents($fullpathoffile); + + // New module + print '
        '; + print ''; + print ''; + print ''; + print ''; + print ''; + + $doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%'); + print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'text')); + print '
        '; + print '
        '; + print ''; + print '   '; + print ''; + print '
        '; + + print ''; + } + } + if ($tab == 'objects') { $head3 = array(); diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php index b8b43f1359d..7b353113c00 100644 --- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php @@ -78,13 +78,9 @@ class ActionsMyModule $error = 0; // Error counter - /* - print_r($parameters); - print_r($object); - echo "action: " . $action; - */ - - if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2' + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2' + { } @@ -115,14 +111,9 @@ class ActionsMyModule $error = 0; // Error counter - /* - print_r($parameters); - print_r($object); - echo "action: " . $action; - */ - - if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2' - + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2' + { foreach($parameters['toselect'] as $objectid) { // Do action on each object id @@ -156,7 +147,8 @@ class ActionsMyModule $error = 0; // Error counter - if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext' + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2' { $this->resprints = ''; } @@ -171,4 +163,64 @@ class ActionsMyModule + /** + * Execute action + * + * @param array $parameters Array of parameters + * @param Object $object Object output on PDF + * @param string $action 'add', 'update', 'view' + * @return int <0 if KO, + * =0 if OK but we want to process standard actions too, + * >0 if OK and we want to replace standard actions. + */ + function beforePDFCreation($parameters, &$object, &$action) + { + global $langs,$conf; + global $hookmanager; + + $outputlangs=$langs; + + $ret=0; $deltemp=array(); + dol_syslog(get_class($this).'::executeHooks action='.$action); + + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2' + { + + } + + return $ret; + } + + /** + * Execute action + * + * @param array $parameters Array of parameters + * @param Object $pdfhandler PDF builder handler + * @param string $action 'add', 'update', 'view' + * @return int <0 if KO, + * =0 if OK but we want to process standard actions too, + * >0 if OK and we want to replace standard actions. + */ + function afterPDFCreation($parameters, &$pdfhandler, &$action) + { + global $langs,$conf; + global $hookmanager; + + $outputlangs=$langs; + + $ret=0; $deltemp=array(); + dol_syslog(get_class($this).'::executeHooks action='.$action); + + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2' + { + + } + + return $ret; + } + + /* Add here any other hooked methods... */ + } diff --git a/htdocs/modulebuilder/template/core/boxes/README.md b/htdocs/modulebuilder/template/core/boxes/README.md new file mode 100644 index 00000000000..b641e7136bc --- /dev/null +++ b/htdocs/modulebuilder/template/core/boxes/README.md @@ -0,0 +1 @@ +Directory where widgets files are stored. \ No newline at end of file diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 0806bcce8d9..a26f7148142 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -95,7 +95,7 @@ class modMyModule extends DolibarrModules 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) 'css' => array('/mymodule/css/mymodule.css.php'), // Set this to relative path of css file if module has its own css file 'js' => array('/mymodule/js/mymodule.js.php'), // Set this to relative path of js file if module must load a js on all pages - 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module. You can also set hook context 'all' + 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all' ); // Data directories to create when module is enabled. @@ -305,15 +305,18 @@ class modMyModule extends DolibarrModules */ public function init($options='') { - $sql = array(); - $this->_load_tables('/mymodule/sql/'); // Create extrafields include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); + //$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty'); //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'string', 1, 10, 'project'); + //$param=array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')); + //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'select', 1, 3, 'thirdparty', 0, 1, '', $param, 1); + + $sql = array(); return $this->_init($sql, $options); } diff --git a/htdocs/modulebuilder/template/core/triggers/README.md b/htdocs/modulebuilder/template/core/triggers/README.md new file mode 100644 index 00000000000..38d1b1d8961 --- /dev/null +++ b/htdocs/modulebuilder/template/core/triggers/README.md @@ -0,0 +1 @@ +Directory where triggers files are stored. \ No newline at end of file From 999ac8eccd54fe077bc25ab9ff2fd3ea8df15fc3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Aug 2017 23:49:33 +0200 Subject: [PATCH 0131/1137] Complete module template --- .../mailinglist_mymodule_myobject.modules.php | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php new file mode 100644 index 00000000000..b3f2a36efab --- /dev/null +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -0,0 +1,201 @@ + + * + * This file is an example to follow to add your own email selector inside + * the Dolibarr email tool. + * Follow instructions given in README file to know what to change to build + * your own emailing list selector. + * Code that need to be changed in this file are marked by "CHANGE THIS" tag. + */ + +include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; +dol_include_once("/mymodule/class/myobject.class.php"); + + +/** + * mailing_mailinglist_mymodule + */ +class mailing_mailinglist_mymodule_myobject extends MailingTargets +{ + // CHANGE THIS: Put here a name not already used + var $name='mailinglist_mymodule_myobject'; + // CHANGE THIS: Put here a description of your selector module + var $desc='My object emailing target selector'; + // CHANGE THIS: Set to 1 if selector is available for admin users only + var $require_admin=0; + + var $enabled=0; + var $require_module=array(); + var $picto='mymodule@mymodule'; + var $db; + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $conf; + + $this->db=$db; + if (is_array($conf->modules)) + { + $this->enabled=in_array('mymodule',$conf->modules); + } + } + + + /** + * Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings + * + * @return string Retourne zone select + */ + function formFilter() + { + global $langs; + $langs->load("members"); + + $form=new Form($this->db); + + $arraystatus=array(1=>'Option 1', 2=>'Option 2'); + + $s=''; + $s.=$langs->trans("Status").': '; + $s.=''; + $s.='
        '; + + return $s; + } + + + /** + * Renvoie url lien vers fiche de la source du destinataire du mailing + * + * @param int $id ID + * @return string Url lien + */ + function url($id) + { + return ''.img_object('',"generic").''; + } + + + /** + * This is the main function that returns the array of emails + * + * @param int $mailing_id Id of emailing + * @param array $filtersarray Requete sql de selection des destinataires + * @return int <0 if error, number of emails added if ok + */ + function add_to_target($mailing_id,$filtersarray=array()) + { + $target = array(); + $cibles = array(); + $j = 0; + + + $sql = " select rowid as id, email, firstname, lastname, plan, partner"; + $sql.= " from ".MAIN_DB_PREFIX."myobject"; + $sql.= " where email IS NOT NULL AND email != ''"; + if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'"; + $sql.= " ORDER BY email"; + + // Stocke destinataires dans cibles + $result=$this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + $i = 0; + + dol_syslog("mailinglist_mymodule_myobject.modules.php: mailing ".$num." targets found"); + + $old = ''; + while ($i < $num) + { + $obj = $this->db->fetch_object($result); + if ($old <> $obj->email) + { + $cibles[$j] = array( + 'email' => $obj->email, + 'name' => $obj->lastname, + 'id' => $obj->id, + 'firstname' => $obj->firstname, + 'other' => $obj->plan.';'.$obj->partner, + 'source_url' => $this->url($obj->id), + 'source_id' => $obj->id, + 'source_type' => 'dolicloud' + ); + $old = $obj->email; + $j++; + } + + $i++; + } + } + else + { + dol_syslog($this->db->error()); + $this->error=$this->db->error(); + return -1; + } + + // You must fill the $target array with record like this + // $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0'); + // ... + // $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n'); + + // Example: $target[0]=array('email'=>'myemail@mydomain.com','name'=>'Doe','firstname'=>'John'); + + // ----- Your code end here ----- + + return parent::add_to_target($mailing_id, $cibles); + } + + + /** + * On the main mailing area, there is a box with statistics. + * If you want to add a line in this report you must provide an + * array of SQL request that returns two field: + * One called "label", One called "nb". + * + * @return array + */ + function getSqlArrayForStats() + { + // CHANGE THIS: Optionnal + + //var $statssql=array(); + //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; + + return array(); + } + + + /** + * Return here number of distinct emails returned by your selector. + * For example if this selector is used to extract 500 different + * emails from a text file, this function must return 500. + * + * @param string $filter Filter + * @param string $option Options + * @return int Nb of recipients + */ + function getNbOfRecipients($filter=1,$option='') + { + $a=parent::getNbOfRecipients("select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''"); + + if ($a < 0 || $b < 0) return -1; + if ($option == '') return $a; + return ($a+$b); + } + +} + From 533881e620f500121580380f454f9a7e133a18c7 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 25 Aug 2017 11:58:34 +0200 Subject: [PATCH 0132/1137] Fix supplier prices not shown when best buy hidden only show value if item has supplier --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 73911588600..dd98a768c6b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -834,7 +834,7 @@ else print '
        '; - // Multicompany - if (! empty($conf->multicompany->enabled) && is_object($mc)) - { - if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) - { - print "".''; - print "\n"; - } - else - { - print ''; - } - } - // Accountancy code if ($conf->accounting->enabled) { @@ -1109,6 +1094,24 @@ if ($action == 'create' || $action == 'adduserldap') print ""; } + // Multicompany + // This is now done with hook formObjectOptions + /* + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) // condition must be same for create and edit mode + { + print "".''; + print "\n"; + } + else + { + print ''; + } + } + */ + // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1498,6 +1501,24 @@ else print ''; print "\n"; + // Multicompany + // This is now done with hook formObjectOptions (included into /core/tpl/extrafields_view.tpl.php) + /* + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print '\n"; + } + }*/ + // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -2392,6 +2413,25 @@ else print "\n"; } + // Multicompany + // This is now done with hook formObjectOptions + /* + // TODO check if user not linked with the current entity before change entity (thirdparty, invoice, etc.) !! + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print "".''; + print "\n"; + } + else + { + print ''; + } + } + */ + // Other attributes $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook From 98f5fbab5dbb11f6021f96d5746d8d146c2c34ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 13:50:45 +0200 Subject: [PATCH 0134/1137] Fix error on contact/address not linked on thirdparty --- htdocs/contact/agenda.php | 40 ++++++++++++++++----------------- htdocs/core/lib/company.lib.php | 26 ++++++++++----------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 7f35c71cd11..cc7f36261cc 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -211,7 +211,7 @@ else dol_fiche_head($head, 'agenda', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
        '; if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { @@ -223,42 +223,42 @@ else else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany"); } $morehtmlref.='
        '; - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref); - + print '
        '; - + print '
        '; - + $object->info($id); print dol_print_object_info($object, 1); - + print '
        '; - + print dol_fiche_end(); - + // Actions buttons - + $objcon=$object; $object->fetch_thirdparty(); $objthirdparty=$object->thirdparty; - + $out=''; $permok=$user->rights->agenda->myactions->create; if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; } - - + + print '
        '; - + if (! empty($conf->agenda->enabled)) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) @@ -270,22 +270,22 @@ else print ''.$langs->trans("AddAction").''; } } - + print '
        '; - + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) { $param='&id='.$id; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - - + + print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'',''); - + // List of all actions $filters=array(); $filters['search_agenda_label']=$search_agenda_label; - + show_actions_done($conf,$langs,$db,$objthirdparty,$object,0,$actioncode, '', $filters, $sortfield, $sortorder); } } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ae4dfe1c2e4..fe36e0e02f4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1043,7 +1043,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= global $param; // Check parameters - if (! is_object($filterobj)) dol_print_error('','BadParameter'); + if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('','BadParameter'); $out=''; $histo=array(); @@ -1061,24 +1061,24 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $sql.= " a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; - if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; - if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname"; - if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref"; + if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; + if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname"; + if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; - if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; - if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; - if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; + if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; + if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; + if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; $sql.= " WHERE u.rowid = a.fk_user_action"; $sql.= " AND a.entity IN (".getEntity('agenda').")"; - if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; - if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; - if (get_class($filterobj) == 'Adherent') + if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; + if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; + if (is_object($filterobj) && get_class($filterobj) == 'Adherent') { $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; } - if (get_class($filterobj) == 'CommandeFournisseur') + if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') { $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; @@ -1239,7 +1239,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $facturestatic=new Facture($db); $out.='
        '; - if ($objcon && get_class($objcon) == 'Contact' && get_class($filterobj) == 'Societe') + if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe') { $out.=''; } @@ -1247,7 +1247,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= { $out.=''; } - if (get_class($filterobj) == 'Societe') $out.=''; + if ($filterobj && get_class($filterobj) == 'Societe') $out.=''; $out.="\n"; From 7030d0d5962b3160b883589d554917b760b1a3a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 15:04:55 +0200 Subject: [PATCH 0135/1137] Add combo on ldap selection --- htdocs/user/card.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 7209b900378..f01915247bf 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -369,7 +369,7 @@ if (empty($reshook)) { $object->default_range = GETPOST('default_range'); $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat'); - + if (! empty($conf->multicompany->enabled)) { if (! empty($_POST["superadmin"])) @@ -718,6 +718,7 @@ if ($action == 'create' || $action == 'adduserldap') if (is_array($liste) && count($liste)) { print $form->selectarray('users', $liste, '', 1); + print ajax_combobox('users'); } print '
        "; } - + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { print ''; @@ -1125,7 +1126,7 @@ if ($action == 'create' || $action == 'adduserldap') print $form->selectarray('default_range', range(0, $maxRangeNum), $object->default_range); print ''; } - + // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1143,7 +1144,7 @@ if ($action == 'create' || $action == 'adduserldap') $doleditor=new DolEditor('note','','',120,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_3,'90%'); $doleditor->Create(); print "\n"; - + // Signature print ''; print ''; } - + // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -2428,14 +2429,14 @@ else print ''; - + print ''; print ''; } - + // Other attributes $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook From c9643109dff74491c6d7bd6df88b581161cef289 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 25 Aug 2017 16:21:34 +0200 Subject: [PATCH 0136/1137] Fix comment doc --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 581231ebefa..ddf813db30b 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1305,7 +1305,7 @@ class FactureLigneRec extends CommonInvoiceLine /** * Recupere les lignes de factures predefinies dans this->lines - * + * @param int $rowid * @return int 1 if OK, < 0 if KO */ function fetch($rowid) From 040071b07b20f9062740493a9eba2701de5b5d56 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 25 Aug 2017 16:25:40 +0200 Subject: [PATCH 0137/1137] Change copyright comment --- htdocs/compta/facture/admin/facture_rec_cust_extrafields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index c365f59ba37..1bc9272a32f 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Jean-Francois FERRY -* Copyright (C) 2017 ATM-CONSULTING +* Copyright (C) 2017 John BOTELLA * * 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 From 9d380a8b8acd5bc1cb4527d906d6c7195634e804 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 16:38:45 +0200 Subject: [PATCH 0138/1137] NEW Can edit the language into the email templates editor. --- htdocs/admin/mails_templates.php | 95 ++++++++++++---------- htdocs/core/class/html.formadmin.class.php | 7 +- 2 files changed, 54 insertions(+), 48 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index f0cbb91c6c3..5e309eab48c 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,6 +45,7 @@ $langs->load("errors"); $langs->load("admin"); $langs->load("main"); $langs->load("mails"); +$langs->load("languages"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); @@ -85,17 +86,17 @@ $tabsqlsort[25]="label ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[25]= "label,type_template,private,position,topic,content"; +$tabfield[25]= "label,type_template,lang,private,position,topic,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines'; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,lang,private,position,topic,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines'; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[25]= "label,type_template,private,position,topic,content"; +$tabfieldinsert[25]= "label,type_template,lang,private,position,topic,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines'; $tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays @@ -144,16 +145,16 @@ $sourceList=array(); // We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']" $elementList = array(); -if ($conf->propal->enabled) $elementList['propal_send']=$langs->trans('MailToSendProposal'); -if ($conf->commande->enabled) $elementList['order_send']=$langs->trans('MailToSendOrder'); -if ($conf->facture->enabled) $elementList['facture_send']=$langs->trans('MailToSendInvoice'); -if ($conf->expedition->enabled) $elementList['shipping_send']=$langs->trans('MailToSendShipment'); -if ($conf->ficheinter->enabled) $elementList['fichinter_send']=$langs->trans('MailToSendIntervention'); +if ($conf->propal->enabled) $elementList['propal_send']=$langs->trans('MailToSendProposal'); +if ($conf->commande->enabled) $elementList['order_send']=$langs->trans('MailToSendOrder'); +if ($conf->facture->enabled) $elementList['facture_send']=$langs->trans('MailToSendInvoice'); +if ($conf->expedition->enabled) $elementList['shipping_send']=$langs->trans('MailToSendShipment'); +if ($conf->ficheinter->enabled) $elementList['fichinter_send']=$langs->trans('MailToSendIntervention'); if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send']=$langs->trans('MailToSendSupplierRequestForQuotation'); -if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder'); -if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice'); -if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); -if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); +if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder'); +if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice'); +if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); +if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); $parameters=array('elementList'=>$elementList); $reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks @@ -204,7 +205,7 @@ if (empty($reshook)) if ($value == 'content') $value='content-'.$rowid; if ($value == 'content_lines') $value='content_lines-'.$rowid; - if (! isset($_POST[$value]) || $_POST[$value]=='') + if (! isset($_POST[$value]) || ($_POST[$value]=='' && $value!='lang')) { $ok=0; $fieldnamekey=$listfield[$f]; @@ -434,16 +435,13 @@ if ($action == 'delete') //var_dump($elementList); -$sql="SELECT rowid as rowid, label, type_template, private, position, topic, content_lines, content, active"; +$sql="SELECT rowid as rowid, label, type_template, lang, private, position, topic, content_lines, content, active"; $sql.=" FROM ".MAIN_DB_PREFIX."c_email_templates"; $sql.=" WHERE entity IN (".getEntity('email_template').")"; if ($search_label) $sql.=natural_search('label', $search_label); - -if ($search_country_id > 0) +if (empty($conf->global->MAIN_MULTILANGS)) { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; - else $sql.=" WHERE "; - $sql.= " c.rowid = ".$search_country_id; + $sql.= " AND (lang = '".$langs->defaultlang."' OR lang IS NULL)"; } if ($sortfield) @@ -469,21 +467,21 @@ $sql.=$db->plimit($listlimit+1,$offset); $fieldlist=explode(',',$tabfield[$id]); -print ''; -print ''; -print ''; - -print '
        '.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("ProjectRef").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").''; if ($obj->tobuy) { - if (($productFournList = $product_fourn->list_product_fournisseur_price($product_fourn->id)) > 0) + if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) { $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); print $form->textwithpicto(count($productFournList),$htmltext); From da34ea6b115f3a7116d5cc94ac7e7c56594fd274 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 13:25:34 +0200 Subject: [PATCH 0133/1137] FIX field entity "edit" and "view" was in hook but not "create". --- htdocs/user/card.php | 70 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a2938a89712..eeb1e898736 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1010,21 +1010,6 @@ if ($action == 'create' || $action == 'adduserldap') } print '
        '.$langs->trans("Entity").'".$mc->select_entities($conf->entity); - print "
        '.$langs->trans("Entity").'".$mc->select_entities($conf->entity); + print "
        '.dol_print_date($object->datepreviouslogin,"dayhour").'
        ' . $langs->trans("Entity") . ''; + if (empty($object->entity)) { + print $langs->trans("AllEntities"); + } else { + $mc->getInfo($object->entity); + print $mc->label; + } + print "
        '.$langs->trans("Entity").'".$mc->select_entities($object->entity, 'entity', '', 0, 1); // last parameter 1 means, show also a choice 0=>'all entities' + print "
        '; print ''; @@ -1111,7 +1112,7 @@ if ($action == 'create' || $action == 'adduserldap') null, '90%' ); print "
        '.$langs->trans("DefaultCategoryCar").'
        '.$langs->trans("Signature").''; @@ -1527,7 +1528,7 @@ else print $object->default_range; print '
        '; print $form->selectExpenseCategories($object->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1); print '
        '.$langs->trans("DefaultRangeNumber").''; $maxRangeNum = ExpenseReportIk::getMaxRangeNumber($object->default_c_exp_tax_cat); print $form->selectarray('default_range', range(0, $maxRangeNum), $object->default_range); print '
        '; - // Form to add a new line $alabelisused=0; $var=false; $fieldlist=explode(',',$tabfield[$id]); -if ($action != 'edit') -{ - // Line for title +//if ($action != 'edit') +//{ + print ''; + print ''; + print ''; + + print '
        '; + + // Line for title print ''; foreach ($fieldlist as $field => $value) { @@ -593,12 +591,13 @@ if ($action != 'edit') $colspan=count($fieldlist)+1; //print ''; // Keep   to have a line with enough height -} -print '
         
        '; -print ''; + print '
        '; -print '
        '; + print ''; + + print '
        '; +//} print '
        '; print ''; @@ -732,15 +731,15 @@ if ($resql) // Show value for field if ($showfield) { - print ''; // To create an artificial CR for the current tr we are on + print ''; + print ''; // To create an artificial CR for the current tr we are on $okforextended = true; - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) - $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); - print $doleditor->Create(1); - print ''; - print ''; - + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; + $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); + print $doleditor->Create(1); + print ''; + print ''; + print ''; } } } @@ -764,12 +763,16 @@ if ($resql) { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; } + if ($value == 'lang' && $valuetoshow) + { + $valuetoshow = $valuetoshow.' - '.$langs->trans("Language_".$valuetoshow); + } $class='tddict'; // Show value for field if ($showfield) { - print ''.$valuetoshow.''; + print ''.$valuetoshow.''; } } } @@ -884,7 +887,15 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') if ($fieldlist[$field] == 'lang') { print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); + if (! empty($conf->global->MAIN_MULTILANGS)) + { + print $formadmin->select_language($langs->defaultlang,'lang'); + } + else + { + //print $langs->defaultlang.' - '.$langs->trans('Language_'.$langs->defaultlang); + print ''; + } print ''; } // Le type de template diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 16a16719366..459f256918c 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -85,16 +85,11 @@ class FormAdmin asort($langs_available); - $uncompletelanguages=array('da_DA','fi_FI','hu_HU','is_IS','pl_PL','ro_RO','ru_RU','sv_SV','tr_TR','zh_CN'); foreach ($langs_available as $key => $value) { $valuetoshow=$value; if ($showcode) $valuetoshow=$key.' - '.$value; - - if ($showwarning && in_array($key,$uncompletelanguages)) - { - //$value.=' - '.$langs->trans("TranslationUncomplete",$key); - } + if ($filter && is_array($filter)) { if ( ! array_key_exists($key, $filter)) From 7329d21dcd3a727327100ac926df69c6b39a7e9a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 17:13:33 +0200 Subject: [PATCH 0139/1137] Fix lang selection --- htdocs/admin/mails_templates.php | 44 +++++++++++++--------- htdocs/core/class/html.formadmin.class.php | 2 +- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 5e309eab48c..390c792a879 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -205,7 +205,7 @@ if (empty($reshook)) if ($value == 'content') $value='content-'.$rowid; if ($value == 'content_lines') $value='content_lines-'.$rowid; - if (! isset($_POST[$value]) || ($_POST[$value]=='' && $value!='lang')) + if ((! isset($_POST[$value]) || $_POST[$value]=='') && $value != 'lang') { $ok=0; $fieldnamekey=$listfield[$f]; @@ -254,15 +254,16 @@ if (empty($reshook)) $i=0; foreach ($listfieldinsert as $f => $value) { - //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); - if ($value == 'entity') { - $_POST[$listfieldvalue[$i]] = $conf->entity; - } + $keycode=$listfieldvalue[$i]; + if ($value == 'lang') $keycode='langcode'; + + //var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value); + if ($value == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; - if ($value == 'private' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='0'; - if ($value == 'position' && ! is_numeric($_POST[$listfieldvalue[$i]])) $_POST[$listfieldvalue[$i]]='1'; - if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = '' - else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + if ($value == 'private' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='0'; + if ($value == 'position' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='1'; + if ($_POST[$keycode] == '' || ($keycode == 'langcode' && empty($_POST[$keycode]))) $sql.="null"; // For vat, we want/accept code = '' + else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } $sql.=",1)"; @@ -302,15 +303,16 @@ if (empty($reshook)) $i = 0; foreach ($listfieldmodify as $field) { + $keycode=$listfieldvalue[$i]; + if ($field == 'lang') $keycode='langcode'; + if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid]; if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid]; - if ($field == 'entity') { - $_POST[$listfieldvalue[$i]] = $conf->entity; - } + if ($field == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; $sql.= $field."="; - if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = '' - else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + if ($_POST[$keycode] == '' || ($keycode == 'langcode' && empty($_POST[$keycode]))) $sql.="null"; // For vat, we want/accept code = '' + else $sql.="'".$db->escape($_POST[$keycode])."'"; $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; @@ -698,6 +700,7 @@ if ($resql) $obj = $db->fetch_object($resql); //print_r($obj); print ''; + if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { $tmpaction='edit'; @@ -889,12 +892,19 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; if (! empty($conf->global->MAIN_MULTILANGS)) { - print $formadmin->select_language($langs->defaultlang,'lang'); + $selectedlang = $langs->defaultlang; + if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; + print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1); } else { - //print $langs->defaultlang.' - '.$langs->trans('Language_'.$langs->defaultlang); - print ''; + if (! empty($obj->{$fieldlist[$field]})) + { + print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]}); + } + $keyname=$fieldlist[$field]; + if ($keyname == 'lang') $keyname='langcode'; // Avoid conflict with lang param + print ''; } print ''; } diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 459f256918c..e2a423e9ca4 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -69,7 +69,7 @@ class FormAdmin $out.= ''; @@ -469,7 +472,7 @@ if ($object->fetch($id) >= 0) print ''; // Other print ''; - print ' '; + print ''; print ''; // Source print ''; From 54cc1ac800bba61f8759e41fac71a1c93fb8f5ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 21:12:22 +0200 Subject: [PATCH 0141/1137] Merge emailing target selectors. --- htdocs/comm/mailing/cibles.php | 25 +- .../modules/mailings/contacts1.modules.php | 231 ++++++++++++++-- .../modules/mailings/contacts2.modules.php | 222 --------------- .../modules/mailings/contacts3.modules.php | 250 ----------------- .../modules/mailings/contacts4.modules.php | 252 ------------------ .../core/modules/mailings/fraise.modules.php | 66 ++++- .../modules/mailings/framboise.modules.php | 234 ---------------- htdocs/install/upgrade2.php | 5 + htdocs/langs/en_US/companies.lang | 1 + 9 files changed, 280 insertions(+), 1006 deletions(-) delete mode 100644 htdocs/core/modules/mailings/contacts2.modules.php delete mode 100644 htdocs/core/modules/mailings/contacts3.modules.php delete mode 100644 htdocs/core/modules/mailings/contacts4.modules.php delete mode 100644 htdocs/core/modules/mailings/framboise.modules.php diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 6e917010b51..9669d8c0ff3 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -91,8 +91,7 @@ if ($action == 'add') { require_once $file; - // We fill $filtersarray. Using this variable is now deprecated. - // Kept for backward compatibility. + // We fill $filtersarray. Using this variable is now deprecated. Kept for backward compatibility. $filtersarray=array(); if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"]; @@ -157,11 +156,13 @@ if ($action == 'delete') } } -if ($_POST["button_removefilter"]) +// Purge search criteria +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { $search_lastname=''; $search_firstname=''; $search_email=''; + $search_other=''; $search_dest_status=''; } @@ -304,12 +305,10 @@ if ($object->fetch($id) >= 0) if ($qualified) { $var = !$var; - //print ''; -// print '
        '; if ($allowaddtarget) { - print ''; + print ''; print ''; } else @@ -317,13 +316,11 @@ if ($object->fetch($id) >= 0) print '
        '; } - //print ''; print '
        '; if (empty($obj->picto)) $obj->picto='generic'; - print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto); + print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj),$obj->picto); print ' '; print $obj->getDesc(); - //print ''; print '
        '; try { @@ -334,7 +331,6 @@ if ($object->fetch($id) >= 0) dol_syslog($e->getMessage(), LOG_ERR); } - //print ''; print '
        '; if ($nbofrecipient >= 0) { @@ -344,10 +340,8 @@ if ($object->fetch($id) >= 0) { print $langs->trans("Error").' '.img_error($obj->error); } - //print ''; print '
        '; - //print ''; print '
        '; if ($allowaddtarget) { @@ -361,10 +355,8 @@ if ($object->fetch($id) >= 0) if ($filter) print $filter; else print $langs->trans("None"); } - //print ''; print '
        '; - //print ''; print '
        '; if ($allowaddtarget) { @@ -376,19 +368,14 @@ if ($object->fetch($id) >= 0) //print $langs->trans("MailNoChangePossible"); print " "; } - //print ''; print '
        '; if ($allowaddtarget) print ''; else print '
        '; - - //print "\n"; -// print '
        '."\n"; } } } // End foreach dir - //print ''; print '
        '; print '

        '; diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 0e4966a5ada..51cca978ca6 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -28,8 +28,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; /** - * \class mailing_contacts1 - * \brief Class to offer a selector of emailing targets with Rule 'Poire'. + * Class to offer a selector of emailing targets from contacts */ class mailing_contacts1 extends MailingTargets { @@ -39,7 +38,7 @@ class mailing_contacts1 extends MailingTargets var $require_module=array("societe"); // Module mailing actif si modules require_module actifs var $require_admin=0; // Module mailing actif pour user admin ou non var $picto='contact'; - + var $db; @@ -101,8 +100,7 @@ class mailing_contacts1 extends MailingTargets $sql.= " AND c.no_email = 0"; $sql.= " AND c.statut = 1"; - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients + // The request must return a field called "nb" to be understandable by parent::getNbOfRecipients return parent::getNbOfRecipients($sql); } @@ -118,10 +116,86 @@ class mailing_contacts1 extends MailingTargets $langs->load("companies"); $langs->load("commercial"); $langs->load("suppliers"); + $langs->load("categories"); $s=''; - $s.=''; + $s.=''; + if ($resql) + { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $s.=''; + $i++; + } + } + else dol_print_error($this->db); + $s.=''; + + $s.=' '; + + // Filter on contact category + $s .= $langs->trans("ContactCategoriesShort").': '; + $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; + $sql.= " FROM "; + $sql.= " ".MAIN_DB_PREFIX."socpeople as sp,"; + $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; + $sql.= " ".MAIN_DB_PREFIX."categorie_contact as cs"; + $sql.= " WHERE sp.statut = 1"; // Note that null != '' is false + //$sql.= " AND sp.no_email = 0"; + //$sql.= " AND sp.email != ''"; + //$sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND cs.fk_categorie = c.rowid"; + $sql.= " AND cs.fk_socpeople = sp.rowid"; + $sql.= " GROUP BY c.label"; + $sql.= " ORDER BY c.label"; + $resql = $this->db->query($sql); + + $s.=''; + + $s.='
        '; + // Add prospect of a particular level + $s.=$langs->trans("NatureOfThirdParty").': '; + $s.=''; + + $s.= ' '; + + // Filter on thirdparty category + $s .= $langs->trans("CustomersProspectsCategoriesShort").': '; + $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; + $sql.= " FROM "; + $sql.= " ".MAIN_DB_PREFIX."socpeople as sp,"; + $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; + $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; + $sql.= " WHERE sp.statut = 1"; // Note that null != '' is false + //$sql.= " AND sp.no_email = 0"; + //$sql.= " AND sp.email != ''"; + //$sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND cs.fk_categorie = c.rowid"; + $sql.= " AND cs.fk_soc = sp.fk_soc"; + $sql.= " GROUP BY c.label"; + $sql.= " ORDER BY c.label"; + $resql = $this->db->query($sql); + + $s.=''; + + $s.= ' '; + + // Filter on thirdparty category + $s .= $langs->trans("SuppliersCategoriesShort").': '; + $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; + $sql.= " FROM "; + $sql.= " ".MAIN_DB_PREFIX."socpeople as sp,"; + $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; + $sql.= " ".MAIN_DB_PREFIX."categorie_fournisseur as cs"; + $sql.= " WHERE sp.statut = 1"; // Note that null != '' is false + //$sql.= " AND sp.no_email = 0"; + //$sql.= " AND sp.email != ''"; + //$sql.= " AND sp.entity IN (".getEntity('societe').")"; + $sql.= " AND cs.fk_categorie = c.rowid"; + $sql.= " AND cs.fk_soc = sp.fk_soc"; + $sql.= " GROUP BY c.label"; + $sql.= " ORDER BY c.label"; + $resql = $this->db->query($sql); + + $s.=''; + return $s; } @@ -168,13 +328,19 @@ class mailing_contacts1 extends MailingTargets * Ajoute destinataires dans table des cibles * * @param int $mailing_id Id of emailing - * @param array $filtersarray Requete sql de selection des destinataires + * @param array $filtersarray Optional filter data (deprecated) * @return int <0 si erreur, nb ajout si ok */ function add_to_target($mailing_id,$filtersarray=array()) { global $conf, $langs; + $filter = GETPOST('filter','alpha'); + $filter_jobposition = GETPOST('filter_jobposition','alpha'); + $filter_category = GETPOST('filter_category','alpha'); + $filter_category_customer = GETPOST('filter_category_customer','alpha'); + $filter_category_supplier = GETPOST('filter_category_supplier','alpha'); + $cibles = array(); // List prospects levels @@ -197,27 +363,43 @@ class mailing_contacts1 extends MailingTargets } else dol_print_error($this->db); - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,"; - $sql.= " c.lastname, c.firstname, c.civility as civility_id,"; + // Request must return: id, email, fk_contact, lastname, firstname, other + $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact, sp.lastname, sp.firstname, sp.civility as civility_id, sp.poste as jobposition,"; $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; - $sql.= " WHERE c.entity IN (".getEntity('societe').")"; - $sql.= " AND c.email <> ''"; - $sql.= " AND c.no_email = 0"; - $sql.= " AND c.statut = 1"; - $sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - foreach($filtersarray as $key) + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; + if ($filter_category <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c"; + if ($filter_category <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_contact as cs"; + if ($filter_category_customer <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c2"; + if ($filter_category_customer <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as c2s"; + if ($filter_category_supplier <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c3"; + if ($filter_category_supplier <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_fournisseur as c3s"; + $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; + $sql.= " AND sp.email <> ''"; + $sql.= " AND sp.no_email = 0"; + $sql.= " AND sp.statut = 1"; + $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + // Filter on category + if ($filter_category <> 'all') $sql.= " AND cs.fk_categorie = c.rowid AND cs.fk_socpeople = sp.rowid"; + if ($filter_category <> 'all') $sql.= " AND c.label = '".$this->db->escape($filter_category)."'"; + if ($filter_category_customer <> 'all') $sql.= " AND c2s.fk_categorie = c2.rowid AND c2s.fk_soc = sp.fk_soc"; + if ($filter_category_customer <> 'all') $sql.= " AND c2.label = '".$this->db->escape($filter_category_customer)."'"; + if ($filter_category_supplier <> 'all') $sql.= " AND c3s.fk_categorie = c3.rowid AND c3s.fk_soc = sp.fk_soc"; + if ($filter_category_supplier <> 'all') $sql.= " AND c3.label = '".$this->db->escape($filter_category_supplier)."'"; + // Filter on nature + $key = $filter; { - if ($key == 'prospects') $sql.= " AND s.client=2"; //print "xx".$key; + if ($key == 'prospects') $sql.= " AND s.client=2"; foreach($prospectlevel as $codelevel=>$valuelevel) if ($key == 'prospectslevel'.$codelevel) $sql.= " AND s.fk_prospectlevel='".$codelevel."'"; if ($key == 'customers') $sql.= " AND s.client=1"; if ($key == 'suppliers') $sql.= " AND s.fournisseur=1"; } - $sql.= " ORDER BY c.email"; - //print "x".$sql; + // Filter on job position + $key = $filter_jobposition; + if (! empty($key) && $key != 'all') $sql.= " AND sp.poste ='".$this->db->escape($key)."'"; + $sql.= " ORDER BY sp.email"; + //print "wwwwwwx".$sql; // Stocke destinataires dans cibles $result=$this->db->query($sql); @@ -242,8 +424,9 @@ class mailing_contacts1 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')).';'. + ($langs->transnoentities("JobPosition").'='.$obj->jobposition), + 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' ); diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php deleted file mode 100644 index a9c05434cd3..00000000000 --- a/htdocs/core/modules/mailings/contacts2.modules.php +++ /dev/null @@ -1,222 +0,0 @@ - - * Copyright (C) 2013 Regis Houssin - * - * 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 3 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, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/mailings/contacts2.modules.php - * \ingroup mailing - * \brief Provides a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * \class mailing_contacts2 - * \brief Class to manage a list of personalised recipients for mailing feature - */ -class mailing_contacts2 extends MailingTargets -{ - var $name='ContactsByFunction'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Add contacts by function'; - var $require_admin=0; - - var $require_module=array(); - var $picto='contact'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - - /** - * Renvoie url lien vers fiche de la source du destinataire du mailing - * - * @param int $id ID - * @return string Url lien - */ - function url($id) - { - return ''.img_object('',"contact").''; - } - - /** - * This is the main function that returns the array of emails - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray Function - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf,$langs; - - $target = array(); - - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname as firstname, sp.civility as civility_id,"; - $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email <> ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - //$sql.= " AND sp.poste != ''"; - $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'"; - $sql.= " ORDER BY sp.lastname, sp.firstname"; - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $obj= $this->db->fetch_object($resql); - $target[] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'contact' - ); - $i++; - } - } - - return parent::add_to_target($mailing_id, $target); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - global $conf; - - $statssql=array(); - /*for ($i=0; $i<5; $i++) { - $statssql[$i] = "SELECT sp.poste as label"; - $statssql[$i].= ", count(distinct(sp.email)) as nb"; - $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s"; - $statssql[$i].= " WHERE s.rowid = sp.fk_soc"; - $statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false - $statssql[$i].= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; - $statssql[$i].= " AND sp.entity IN (".getEntity('societe').")"; - $statssql[$i].= " GROUP BY label"; - $statssql[$i].= " ORDER BY nb DESC"; - $statssql[$i].= " LIMIT $i,1"; - }*/ - - return $statssql; - } - - - /** - * Return here number of distinct emails returned by your selector. - * - * @param string $sql Requete sql de comptage - * @return int - */ - function getNbOfRecipients($sql='') - { - global $conf; - - // We must report here number of contacts when absolutely no filter selected (so all contacts). - // Number with a filter are show in the combo list for each filter. - // If we want a filter "a position is defined", we must add it into formFilter - $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - //$sql.= " AND sp.poste != ''"; - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter" - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - - $sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " WHERE sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')"; - $sql.= " GROUP BY sp.poste"; - $sql.= " ORDER BY sp.poste"; - - $resql = $this->db->query($sql); - - $s=''; - $s.=''; - return $s; - } - -} - diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php deleted file mode 100644 index c16f6869668..00000000000 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ /dev/null @@ -1,250 +0,0 @@ - - * Copyright (C) 2013 Laurent Destailleur - * - * 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 3 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, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/mailings/contacts3.modules.php - * \ingroup mailing - * \brief Provides a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * Class to manage a list of personalised recipients for mailing feature - */ -class mailing_contacts3 extends MailingTargets -{ - var $name='ContactsByCompanyCategory'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Add contacts by company category'; - var $require_admin=0; - - var $require_module=array(); - var $picto='contact'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - /** - * Renvoie url lien vers fiche de la source du destinataire du mailing - * - * @param int $id ID - * @return string Url lien - */ - function url($id) - { - return ''.img_object('',"contact").''; - } - - /** - * This is the main function that returns the array of emails - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray Category - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf,$langs; - - $target = array(); - - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname, sp.civility as civility_id,"; - $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c"; - if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE sp.email <> ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid"; - if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_soc = sp.fk_soc"; - if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; - $sql.= " ORDER BY sp.lastname, sp.firstname"; - - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $obj= $this->db->fetch_object($resql); - $target[] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'contact' - ); - $i++; - } - } - - return parent::add_to_target($mailing_id, $target); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - global $conf, $langs; - - $statssql=array(); - /*for ($i=0; $i<5; $i++) { - $statssql[$i] = "SELECT c.label, count(sp.rowid) AS nb"; - $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie as c,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $statssql[$i].= " WHERE s.rowid = sp.fk_soc"; - $statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false - $statssql[$i].= " AND sp.entity IN (".getEntity('societe').")"; - $statssql[$i].= " AND cs.fk_categorie = c.rowid"; - $statssql[$i].= " AND cs.fk_soc = sp.fk_soc"; - $statssql[$i].= " GROUP BY c.label"; - $statssql[$i].= " ORDER BY nb DESC"; - $statssql[$i].= " LIMIT $i,1"; - }*/ - - return $statssql; - } - - - /** - * Return here number of distinct emails returned by your selector. - * - * @param string $sql Requete sql de comptage - * @return int Number of recipients - */ - function getNbOfRecipients($sql='') - { - global $conf; - - // We must report here number of contacts when absolutely no filter selected (so all contacts). - // Number with a filter are show in the combo list for each filter. - // If we want a filter "is inside at least one category", we must add it into formFilter - $sql = "SELECT count(distinct(c.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc"; - $sql.= " WHERE c.entity IN (".getEntity('societe').")"; - $sql.= " AND c.email != ''"; // Note that null != '' is false - $sql.= " AND c.no_email = 0"; - $sql.= " AND c.statut = 1"; - /* - $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s,"; - $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; - $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND cs.fk_categorie = c.rowid"; - $sql.= " AND cs.fk_soc = sp.fk_soc"; - */ - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter". - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - - $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; - $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND cs.fk_categorie = c.rowid"; - $sql.= " AND cs.fk_soc = sp.fk_soc"; - $sql.= " GROUP BY c.label"; - $sql.= " ORDER BY c.label"; - - $resql = $this->db->query($sql); - - $s=''; - $s.=''; - - return $s; - } - -} - diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php deleted file mode 100644 index f4c67874bfb..00000000000 --- a/htdocs/core/modules/mailings/contacts4.modules.php +++ /dev/null @@ -1,252 +0,0 @@ - - * Copyright (C) 2013 Florian HENRY - * - * 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 3 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, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/modules/mailings/contacts4.modules.php - * \ingroup mailing - * \brief Provides a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * Class to manage a list of personalised recipients for mailing feature - */ -class mailing_contacts4 extends MailingTargets -{ - var $name='ContactsByCategory'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Add contacts by category'; - var $require_admin=0; - - var $require_module=array(); - var $picto='contact'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - /** - * Renvoie url lien vers fiche de la source du destinataire du mailing - * - * @param int $id ID - * @return string Url lien - */ - function url($id) - { - return ''.img_object('',"contact").''; - } - - /** - * This is the main function that returns the array of emails - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray Category - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf,$langs; - - $target = array(); - - // La requete doit retourner: id, email, fk_contact, name, firstname, other - $sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,"; - $sql.= " sp.lastname, sp.firstname, sp.civility as civility_id,"; - $sql.= " s.nom as companyname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - if ($filtersarray[0] <> 'all')$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie_contact as cs ON cs.fk_socpeople=sp.rowid"; - if ($filtersarray[0] <> 'all') $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc"; - $sql.= " WHERE sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; - $sql.= " ORDER BY sp.lastname, sp.firstname"; - - dol_syslog(get_class($this).':: add_to_target',LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $obj= $this->db->fetch_object($resql); - $target[] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'contact' - ); - $i++; - } - }else { - $this->error=$this->db->lasterrno(); - return -1; - } - - return parent::add_to_target($mailing_id, $target); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - global $conf, $langs; - - $statssql=array(); - /*for ($i=0; $i<5; $i++) { - $statssql[$i] = "SELECT c.label, count(sp.rowid) AS nb"; - $statssql[$i].= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."societe as s,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie as c,"; - $statssql[$i].= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $statssql[$i].= " WHERE s.rowid = sp.fk_soc"; - $statssql[$i].= " AND sp.email != ''"; // Note that null != '' is false - $statssql[$i].= " AND sp.entity IN (".getEntity('societe').")"; - $statssql[$i].= " AND cs.fk_categorie = c.rowid"; - $statssql[$i].= " AND cs.fk_soc = sp.fk_soc"; - $statssql[$i].= " GROUP BY c.label"; - $statssql[$i].= " ORDER BY nb DESC"; - $statssql[$i].= " LIMIT $i,1"; - }*/ - - return $statssql; - } - - - /** - * Return here number of distinct emails returned by your selector. - * - * @param string $sql Requete sql de comptage - * @return int Number of recipients - */ - function getNbOfRecipients($sql='') - { - global $conf; - - // We must report here number of contacts when absolutely no filter selected (so all contacts). - // Number with a filter are show in the combo list for each filter. - // If we want a filter "is inside at least one category", we must add it into formFilter - $sql = "SELECT count(distinct(c.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " WHERE c.entity IN (".getEntity('societe').")"; - $sql.= " AND c.email != ''"; // Note that null != '' is false - $sql.= " AND c.no_email = 0"; - $sql.= " AND c.statut = 1"; - /* - $sql = "SELECT count(distinct(sp.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,"; - $sql.= " ".MAIN_DB_PREFIX."societe as s,"; - $sql.= " ".MAIN_DB_PREFIX."categorie as c,"; - $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs"; - $sql.= " WHERE s.rowid = sp.fk_soc"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " AND sp.email != ''"; // Note that null != '' is false - $sql.= " AND cs.fk_categorie = c.rowid"; - $sql.= " AND cs.fk_soc = sp.fk_soc"; - */ - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter". - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - - $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie_contact as cs ON cs.fk_socpeople=sp.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; - $sql.= " WHERE sp.email != ''"; // Note that null != '' is false - $sql.= " AND sp.no_email = 0"; - $sql.= " AND sp.statut = 1"; - $sql.= " AND sp.entity IN (".getEntity('societe').")"; - $sql.= " GROUP BY c.label"; - $sql.= " ORDER BY c.label"; - - $resql = $this->db->query($sql); - - dol_syslog(get_class($this).':: formFilter',LOG_DEBUG); - if ($resql) { - $s=''; - $s.=''; - return $s; - } - else { - $this->error=$this->db->lasterrno(); - return -1; - } - - } - -} - diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 05d9e525652..e0226017ede 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -34,7 +34,7 @@ class mailing_fraise extends MailingTargets { var $name='FundationMembers'; // Identifiant du module mailing // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc='Foundation members with emails (by status)'; + var $desc='Foundation members with emails'; // Set to 1 if selector is available for admin users only var $require_admin=0; @@ -108,10 +108,14 @@ class mailing_fraise extends MailingTargets { global $conf, $langs; $langs->load("members"); + $langs->load("categories"); + $langs->load("companies"); $form=new Form($this->db); $s=''; + + // Status $s.=$langs->trans("Status").': '; $s.=' '; $s.=$langs->trans("Type").': '; - $s.=''; $sql = "SELECT rowid, libelle, statut"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type"; $sql.= " WHERE entity = ".$conf->entity; @@ -150,6 +154,47 @@ class mailing_fraise extends MailingTargets } $s.=''; + + $s.=' '; + + $s.=$langs->trans("Category").': '; + $s.=''; + + $s.='
        '; $s.=$langs->trans("DateEndSubscription").':  '; $s.=$langs->trans("After").' > '.$form->select_date(-1,'subscriptionafter',0,0,1,'fraise',1,0,1,0); @@ -200,18 +245,29 @@ class mailing_fraise extends MailingTargets $sql = "SELECT a.rowid as id, a.email as email, null as fk_contact, "; $sql.= " a.lastname, a.firstname,"; $sql.= " a.datefin, a.civility as civility_id, a.login, a.societe"; // Other fields - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; + if ($_POST['filter_category']) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = a.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; + } + $sql.= " , ".MAIN_DB_PREFIX."adherent_type as ta"; $sql.= " WHERE a.email <> ''"; // Note that null != '' is false $sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + // Filter on status if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1"; if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND a.datefin >= '".$this->db->idate($now)."'"; if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')"; if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0"; + // Filter on date if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'"; if ($dateendsubscriptionbefore > 0) $sql.=" AND datefin < '".$this->db->idate($dateendsubscriptionbefore)."'"; $sql.= " AND a.fk_adherent_type = ta.rowid"; - if ($_POST['filtertype']) $sql.= " AND ta.rowid='".$_POST['filtertype']."'"; - $sql.= " ORDER BY a.email"; + // Filter on type + if ($_POST['filter_type']) $sql.= " AND ta.rowid='".$_POST['filter_type']."'"; + // Filter on category + if ($_POST['filter_category']) $sql.= " AND c.rowid='".$_POST['filter_category']."'"; + $sql.= " ORDER BY a.email"; //print $sql; // Add targets into table diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php deleted file mode 100644 index 82f7e51e0ef..00000000000 --- a/htdocs/core/modules/mailings/framboise.modules.php +++ /dev/null @@ -1,234 +0,0 @@ - - * Copyright (C) 2005-2009 Regis Houssin - * - * This file is an example to follow to add your own email selector inside - * the Dolibarr email tool. - * Follow instructions given in README file to know what to change to build - * your own emailing list selector. - * Code that need to be changed in this file are marked by "CHANGE THIS" tag. - */ - -/** - * \file htdocs/core/modules/mailings/framboise.modules.php - * \ingroup mailing - * \brief Example file to provide a list of recipients for mailing module - */ - -include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; - - -/** - * Class to manage a list of personalised recipients for mailing feature - */ -class mailing_framboise extends MailingTargets -{ - var $name='MembersCategories'; - // This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found - var $desc="Foundation members with emails (by categories)"; - // Set to 1 if selector is available for admin users only - var $require_admin=0; - - var $require_module=array("adherent","categorie"); - var $picto='user'; - var $db; - - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db=$db; - } - - - /** - * This is the main function that returns the array of emails. - * - * @param int $mailing_id Id of mailing. No need to use it. - * @param array $filtersarray If you used the formFilter function. Empty otherwise. - * @return int <0 if error, number of emails added if ok - */ - function add_to_target($mailing_id,$filtersarray=array()) - { - global $conf, $langs; - $langs->load("members"); - $langs->load("companies"); - - $cibles = array(); - - // Select the members from category - $sql = "SELECT a.rowid as id, a.email as email, a.lastname, null as fk_contact, a.firstname,"; - $sql.= " a.datefin, a.civility as civility_id, a.login, a.societe,"; // Other fields - if ($_POST['filter']) $sql.= " c.label"; - else $sql.=" null as label"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; - if ($_POST['filter']) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = a.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie"; - } - $sql.= " WHERE a.email != ''"; - $sql.= " AND a.entity = ".$conf->entity; - if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'"; - $sql.= " ORDER BY a.email"; - - // Stocke destinataires dans cibles - $result=$this->db->query($sql); - if ($result) - { - $num = $this->db->num_rows($result); - $i = 0; - $j = 0; - - dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found"); - - $old = ''; - while ($i < $num) - { - $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) - { - $cibles[$j] = array( - 'email' => $obj->email, - 'fk_contact' => $obj->fk_contact, - 'lastname' => $obj->lastname, - 'firstname' => $obj->firstname, - 'other' => - ($langs->transnoentities("Login").'='.$obj->login).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')).';'. - ($langs->transnoentities("DateEnd").'='.dol_print_date($this->db->jdate($obj->datefin),'day')).';'. - ($langs->transnoentities("Company").'='.$obj->societe).';'. - ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''), - 'source_url' => $this->url($obj->id), - 'source_id' => $obj->id, - 'source_type' => 'member' - ); - $old = $obj->email; - $j++; - } - - $i++; - } - } - else - { - dol_syslog($this->db->error()); - $this->error=$this->db->error(); - return -1; - } - - return parent::add_to_target($mailing_id, $cibles); - } - - - /** - * On the main mailing area, there is a box with statistics. - * If you want to add a line in this report you must provide an - * array of SQL request that returns two field: - * One called "label", One called "nb". - * - * @return array Array with SQL requests - */ - function getSqlArrayForStats() - { - // CHANGE THIS: Optionnal - - //var $statssql=array(); - //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; - return array(); - } - - - /** - * Return here number of distinct emails returned by your selector. - * For example if this selector is used to extract 500 different - * emails from a text file, this function must return 500. - * - * @param string $sql Requete sql de comptage - * @return int Nb of recipients - */ - function getNbOfRecipients($sql='') - { - global $conf; - - $sql = "SELECT count(distinct(a.email)) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; - $sql.= " WHERE a.email != ''"; - $sql.= " AND a.entity = ".$conf->entity; - - // La requete doit retourner un champ "nb" pour etre comprise - // par parent::getNbOfRecipients - return parent::getNbOfRecipients($sql); - } - - /** - * This is to add a form filter to provide variant of selector - * If used, the HTML select must be called "filter" - * - * @return string A html select zone - */ - function formFilter() - { - global $conf, $langs; - - $langs->load("companies"); - $langs->load("categories"); - - $s=''; - $s.=''; - return $s; - - } - - - /** - * Can include an URL link on each record provided by selector shown on target page. - * - * @param int $id Id of member - * @return string Url link - */ - function url($id) - { - return ''.img_object('',"user").''; - } - -} - diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 2c032ffa7c0..80162f24b5c 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4023,6 +4023,10 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php', DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php', DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_frontoffice.php', + DOL_DOCUMENT_ROOT.'/core/modules/mailings/contacts2.modules.php', + DOL_DOCUMENT_ROOT.'/core/modules/mailings/contacts3.modules.php', + DOL_DOCUMENT_ROOT.'/core/modules/mailings/contacts4.modules.php', + DOL_DOCUMENT_ROOT.'/core/modules/mailings/framboise.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/peche.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php', @@ -4036,6 +4040,7 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/product/class/api_product.class.php', DOL_DOCUMENT_ROOT.'/societe/class/api_contact.class.php', DOL_DOCUMENT_ROOT.'/societe/class/api_thirdparty.class.php' + ); foreach ($filetodeletearray as $filetodelete) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index bd7d7983191..a7e7c67ae9c 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -50,6 +50,7 @@ Lastname=Last name Firstname=First name PostOrFunction=Job position UserTitle=Title +NatureOfThirdParty=Nature of Third party Address=Address State=State/Province StateShort=State From a9e7f8b9e6b2b4a7e44af4c71e13f620fd136ef7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Aug 2017 21:27:19 +0200 Subject: [PATCH 0142/1137] Fix trans --- htdocs/core/modules/mailings/contacts1.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 51cca978ca6..8aae15b9cc8 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -185,7 +185,7 @@ class mailing_contacts1 extends MailingTargets } else { - $s.=''; + $s.=''; } } else dol_print_error($this->db); From 3e7ed752ea2acc56efc439a0bd562ac9efe7720b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 11:54:53 +0200 Subject: [PATCH 0143/1137] Add changelog --- ChangeLog | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad00051939c..785e338fe09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,36 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 5.0.5 compared to 5.0.4 ***** +FIX: #7075 : bad path for document +FIX: #7156 +FIX: #7173 +FIX: #7224 +FIX: #7226 +FIX: #7239 +FIX: add supplierproposaldet without price (new product) +FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page. +FIX: Bad tax calculation with expense report +FIX: Best buy price calculation +FIX: Buying prices must always be in positive value. +FIX: calculate correct remain to pay for planned bank transactions +FIX: delete linked element on facture rec +FIX: edit sociale was emptying label +FIX: Error when updating thirdparty not returned +FIX: holidays with postgresql like on rowid integer +FIX: id of user not saved when making a payment of expense report +FIX: invoice page list +FIX: invoice situation VAT total rounding into PDF crabe +FIX: PgSQL compatibility. +FIX: remove order rights on invoice page +FIX: status were wrong on product referent list +FIX: supplier id was not passed to hooks +FIX: Support of vat code when using price per customer +FIX: User id correction on holiday request +FIX: value of user id filled to 0 in llx_bank_url when recording an expense report. +FIX: we have to check if contact doesn't already exist on add_contact() function +FIX: We should be able to insert data with value '0' into const + ***** ChangeLog for 5.0.4 compared to 5.0.3 ***** FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working From f2a437fa891c1e876faa4b82882d15f1aadd9e85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 15:22:13 +0200 Subject: [PATCH 0144/1137] Enhance modulebuilder --- htdocs/admin/fichinter.php | 1 - htdocs/admin/limits.php | 19 +++--- htdocs/core/actions_setmoduleoptions.inc.php | 34 +++++++++- htdocs/core/lib/files.lib.php | 12 +++- htdocs/langs/en_US/cron.lang | 2 +- htdocs/langs/en_US/modulebuilder.lang | 4 +- htdocs/modulebuilder/index.php | 65 ++++++++++++------- htdocs/modulebuilder/template/admin/about.php | 7 +- htdocs/modulebuilder/template/admin/setup.php | 57 +++++++++++++++- .../core/modules/modMyModule.class.php | 9 +-- .../template/langs/en_US/mymodule.lang | 5 ++ 11 files changed, 159 insertions(+), 56 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 751cbce81e9..62533ced467 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -495,7 +495,6 @@ print "
        "; /* * Other options - * */ print load_fiche_titre($langs->trans("OtherOptions"),'',''); diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 1d4b5cee8d4..36b0d4d0df1 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -101,25 +101,24 @@ if ($action == 'edit') print ''; clearstatcache(); - $var=true; print ''; print ''; - + print ''; - + print ''; - + print ''; - + print ''; @@ -135,25 +134,23 @@ if ($action == 'edit') } else { - $var=true; - print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
        '; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
        '.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
        '; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
        '; print ''; - + print ''; - + print ''; - + print ''; - + print ''; diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index b8ae96cb920..eadce1dc74c 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2017 Laurent Destailleur * * 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 @@ -17,15 +17,43 @@ */ /** - * \file htdocs/core/actions_setnotes.inc.php + * \file htdocs/core/actions_setmoduleoptions.inc.php * \brief Code for actions on setting notes of object page */ // $action must be defined -// $_FILES may be defined +// $arrayofparameters must be set for action 'update' +// $nomessageinupdate can be set to 1 // $nomessageinsetmoduleoptions can be set to 1 +if ($action == 'update' && is_array($arrayofparameters)) +{ + $db->begin(); + + $ok=True; + foreach($arrayofparameters as $key => $val) + { + $result=dolibarr_set_const($db,$key,GETPOST($key, 'alpha'),'chaine',0,'',$conf->entity); + if ($result < 0) + { + $ok=False; + break; + } + } + + if (! $error) + { + $db->commit(); + if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); + } +} + // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) if ($action == 'setModuleOptions') { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 3fe6d5887f4..8643e951fd4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1929,7 +1929,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta function dol_check_secure_access_document($modulepart, $original_file, $entity, $fuser='', $refname='', $mode='read') { global $user, $conf, $db; - global $dolibarr_main_data_root; + global $dolibarr_main_data_root, $dolibarr_main_document_root_alt; if (! is_object($fuser)) $fuser=$user; @@ -1965,6 +1965,16 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed=($user->admin && basename($original_file) == $original_file && preg_match('/^dolibarr.*\.log$/', basename($original_file))); $original_file=$dolibarr_main_data_root.'/'.$original_file; } + // Wrapping for *.zip files, like when used with url http://.../document.php?modulepart=packages&file=module_myfile.zip + elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root)) + { + // Dir for custom dirs + $tmp=explode(',', $dolibarr_main_document_root_alt); + $dirins = $tmp[0]; + + $accessallowed=($user->admin && preg_match('/^module_.*\.zip$/', basename($original_file))); + $original_file=$dirins.'/'.$original_file; + } // Wrapping for some images elseif (($modulepart == 'mycompany' || $modulepart == 'companylogo') && !empty($conf->mycompany->dir_output)) { diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 0113b2669c5..7f3385bef12 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -55,7 +55,7 @@ CronSaveSucess=Save successfully CronNote=Comment CronFieldMandatory=Fields %s is mandatory CronErrEndDateStartDt=End date cannot be before start date -StatusAtInstall=Status at installation +StatusAtInstall=Status at module installation CronStatusActiveBtn=Enable CronStatusInactiveBtn=Disable CronTaskInactive=This job is disabled diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 7f986e036c1..034deb7c800 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -58,4 +58,6 @@ SqlFileKey=Sql file for keys AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown) IsAMeasure=Is a measure -DirScanned=Directory scanned \ No newline at end of file +DirScanned=Directory scanned +NoTrigger=No trigger +NoWidget=No widget \ No newline at end of file diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4ef05cb6e2b..d0da95b6947 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -149,7 +149,7 @@ if ($dirins && $action == 'initmodule' && $modulename) 'my module'=>$modulename, 'Mon module'=>$modulename, 'mon module'=>$modulename, - 'htdocs/modulebuilder/template/'=>strtolower($modulename), + 'htdocs/modulebuilder/template'=>strtolower($modulename), '---Put here your own copyright and developer email---'=>dol_print_date($now,'%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') ); @@ -508,11 +508,11 @@ if ($dirins && $action == 'generatepackage') $FILENAMEZIP="module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2]?".".$arrayversion[2]:"").".zip"; $dirofmodule = dol_buildpath($modulelowercase, 0).'/bin'; - $outputfile = $dirofmodule.'/'.$FILENAMEZIP; + $outputfilezip = $dirofmodule.'/'.$FILENAMEZIP; if ($dirofmodule) { if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); - $result = dol_compress_dir($dir, $outputfile, 'zip'); + $result = dol_compress_dir($dir, $outputfilezip, 'zip'); } else { @@ -521,13 +521,13 @@ if ($dirins && $action == 'generatepackage') if ($result > 0) { - setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfile), null); + setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfilezip), null); } else { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfile), null, 'errors'); + setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfilezip), null, 'errors'); } } else @@ -576,7 +576,7 @@ if ($dirins && $action == 'generatedoc') $FILENAMEDOC=$modulelowercase.'.html'; $dirofmodule = dol_buildpath($modulelowercase, 0).'/doc'; - $outputfile = $dirofmodule.'/'.$FILENAMEDOC; + $outputfiledoc = $dirofmodule.'/'.$FILENAMEDOC; if ($dirofmodule) { if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); @@ -591,13 +591,13 @@ if ($dirins && $action == 'generatedoc') if ($result > 0) { - setEventMessages($langs->trans("DocFileGeneratedInto", $outputfile), null); + setEventMessages($langs->trans("DocFileGeneratedInto", $outputfiledoc), null); } else { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfile), null, 'errors'); + setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfiledoc), null, 'errors'); } } else @@ -1578,14 +1578,21 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - foreach ($triggers as $trigger) - { - $pathtofile = $trigger['relpath']; + if (! empty($triggers)) + { + foreach ($triggers as $trigger) + { + $pathtofile = $trigger['relpath']; - print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
        '; - } + print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
        '; + } + } + else + { + print $langs->trans("NoTrigger"); + } } else { @@ -1622,13 +1629,20 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - foreach ($widgets as $widget) - { - $pathtofile = $widget['relpath']; + if (! empty($widget)) + { + foreach ($widgets as $widget) + { + $pathtofile = $widget['relpath']; - print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
        '; + print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
        '; + } + } + else + { + print $langs->trans("NoWidget"); } } else @@ -1811,7 +1825,7 @@ elseif (! empty($module)) if (count($arrayversion)) { $FILENAMEZIP="module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2]?".".$arrayversion[2]:"").".zip"; - $outputfile = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP; + $outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP; $FILENAMEDOC=$modulelowercase.'.html'; $outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC; @@ -1820,10 +1834,11 @@ elseif (! empty($module)) print '
        '; print ' '. $langs->trans("PathToModulePackage") . ' : '; - if (! dol_is_file($outputfile)) print ''.$langs->trans("FileNotYetGenerated").''; + if (! dol_is_file($outputfilezip)) print ''.$langs->trans("FileNotYetGenerated").''; else { - print ''.$outputfile.''; - print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfile), 'dayhour').')'; + $relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP; + print ''.$outputfilezip.''; + print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')'; } print '
        '; diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php index ac21d2810e0..d492f72da79 100644 --- a/htdocs/modulebuilder/template/admin/about.php +++ b/htdocs/modulebuilder/template/admin/about.php @@ -81,16 +81,11 @@ $head = mymoduleAdminPrepareHead(); dol_fiche_head( $head, 'about', - $langs->trans("MyModuleName"), + $langs->trans("ModuleMyModuleName"), 0, 'mymodule@mymodule' ); -// About page goes here -echo $langs->trans("MyModuleAboutPage"); - -echo '
        '; - dol_include_once('/mymodule/core/modules/modMyModule.class.php'); $tmpmodule = new modMyModule($db); print $tmpmodule->getDescLong(); diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index d32bd0a1723..46b608efa8e 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -42,8 +42,9 @@ global $langs, $user; require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; require_once '../lib/mymodule.lib.php'; //require_once "../class/myclass.class.php"; + // Translations -$langs->load("mymodule@mymodule"); +$langs->loadLangs(array("admin", "mymodule@mymodule")); // Access control if (! $user->admin) accessforbidden(); @@ -51,6 +52,8 @@ if (! $user->admin) accessforbidden(); // Parameters $action = GETPOST('action', 'alpha'); +$arrayofparameters=array('MYMODULE_MYPARAM1'=>'1', 'MYMODULE_MYPARAM2'=>'2'); + /* * Actions @@ -76,14 +79,62 @@ $head = mymoduleAdminPrepareHead(); dol_fiche_head( $head, 'settings', - $langs->trans("Module500000Name"), - 0, + $langs->trans("ModuleMyModuleName"), + -1, "mymodule@mymodule" ); // Setup page goes here echo $langs->trans("MyModuleSetupPage"); + +if ($action == 'edit') +{ + print '
        '; + print ''; + print ''; + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.'
        '; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.'
        '.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'
        '; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.'
        '; + print ''; + + foreach($arrayofparameters as $key => $val) + { + print ''; + } + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '; + print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip')); + print '
        '; + + print '
        '; + print ''; + print '
        '; + + print ''; + print '
        '; +} +else +{ + print ''; + print ''; + + foreach($arrayofparameters as $key => $val) + { + print ''; + } + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '; + print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip')); + print '' . $conf->global->$key . '
        '; + + print '
        '; + print ''.$langs->trans("Modify").''; + print '
        '; +} + + // Page end dol_fiche_end(); + llxFooter(); +$db->close(); diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index a26f7148142..77f860ba92c 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -311,10 +311,11 @@ class modMyModule extends DolibarrModules include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - //$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty'); - //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'string', 1, 10, 'project'); - //$param=array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')); - //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'select', 1, 3, 'thirdparty', 0, 1, '', $param, 1); + $result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty'); + //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project'); + //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account'); + //$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1); + //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user'); $sql = array(); diff --git a/htdocs/modulebuilder/template/langs/en_US/mymodule.lang b/htdocs/modulebuilder/template/langs/en_US/mymodule.lang index e09e396dce0..a37d8e0c241 100644 --- a/htdocs/modulebuilder/template/langs/en_US/mymodule.lang +++ b/htdocs/modulebuilder/template/langs/en_US/mymodule.lang @@ -28,6 +28,11 @@ ModuleMyModuleDesc = My module description MyModuleSetup = My module setup Settings = Settings MyModuleSetupPage = My module setup page +MYMODULE_MYPARAM1 = My param 1 +MYMODULE_MYPARAM1Tooltip = My param 1 tooltip +MYMODULE_MYPARAM2=My param 2 +MYMODULE_MYPARAM2Tooltip=My param 2 tooltip + # # About page From 632119a5c509dc0f055fa1fd42b0fc1cdcc18ddf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 15:46:18 +0200 Subject: [PATCH 0145/1137] Show if module add dictionary data --- htdocs/admin/modulehelp.php | 53 +++++++++++++++++++++-------------- htdocs/langs/en_US/admin.lang | 3 +- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 830b323545f..2110a814b10 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -35,7 +35,8 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is n require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("errors"); $langs->load("admin"); @@ -371,22 +372,7 @@ if ($mode == 'feature') if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); else $text.=$langs->trans("None"); - $text.='


        '; - - $text.=''.$langs->trans("AddRemoveTabs").': '; - if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) - { - $i=0; - foreach($objMod->tabs as $val) - { - $tmp=explode(':',$val,3); - $text.=($i?', ':'').$tmp[0].':'.$tmp[1]; - $i++; - } - } - else $text.=$langs->trans("No"); - - $text.='
        '; + $text.='

        '; $text.='
        '.$langs->trans("AddDictionaries").': '; if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib'])) @@ -402,13 +388,24 @@ if ($mode == 'feature') $text.='
        '; - $text.='
        '.$langs->trans("AddBoxes").': '; - if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) + $text.='
        '.$langs->trans("AddData").': '; + $filedata = dol_buildpath($moduledir.'/sql/data.sql'); + if (dol_is_file($filedata)) + { + $text.=$langs->trans("Yes").' ('.$moduledir.'/sql/data.sql'.')'; + } + else $text.=$langs->trans("No"); + + $text.='
        '; + + $text.='
        '.$langs->trans("AddRemoveTabs").': '; + if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) { $i=0; - foreach($objMod->boxes as $val) + foreach($objMod->tabs as $val) { - $text.=($i?', ':'').($val['file']?$val['file']:$val[0]); + $tmp=explode(':',$val,3); + $text.=($i?', ':'').$tmp[0].':'.$tmp[1]; $i++; } } @@ -474,6 +471,20 @@ if ($mode == 'feature') $text.='
        '; + $text.='
        '.$langs->trans("AddBoxes").': '; + if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) + { + $i=0; + foreach($objMod->boxes as $val) + { + $text.=($i?', ':'').($val['file']?$val['file']:$val[0]); + $i++; + } + } + else $text.=$langs->trans("No"); + + $text.='
        '; + $text.='
        '.$langs->trans("AddHooks").': '; if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a8e373518d2..9362606a6b2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1696,7 +1696,8 @@ SeeSubstitutionVars=See * note for list of possible substitution variables AllPublishers=All publishers UnknownPublishers=Unknown publishers AddRemoveTabs=Add or remove tabs -AddDictionaries=Add dictionaries +AddDictionaries=Add dictionaries tables +AddData=Add dictionaries data AddBoxes=Add widgets AddSheduledJobs=Add scheduled jobs AddHooks=Add hooks From 5ed22b64fbc260d7134e341346d9c7a20a5fe5c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 16:04:24 +0200 Subject: [PATCH 0146/1137] Show if module add objects tables --- htdocs/admin/modulehelp.php | 17 +++++++++++++++++ htdocs/langs/en_US/admin.lang | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 2110a814b10..e0caaba0a93 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -374,6 +374,23 @@ if ($mode == 'feature') $text.='

        '; + $text.='
        '.$langs->trans("AddDataTables").': '; + $sqlfiles = dol_dir_list(dol_buildpath($moduledir.'/sql/'), 'files', 0, 'llx.*\.sql', array('\.key\.sql')); + if (count($sqlfiles) > 0) + { + $text.=$langs->trans("Yes").' ('; + $i=0; + foreach($sqlfiles as $val) + { + $text.=($i?', ':'').preg_replace('/\.sql$/','',preg_replace('/llx_/','',$val['name'])); + $i++; + } + $text.=')'; + } + else $text.=$langs->trans("No"); + + $text.='
        '; + $text.='
        '.$langs->trans("AddDictionaries").': '; if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib'])) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9362606a6b2..99cb1ae95c2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1696,8 +1696,9 @@ SeeSubstitutionVars=See * note for list of possible substitution variables AllPublishers=All publishers UnknownPublishers=Unknown publishers AddRemoveTabs=Add or remove tabs +AddDataTables=Add object tables AddDictionaries=Add dictionaries tables -AddData=Add dictionaries data +AddData=Add objects or dictionaries data AddBoxes=Add widgets AddSheduledJobs=Add scheduled jobs AddHooks=Add hooks From ebe84b6ac53675922653ea7dcec6b3bb02713e2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 16:24:55 +0200 Subject: [PATCH 0147/1137] Fix run sql with large data --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index d2c466287ff..e74d1b1e94f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -143,7 +143,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker { while (! feof($fp)) { - $buf = fgets($fp, 4096); + $buf = fgets($fp, 32768); // Test if request must be ran only for particular database or version (if yes, we must remove the -- comment) if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg)) From 831947b6d12ffc57fd04ee49ba20a528aff3d678 Mon Sep 17 00:00:00 2001 From: BENKE Charlene Date: Sat, 26 Aug 2017 16:37:32 +0200 Subject: [PATCH 0148/1137] Little cleaning code $bottomlastpage is same in two case --- .../commande/doc/pdf_einstein.modules.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3a2ad2776c5..d1c25ba978f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -562,15 +562,10 @@ class pdf_einstein extends ModelePDFCommandes // Show square if ($pagenb == 1) - { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } else - { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); @@ -587,18 +582,18 @@ class pdf_einstein extends ModelePDFCommandes */ // Pied de page - $this->_pagefoot($pdf,$object,$outputlangs); - if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); + $this->_pagefoot($pdf, $object, $outputlangs); + if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages(); $pdf->Close(); - $pdf->Output($file,'F'); + $pdf->Output($file, 'F'); // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + $parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); global $action; - $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); From 77af3b96d382626559ae6daa3089b1cc1a6482db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 18:45:10 +0200 Subject: [PATCH 0149/1137] Showempty on language list --- htdocs/admin/mails_templates.php | 2 +- htdocs/langs/en_US/agenda.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 390c792a879..2bf6faf2112 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -912,7 +912,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') elseif ($fieldlist[$field] == 'type_template') { print ''; - print $form->selectarray('type_template', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1); print ''; } elseif (in_array($fieldlist[$field], array('content','content_lines'))) continue; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index a62db9c7158..25449981587 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -34,6 +34,7 @@ AgendaAutoActionDesc= Define here events for which you want Dolibarr to create a AgendaSetupOtherDesc= This page provides options to allow export of your Dolibarr events into an external calendar (thunderbird, google calendar, ...) AgendaExtSitesDesc=This page allows to declare external sources of calendars to see their events into Dolibarr agenda. ActionsEvents=Events for which Dolibarr will create an action in agenda automatically +EventRemindersByEmailNotEnabled=Event reminders by email was not enabled into Agenda module setup. ##### Agenda event labels ##### NewCompanyToDolibarr=Third party %s created ContractValidatedInDolibarr=Contract %s validated From d9a85e6d3b26774a8501faed2445e092a2a28181 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 19:19:23 +0200 Subject: [PATCH 0150/1137] FIX Install run_sql function accept -- into sql content. --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index e74d1b1e94f..225786898be 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -189,7 +189,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker // Add line buf to buffer if not a comment if (! preg_match('/^--/',$buf)) { - $buf=preg_replace('/--.*$/','',$buf); //remove comment from a line that not start with -- before add it to the buffer + $buf=preg_replace('/[,;]\s*--.*$/','',$buf); //remove comment from a line that not start with -- before add it to the buffer $buffer .= trim($buf); } From c64a21f47bcf464af601227b107210bcaae5ba70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 19:57:22 +0200 Subject: [PATCH 0151/1137] Fix regression in cleaning sql --- htdocs/core/lib/admin.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 225786898be..b3a7129507b 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -189,7 +189,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker // Add line buf to buffer if not a comment if (! preg_match('/^--/',$buf)) { - $buf=preg_replace('/[,;]\s*--.*$/','',$buf); //remove comment from a line that not start with -- before add it to the buffer + $buf=preg_replace('/([,;])\s*--.*$/','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer $buffer .= trim($buf); } From 49a2f4f0c6e9ec164d0f0f9658188511cfb42a6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 20:13:01 +0200 Subject: [PATCH 0152/1137] Fix sql --- htdocs/install/mysql/tables/llx_accounting_account.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_accounting_account.sql b/htdocs/install/mysql/tables/llx_accounting_account.sql index b65863afe3f..cffa7624e15 100644 --- a/htdocs/install/mysql/tables/llx_accounting_account.sql +++ b/htdocs/install/mysql/tables/llx_accounting_account.sql @@ -34,7 +34,7 @@ create table llx_accounting_account fk_accounting_category integer DEFAULT 0, fk_user_author integer DEFAULT NULL, fk_user_modif integer DEFAULT NULL, - active tinyint DEFAULT 1 NOT NULL + active tinyint DEFAULT 1 NOT NULL, import_key varchar(14), extraparams varchar(255) -- for other parameters with json format )ENGINE=innodb; From 03eb8705768a847b5e772ca1677664f99438f3cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 20:16:12 +0200 Subject: [PATCH 0153/1137] Fix sql syntax error --- htdocs/core/lib/admin.lib.php | 2 +- htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql | 4 ++-- htdocs/install/mysql/tables/llx_extrafields.sql | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b3a7129507b..c97bd21e250 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -189,7 +189,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker // Add line buf to buffer if not a comment if (! preg_match('/^--/',$buf)) { - $buf=preg_replace('/([,;])\s*--.*$/','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer + $buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer $buffer .= trim($buf); } diff --git a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql index 269e73987ee..9ec89aad971 100644 --- a/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql +++ b/htdocs/install/mysql/tables/llx_accounting_bookkeeping.sql @@ -45,12 +45,12 @@ CREATE TABLE llx_accounting_bookkeeping fk_user_modif integer, -- | user making last change date_creation datetime, -- FEC:EcritureDate | creation date tms timestamp, -- | date last modification - fk_user integer NULL -- The id of user that validate the accounting source document + fk_user integer NULL, -- The id of user that validate the accounting source document code_journal varchar(32) NOT NULL, -- FEC:JournalCode journal_label varchar(255), -- FEC:JournalLib piece_num integer NOT NULL, -- FEC:EcritureNum | accounting source document validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification) - date_validated datetime -- FEC:ValidDate + date_validated datetime, -- FEC:ValidDate import_key varchar(14), extraparams varchar(255) -- for other parameters with json format ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index 101254ea186..c4f505a978a 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -23,7 +23,6 @@ create table llx_extrafields name varchar(64) NOT NULL, -- name of field into extrafields tables entity integer DEFAULT 1 NOT NULL, -- multi company id elementtype varchar(64) NOT NULL DEFAULT 'member', -- for which element this extra fields is for - tms timestamp, -- date of last update label varchar(255) NOT NULL, -- label to show for attribute type varchar(8), size varchar(8) DEFAULT NULL, @@ -41,5 +40,5 @@ create table llx_extrafields fk_user_author integer, -- user making creation fk_user_modif integer, -- user making last change datec datetime, -- date de creation - tms timestamp + tms timestamp -- date of last update )ENGINE=innodb; From c08d0aeda5fa6e28fc1eb3b000d5310d7e3686b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 21:01:26 +0200 Subject: [PATCH 0154/1137] Clean duplicate accounting account --- htdocs/install/mysql/migration/repair.sql | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index cd55b7b38e2..14d419f3c68 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -228,7 +228,7 @@ update llx_product set barcode = null where barcode in ('', '-1', '0'); update llx_societe set barcode = null where barcode in ('', '-1', '0'); --- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. +-- Sequence to removed duplicated values of llx_links. Use several times if you still have duplicate. drop table tmp_links_double; --select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2; create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2); @@ -237,7 +237,7 @@ delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_ drop table tmp_links_double; --- Sequence to removed duplicated values of barcode in llx_product. Use serveral times if you still have duplicate. +-- Sequence to removed duplicated values of barcode in llx_product. Use several times if you still have duplicate. drop table tmp_product_double; --select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2; create table tmp_product_double as (select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_product where barcode is not null group by barcode having count(rowid) >= 2); @@ -246,7 +246,7 @@ update llx_product set barcode = null where (rowid, barcode) in (select max_rowi drop table tmp_product_double; --- Sequence to removed duplicated values of barcode in llx_societe. Use serveral times if you still have duplicate. +-- Sequence to removed duplicated values of barcode in llx_societe. Use several times if you still have duplicate. drop table tmp_societe_double; --select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_societe where barcode is not null group by barcode having count(rowid) >= 2; create table tmp_societe_double as (select barcode, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_societe where barcode is not null group by barcode having count(rowid) >= 2); @@ -255,6 +255,15 @@ update llx_societe set barcode = null where (rowid, barcode) in (select max_rowi drop table tmp_societe_double; +-- Sequence to removed duplicated values of llx_accounting_account. Use several times if you still have duplicate. +drop table tmp_accounting_account_double; +--select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2; +create table tmp_accounting_account_double as (select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2); +--select * from tmp_accounting_account_double; +delete from llx_accounting_account where (rowid) in (select max_rowid from tmp_accounting_account_double); --update to avoid duplicate, delete to delete +drop table tmp_accounting_account_double; + + UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid; From 271d0c86c6cb487a899780a0e865b35115b82390 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 21:03:13 +0200 Subject: [PATCH 0155/1137] Fix sql install --- htdocs/install/mysql/data/llx_c_type_fees.sql | 70 +++++++++++++------ 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_type_fees.sql b/htdocs/install/mysql/data/llx_c_type_fees.sql index 868a210d891..752d6a6dd57 100644 --- a/htdocs/install/mysql/data/llx_c_type_fees.sql +++ b/htdocs/install/mysql/data/llx_c_type_fees.sql @@ -36,26 +36,50 @@ insert into llx_c_type_fees (code,label,active) values ('TF_OTHER', 'Other', insert into llx_c_type_fees (code,label,active) values ('TF_TRIP', 'Transportation', 1); insert into llx_c_type_fees (code,label,active) values ('TF_LUNCH', 'Lunch', 1); -INSERT INTO llx_c_type_fees (code, label, active, accountancy_code) VALUES -('EX_KME', 'ExpLabelKm', 1, '625100'), -('EX_FUE', 'ExpLabelFuelCV', 0, '606150'), -('EX_HOT', 'ExpLabelHotel', 0, '625160'), -('EX_PAR', 'ExpLabelParkingCV', 0, '625160'), -('EX_TOL', 'ExpLabelTollCV', 0, '625160'), -('EX_TAX', 'ExpLabelVariousTaxes', 0, '637800'), -('EX_IND', 'ExpLabelIndemnityTransportationSubscription', 0, '648100'), -('EX_SUM', 'ExpLabelMaintenanceSupply', 0, '606300'), -('EX_SUO', 'ExpLabelOfficeSupplies', 0, '606400'), -('EX_CAR', 'ExpLabelCarRental', 0, '613000'), -('EX_DOC', 'ExpLabelDocumentation', 0, '618100'), -('EX_CUR', 'ExpLabelCustomersReceiving', 0, '625710'), -('EX_OTR', 'ExpLabelOtherReceiving', 0, '625700'), -('EX_POS', 'ExpLabelPostage', 0, '626100'), -('EX_CAM', 'ExpLabelMaintenanceRepairCV', 0, '615300'), -('EX_EMM', 'ExpLabelEmployeesMeal', 0, '625160'), -('EX_GUM', 'ExpLabelGuestsMeal', 0, '625160'), -('EX_BRE', 'ExpLabelBreakfast', 0, '625160'), -('EX_FUE_VP', 'ExpLabelFuelPV', 0, '606150'), -('EX_TOL_VP', 'ExpLabelTollPV', 0, '625160'), -('EX_PAR_VP', 'ExpLabelParkingPV', 0, '625160'), -('EX_CAM_VP', 'ExpLabelMaintenanceRepairPV', 0, '615300'); \ No newline at end of file + +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_KME', 'ExpLabelKm', 1); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_FUE', 'ExpLabelFuelCV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_HOT', 'ExpLabelHotel', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_PAR', 'ExpLabelParkingCV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_TOL', 'ExpLabelTollCV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_TAX', 'ExpLabelVariousTaxes', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_IND', 'ExpLabelIndemnityTransSubscrip', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_SUM', 'ExpLabelMaintenanceSupply', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_SUO', 'ExpLabelOfficeSupplies', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_CAR', 'ExpLabelCarRental', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_DOC', 'ExpLabelDocumentation', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_CUR', 'ExpLabelCustomersReceiving', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_OTR', 'ExpLabelOtherReceiving', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_POS', 'ExpLabelPostage', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_CAM', 'ExpLabelMaintenanceRepairCV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_EMM', 'ExpLabelEmployeesMeal', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_GUM', 'ExpLabelGuestsMeal', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_BRE', 'ExpLabelBreakfast', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_FUE_VP', 'ExpLabelFuelPV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_TOL_VP', 'ExpLabelTollPV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_PAR_VP', 'ExpLabelParkingPV', 0); +INSERT INTO llx_c_type_fees (code, label, active) VALUES('EX_CAM_VP', 'ExpLabelMaintenanceRepairPV', 0); + +-- Set accoutancy_code for french accounting plan +--UPDATE llx_c_type_fees SET accountancy_code = '625100' WHERE code = 'EX_KME'; +--UPDATE llx_c_type_fees SET accountancy_code = '606150' WHERE code = 'EX_FUE'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_HOT'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_PAR'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_TOL'; +--UPDATE llx_c_type_fees SET accountancy_code = '637800' WHERE code = 'EX_TAX'; +--UPDATE llx_c_type_fees SET accountancy_code = '648100' WHERE code = 'EX_IND'; +--UPDATE llx_c_type_fees SET accountancy_code = '606300' WHERE code = 'EX_SUM'; +--UPDATE llx_c_type_fees SET accountancy_code = '606400' WHERE code = 'EX_SUO'; +--UPDATE llx_c_type_fees SET accountancy_code = '613000' WHERE code = 'EX_CAR'; +--UPDATE llx_c_type_fees SET accountancy_code = '618100' WHERE code = 'EX_DOC'; +--UPDATE llx_c_type_fees SET accountancy_code = '625710' WHERE code = 'EX_CUR'; +--UPDATE llx_c_type_fees SET accountancy_code = '625700' WHERE code = 'EX_OTR'; +--UPDATE llx_c_type_fees SET accountancy_code = '626100' WHERE code = 'EX_POS'; +--UPDATE llx_c_type_fees SET accountancy_code = '615300' WHERE code = 'EX_CAM'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_EMM'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_GUM'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_BRE'; +--UPDATE llx_c_type_fees SET accountancy_code = '606150' WHERE code = 'EX_FUE_VP'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_TOL_VP'; +--UPDATE llx_c_type_fees SET accountancy_code = '625160' WHERE code = 'EX_PAR_VP'; +--UPDATE llx_c_type_fees SET accountancy_code = '615300' WHERE code = 'EX_CAM_VP'; From a01bb27d7e892f35337866a55a3d55a4758e9d5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 21:53:29 +0200 Subject: [PATCH 0156/1137] FIX install process with DoliWamp --- htdocs/install/step1.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 486b156fcaf..339c03a32d3 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -510,7 +510,7 @@ if (! $error && $db->connected && $action == "set") print 'Ok'; // Si creation utilisateur admin demandee, on le cree - if (isset($db_create_user) && $db_create_user == "on") { + if (isset($db_create_user) && ($db_create_user == "1" || $db_create_user == "on")) { dolibarr_install_syslog("step1: create database user: " . $dolibarr_main_db_user); //print $conf->db->host." , ".$conf->db->name." , ".$conf->db->user." , ".$conf->db->port; @@ -614,7 +614,7 @@ if (! $error && $db->connected && $action == "set") // If database creation is asked, we create it - if (!$error && (isset($db_create_database) && $db_create_database == "on")) { + if (!$error && (isset($db_create_database) && ($db_create_database == "1" || $db_create_database == "on"))) { dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user); $newdb=getDoliDBInstance($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port); //print 'eee'.$conf->db->type." ".$conf->db->host." ".$userroot." ".$passroot." ".$conf->db->port." ".$newdb->connected." ".$newdb->forcecharset;exit; From c8f323b706c7c881611df7d3241bac8c50fd6b9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 21:55:34 +0200 Subject: [PATCH 0157/1137] Prepare 5.0.5 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 785e338fe09..e82fdf33d8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,7 @@ FIX: User id correction on holiday request FIX: value of user id filled to 0 in llx_bank_url when recording an expense report. FIX: we have to check if contact doesn't already exist on add_contact() function FIX: We should be able to insert data with value '0' into const +FIX: install process with DoliWamp ***** ChangeLog for 5.0.4 compared to 5.0.3 ***** FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances From 5cc02ac97fba378df36f4c50b3f7df4f7dd28c04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2017 22:07:29 +0200 Subject: [PATCH 0158/1137] Fix deletion of signatures --- build/generate_filelist_xml.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 07e87dd86bb..b227b544bab 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); * Main */ -if (empty($argv[1])) +if (empty($argv[1])) { print "Usage: ".$script_file." release=x.y.z\n"; exit -1; @@ -54,7 +54,7 @@ if ($release != DOL_VERSION) } //$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml'; -$outputdir=dirname(__FILE__).'/../htdocs/install'; +$outputdir=dirname(dirname(__FILE__)).'/htdocs/install'; print 'Delete current files '.$outputdir.'/filelist*.xml'."\n"; dol_delete_file($outputdir.'/filelist*.xml',0,1,1); From f10e89aa9f2790cad49c7cab5908951ab5671482 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 00:33:50 +0200 Subject: [PATCH 0159/1137] Fix utf8 bom forbidden --- htdocs/compta/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 0c4a16edf7b..1735033cab7 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -1,4 +1,4 @@ - * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin From ba3581354a5aaed80912756a8ae28128ab857cb3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 00:35:00 +0200 Subject: [PATCH 0160/1137] Prepare 5.0.6 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 537f8908de7..f3f60885697 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','5.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 61fadfd0e1a3c0c984a5624ce8ab41f0a5f67fb0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 27 Aug 2017 10:48:58 +0200 Subject: [PATCH 0161/1137] New numbering module for expense report + admin setup --- htdocs/admin/expensereport.php | 52 +++---- htdocs/core/modules/expensereport/index.html | 0 .../expensereport/mod_expensereport_jade.php | 134 ++++++++++++++++++ .../expensereport/mod_expensereport_sand.php | 126 ++++++++++++++++ .../expensereport/modules_expensereport.php | 84 +++++++++++ .../class/expensereport.class.php | 65 +++++---- 6 files changed, 411 insertions(+), 50 deletions(-) create mode 100644 htdocs/core/modules/expensereport/index.html create mode 100644 htdocs/core/modules/expensereport/mod_expensereport_jade.php create mode 100644 htdocs/core/modules/expensereport/mod_expensereport_sand.php diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index cd14d472057..fb4651be817 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -207,24 +207,26 @@ $head=expensereport_admin_prepare_head(); dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip'); -// Interventions numbering model /* -print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'',''); + * Expense report numbering model + */ + +print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"),'',''); print ''; print ''; -print ''; +print ''; print ''; -print ''; +print ''; print ''; -print ''; -print "\n"; +print ''; +print ''."\n"; clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/fichinter/"); + $dir = dol_buildpath($reldir."core/modules/expensereport/"); if (is_dir($dir)) { @@ -235,21 +237,20 @@ foreach ($dirmodels as $reldir) while (($file = readdir($handle))!==false) { - if (preg_match('/^(mod_.*)\.php$/i',$file,$reg)) + if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file)-3, 3) == 'php') { - $file = $reg[1]; - $classname = substr($file,4); + $file = substr($file, 0, dol_strlen($file)-4); require_once $dir.$file.'.php'; - $module = new $file; + $module = new $file($db); + + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->isEnabled()) { - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - print ''."\n"; print ''; - $ficheinter=new Fichinter($db); - $ficheinter->initAsSpecimen(); + $exp=new ExpenseReport($db); + $exp->initAsSpecimen(); // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
        '; - $nextval=$module->getNextValue($mysoc,$ficheinter); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $nextval=$module->getNextValue($exp); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') @@ -291,11 +294,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.=$langs->trans($module->error).'
        '; } } + print ''; - print ''; + print "\n"; } } } @@ -303,9 +307,7 @@ foreach ($dirmodels as $reldir) } } } - -print '
        '.$langs->trans("Name").''.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
        '.$langs->trans("ShortInfo").'
        '.$module->nom."\n"; print $module->info(); @@ -264,24 +265,26 @@ foreach ($dirmodels as $reldir) print ''; - if ($conf->global->FICHEINTER_ADDON == $classname) + if ($conf->global->EXPENSEREPORT_ADDON == $file) { print img_picto($langs->trans("Activated"),'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; } print ''; print $form->textwithpicto('',$htmltooltip,1,0); print '

        '; -*/ +print "
        \n"; /* * Documents models for Interventions diff --git a/htdocs/core/modules/expensereport/index.html b/htdocs/core/modules/expensereport/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php new file mode 100644 index 00000000000..3ccfc8748cb --- /dev/null +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -0,0 +1,134 @@ + + * + * 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 3 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, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/expensereport/mod_expensereport_jade.php + * \ingroup expensereport + * \brief File of class to manage customer order numbering rules Jade + */ +require_once DOL_DOCUMENT_ROOT .'/core/modules/expensereport/modules_expensereport.php'; + +/** + * Class to manage customer order numbering rules Jade + */ +class mod_expensereport_jade extends ModeleNumRefExpenseReport +{ + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $prefix='ER'; + var $error=''; + var $nom='Jade'; + + + /** + * Return description of numbering module + * + * @return string Text with description + */ + function info() + { + global $langs; + return $langs->trans("SimpleNumRefModelDesc",$this->prefix); + } + + + /** + * Renvoi un exemple de numerotation + * + * @return string Example + */ + function getExample() + { + return $this->prefix."0501-0001"; + } + + + /** + * Test si les numeros deje en vigueur dans la base ne provoquent pas de + * de conflits qui empechera cette numerotation de fonctionner. + * + * @return boolean false si conflit, true si ok + */ + function canBeActivated() + { + global $conf,$langs,$db; + + $coyymm=''; $max=''; + + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport"; + $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $coyymm = substr($row[0],0,6); $max=$row[0]; } + } + if ($coyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$coyymm)) + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorNumRefModel', $max); + return false; + } + + return true; + } + + /** + * Return next free value + * + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + function getNextValue($object) + { + global $db,$conf; + + // D'abord on recupere la valeur max + $posindice=8; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport"; + $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $max = intval($obj->max); + else $max=0; + } + else + { + dol_syslog("mod_expensereport_jade::getNextValue", LOG_DEBUG); + return -1; + } + + //$date=time(); + $date=$object->date; + $yymm = strftime("%y%m",$date); + + if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s",$max+1); + + dol_syslog("mod_expensereport_jade::getNextValue return ".$this->prefix.$yymm."-".$num); + return $this->prefix.$yymm."-".$num; + } +} diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php new file mode 100644 index 00000000000..cbc82bf17ae --- /dev/null +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -0,0 +1,126 @@ + + * + * 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 3 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, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/expensereport/mod_expensereport_sand.php + * \ingroup expensereport + * \brief Fichier contenant la classe du modele de numerotation de reference de note de frais Sand + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/expensereport/modules_expensereport.php'; + + +/** + * Class to manage customer order numbering rules Sand + */ +class mod_expensereport_sand extends ModeleNumRefExpenseReport +{ + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $error = ''; + var $nom = 'Sand'; + + + /** + * Renvoi la description du modele de numerotation + * + * @return string Texte descripif + */ + function info() + { + global $conf,$langs; + + $langs->load("bills"); + + $form = new Form($this->db); + + $texte = $langs->trans('GenericNumRefModelDesc')."
        \n"; + $texte.= '
        '; + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= ''; + + $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order")); + $tooltip.=$langs->trans("GenericMaskCodes2"); + $tooltip.=$langs->trans("GenericMaskCodes3"); + $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Order"),$langs->transnoentities("Order")); + $tooltip.=$langs->trans("GenericMaskCodes5"); + + // Parametrage du prefix + $texte.= ''; + $texte.= ''; + + $texte.= ''; + + $texte.= ''; + + $texte.= '
        '.$langs->trans("Mask").':'.$form->textwithpicto('',$tooltip,1,1).' 
        '; + $texte.= '
        '; + + return $texte; + } + + /** + * Renvoi un exemple de numerotation + * + * @return string Example + */ + function getExample() + { + global $conf,$langs,$mysoc; + + $old_code_client=$mysoc->code_client; + $mysoc->code_client='CCCCCCCCCC'; + $numExample = $this->getNextValue($mysoc,''); + $mysoc->code_client=$old_code_client; + + if (! $numExample) + { + $numExample = $langs->trans('NotConfigured'); + } + return $numExample; + } + + /** + * Return next free value + * + * @param Societe $objsoc Object thirdparty + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + function getNextValue($objsoc,$object) + { + global $db,$conf; + + require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; + + // We get cursor rule + $mask=$conf->global->EXPENSEREPORT_SAND_MASK; + + if (! $mask) + { + $this->error='NotConfigured'; + return 0; + } + + $numFinal=get_next_value($db,$mask,'expensereport','ref','',$objsoc,$object->date); + + return $numFinal; + } +} + diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php index 153dfb37007..e0adf1fb47e 100644 --- a/htdocs/core/modules/expensereport/modules_expensereport.php +++ b/htdocs/core/modules/expensereport/modules_expensereport.php @@ -65,3 +65,87 @@ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $ { return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } + +/** + * \class ModeleNumRefExpenseReport + * \brief Parent class for numbering masks of expense reports + */ + +abstract class ModeleNumRefExpenseReport +{ + var $error=''; + + /** + * Return if a module can be used or not + * + * @return boolean true if module can be used + */ + function isEnabled() + { + return true; + } + + /** + * Renvoie la description par defaut du modele de numerotation + * + * @return string Texte descripif + */ + function info() + { + global $langs; + $langs->load("orders"); + return $langs->trans("NoDescription"); + } + + /** + * Renvoie un exemple de numerotation + * + * @return string Example + */ + function getExample() + { + global $langs; + $langs->load("trips"); + return $langs->trans("NoExample"); + } + + /** + * Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner. + * + * @return boolean false si conflit, true si ok + */ + function canBeActivated() + { + return true; + } + + /** + * Renvoie prochaine valeur attribuee + * + * @param Societe $objsoc Object thirdparty + * @param Object $object Object we need next value for + * @return string Valeur + */ + function getNextValue($objsoc,$object) + { + global $langs; + return $langs->trans("NotAvailable"); + } + + /** + * Renvoie version du module numerotation + * + * @return string Valeur + */ + function getVersion() + { + global $langs; + $langs->load("admin"); + + if ($this->version == 'development') return $langs->trans("VersionDevelopment"); + if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); + if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; + return $langs->trans("NotAvailable"); + } +} \ No newline at end of file diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index e4ee53e174a..eb6116f4edf 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1457,36 +1457,51 @@ class ExpenseReport extends CommonObject */ function getNextNumRef() { - global $conf; + global $langs, $conf; + $langs->load("trips"); - $expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR; - $num_car = (empty($conf->global->NDF_NUM_CAR_REF))?"5":$conf->global->NDF_NUM_CAR_REF; + if (! empty($conf->global->EXPENSEREPORT_ADDON)) + { + $mybool=false; - $sql = 'SELECT MAX(de.ref_number_int) as max'; - $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' de'; + $file = $conf->global->EXPENSEREPORT_ADDON.".php"; + $classname = $conf->global->EXPENSEREPORT_ADDON; - $result = $this->db->query($sql); + // Include file with class + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) + { + $dir = dol_buildpath($reldir."core/modules/expensereport/"); - if($this->db->num_rows($result) > 0): - $objp = $this->db->fetch_object($result); - $this->ref = $objp->max; - $this->ref++; - while(strlen($this->ref) < $num_car): - $this->ref = "0".$this->ref; - endwhile; - else: - $this->ref = 1; - while(strlen($this->ref) < $num_car): - $this->ref = "0".$this->ref; - endwhile; - endif; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } - if ($result): - return 1; - else: - $this->error=$this->db->error(); - return -1; - endif; + if (! $mybool) + { + dol_print_error('',"Failed to include file ".$file); + return ''; + } + + $obj = new $classname(); + $numref = $obj->getNextValue($this); + + if ($numref != "") + { + return $numref; + } + else + { + $this->error=$obj->error; + //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); + return ""; + } + } + else + { + print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_NotDefined"); + return ""; + } } /** From 9eeacd89820ab3a77c1831166a488619cc9709ec Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 27 Aug 2017 10:58:01 +0200 Subject: [PATCH 0162/1137] Fix const name --- .../modules/expensereport/mod_expensereport_sand.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index cbc82bf17ae..9a638694665 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/expensereport/modules_expenserepo /** - * Class to manage customer order numbering rules Sand + * Class to manage expense report numbering rules Sand */ class mod_expensereport_sand extends ModeleNumRefExpenseReport { @@ -52,18 +52,18 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport $texte.= '
        '; $texte.= ''; $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; - $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order")); - $tooltip.=$langs->trans("GenericMaskCodes2"); + $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("ExpenseReport"),$langs->transnoentities("ExpenseReport")); + //$tooltip.=$langs->trans("GenericMaskCodes2"); $tooltip.=$langs->trans("GenericMaskCodes3"); - $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Order"),$langs->transnoentities("Order")); + $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("ExpenseReport"),$langs->transnoentities("ExpenseReport")); $tooltip.=$langs->trans("GenericMaskCodes5"); // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; From 3f7eea2e0aba36d94459d910dbe413a32c216f02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 12:06:46 +0200 Subject: [PATCH 0163/1137] NEW Can set language on extrafields --- htdocs/compta/bank/card.php | 38 +--------- htdocs/core/class/commonobject.class.php | 3 + htdocs/core/class/extrafields.class.php | 72 +++++++++++-------- htdocs/core/tpl/extrafields_view.tpl.php | 4 ++ .../install/mysql/migration/6.0.0-7.0.0.sql | 2 + .../install/mysql/tables/llx_extrafields.sql | 2 +- .../core/modules/modMyModule.class.php | 10 +-- 7 files changed, 57 insertions(+), 74 deletions(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 1f55698d13f..6aa7a950683 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -560,11 +560,7 @@ else $_GET["id"]=$object->id; } - /* - * Affichage onglets - */ - - // Onglets + // Show tabs $head=bank_prepare_head($object); dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account'); @@ -592,18 +588,6 @@ else print '
        '.$langs->trans("Mask").':'.$form->textwithpicto('',$tooltip,1,1).''.$form->textwithpicto('',$tooltip,1,1).' 
        '; - - // Ref - /* - print ''; - print '';*/ - - // Label - /*print ''; - print '';*/ - // Type print ''; print ''; @@ -616,26 +600,6 @@ else print $langs->trans("Currency".$selectedcode); print ''; - // Status - /*print ''; - print '';*/ - - // Country - /* - print ''; - - // State - print '';*/ - // Conciliate print ''; print '"; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7e42e143b6a..3ff082a9ec1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3401,12 +3401,12 @@ class Form /** * Return list of categories having choosed type * - * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. - * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element) - * @param string $htmlname HTML field name - * @param int $maxlength Maximum length for labels - * @param int $excludeafterid Exclude all categories after this leaf in category tree. - * @param int $outputmode 0=HTML select string, 1=Array + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated. + * @param string $selected Id of category preselected or 'auto' (autoselect category if there is only one element) + * @param string $htmlname HTML field name + * @param int $maxlength Maximum length for labels + * @param int $excludeafterid Exclude all categories after this leaf in category tree. + * @param int $outputmode 0=HTML select string, 1=Array * @return string * @see select_categories */ @@ -3449,7 +3449,7 @@ class Form else { $cat = new Categorie($this->db); - $cate_arbo = $cat->get_full_arbo($type,$excludeafterid); + $cate_arbo = $cat->get_full_arbo($type, $excludeafterid); } $output = ' + + + diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 5a9a5b43d93..beb1e34055e 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -54,11 +54,11 @@ ?> // Case of computed field - if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { - jQuery("tr.extra_computed_value").show(); + if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') { + jQuery("tr.extra_computed_value").show(); } else { computed_value.val(''); jQuery("tr.extra_computed_value").hide(); - } + } if (computed_value.val()) { console.log("We enter a computed formula"); @@ -73,7 +73,7 @@ jQuery("#default_value, #unique, #required, #alwayseditable, #ishidden, #list").attr('disabled', false); jQuery("tr.extra_default_value, tr.extra_unique, tr.extra_required, tr.extra_alwayseditable, tr.extra_ishidden, tr.extra_list").show(); } - + if (type == 'date') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); } else if (type == 'datetime') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} else if (type == 'double') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();} @@ -91,19 +91,19 @@ else if (type == 'separate') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();} else { // type = string size.val('').prop('disabled', true); - unique.removeAttr('disabled'); + unique.removeAttr('disabled'); } if (type == 'separate') { - required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true); - jQuery('#size, #default_value').val('').prop('disabled', true); + required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); list.val('').prop('disabled', true); + jQuery('#size, #default_value').val('').prop('disabled', true); } else { default_value.removeAttr('disabled'); - required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled'); - } + required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); list.val('').removeAttr('disabled'); + } } init_typeoffields(jQuery("#type").val()); jQuery("#type").change(function() { @@ -113,7 +113,7 @@ // If we enter a formula, we disable other fields jQuery("#computed_value").keyup(function() { init_typeoffields(jQuery('#type').val()); - }); + }); }); @@ -129,23 +129,20 @@
        '.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref'); - print '
        '.$langs->trans("Label").''.$object->label.'
        '.$langs->trans("AccountType").''.$object->type_lib[$object->type].'
        '.$langs->trans("Status").''.$object->getLibStatut(4).'
        '.$langs->trans("BankAccountCountry").''; - if ($object->country_id > 0) - { - $img=picto_from_langcode($object->country_code); - print $img?$img.' ':''; - print getCountry($object->getCountryCode(),0,$db); - } - print '
        '.$langs->trans('State').''; - if ($object->state_id > 0) print getState($object->state_id); - print '
        '.$langs->trans("Conciliable").''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 50ccf362de6..450bc4ba393 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4565,6 +4565,9 @@ abstract class CommonObject $e = 0; foreach($extrafields->attribute_label as $key=>$label) { + // Load language if required + if (! empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + if (is_array($params) && count($params)>0) { if (array_key_exists('colspan',$params)) { $colspan=$params['colspan']; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index eb04115ca84..7e015d951b1 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -64,7 +64,9 @@ class ExtraFields var $attribute_alwayseditable; // Array to store permission to check var $attribute_perms; - // Array to store permission to check + // Array to store language file to translate label of values + var $attribute_langfile; + // Array to store if field is visible by default on list var $attribute_list; // Array to store if extra field is hidden var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table. @@ -117,6 +119,7 @@ class ExtraFields $this->attribute_unique = array(); $this->attribute_required = array(); $this->attribute_perms = array(); + $this->attribute_langfile = array(); $this->attribute_list = array(); $this->attribute_hidden = array(); } @@ -124,25 +127,26 @@ class ExtraFields /** * Add a new extra field parameter * - * @param string $attrname Code of attribute - * @param string $label label of attribute - * @param int $type Type of attribute ('boolean', 'int', 'text', 'varchar', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...) - * @param int $pos Position of attribute - * @param string $size Size/length of attribute - * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not - * @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue') - * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @param int $alwayseditable Is attribute always editable regardless of the document status - * @param string $perms Permission to check - * @param int $list Into list view by default - * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table) - * @param string $computed Computed value - * @param string $entity Entity of extrafields + * @param string $attrname Code of attribute + * @param string $label label of attribute + * @param int $type Type of attribute ('boolean', 'int', 'text', 'varchar', 'date', 'datehour','price','phone','mail','password','url','select','checkbox', ...) + * @param int $pos Position of attribute + * @param string $size Size/length of attribute + * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) + * @param int $unique Is field unique or not + * @param int $required Is field required or not + * @param string $default_value Defaulted value (In database. use the default_value feature for default value on screen. Example: '', '0', 'null', 'avalue') + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status + * @param string $perms Permission to check + * @param int $list Into list view by default + * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table) + * @param string $computed Computed value + * @param string $entity Entity of extrafields + * @param string $langfile Language file * @return int <=0 if KO, >0 if OK */ - function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0, $ishidden=0, $computed='', $entity='') + function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $computed='', $entity='', $langfile='') { if (empty($attrname)) return -1; if (empty($label)) return -1; @@ -159,7 +163,7 @@ class ExtraFields if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate') { // Add declaration of field into table - $result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $ishidden, $default, $computed, $entity); + $result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $ishidden, $default, $computed, $entity, $langfile); $err2=$this->errno; if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { @@ -271,7 +275,7 @@ class ExtraFields * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @param int $unique Is field unique or not * @param int $required Is field required or not - * @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Into list view by default @@ -279,9 +283,10 @@ class ExtraFields * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value * @param string $entity Entity of extrafields + * @param string $langfile Language file * @return int <=0 if KO, >0 if OK */ - private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='',$entity='') + private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0, $default='', $computed='',$entity='', $langfile='') { global $conf,$user; @@ -320,6 +325,7 @@ class ExtraFields $sql.= " param,"; $sql.= " alwayseditable,"; $sql.= " perms,"; + $sql.= " langs,"; $sql.= " list,"; $sql.= " ishidden,"; $sql.= " fielddefault,"; @@ -340,6 +346,7 @@ class ExtraFields $sql.= " '".$params."',"; $sql.= " '".$alwayseditable."',"; $sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").","; + $sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").","; $sql.= " ".$list.","; $sql.= " ".$ishidden.","; $sql.= " ".($default?"'".$this->db->escape($default)."'":"null").","; @@ -480,9 +487,10 @@ class ExtraFields * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value * @param string $entity Entity of extrafields + * @param string $langfile Language file * @return int >0 if OK, <=0 if KO */ - function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='',$ishidden=0,$default='',$computed='',$entity='') + function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $ishidden=0, $default='', $computed='', $entity='', $langfile='') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -530,7 +538,7 @@ class ExtraFields { if ($label) { - $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$ishidden,$default,$computed,$entity); + $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$ishidden,$default,$computed,$entity,$langfile); } if ($result > 0) { @@ -585,12 +593,13 @@ class ExtraFields * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value * @param string $entity Entity of extrafields + * @param string $langfile Language file * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='',$entity='') + private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='',$entity='',$langfile='') { global $conf, $user; - dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed.", ".$entity); + dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed.", ".$entity.", ".$langfile); // Clean parameters if ($elementtype == 'thirdparty') $elementtype='societe'; @@ -624,6 +633,7 @@ class ExtraFields $sql.= " fieldunique,"; $sql.= " fieldrequired,"; $sql.= " perms,"; + $sql.= " langs,"; $sql.= " pos,"; $sql.= " alwayseditable,"; $sql.= " param,"; @@ -644,6 +654,7 @@ class ExtraFields $sql.= " '".$unique."',"; $sql.= " '".$required."',"; $sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").","; + $sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").","; $sql.= " '".$pos."',"; $sql.= " '".$alwayseditable."',"; $sql.= " '".$param."',"; @@ -702,7 +713,7 @@ class ExtraFields // We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management. dol_syslog("fetch_name_optionals_label elementtype=".$elementtype); - $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,list,ishidden,fielddefault,fieldcomputed"; + $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,ishidden,fielddefault,fieldcomputed"; $sql .= ",entity"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " WHERE entity IN (0,".$conf->entity.")"; @@ -722,8 +733,6 @@ class ExtraFields $array_name_label[$tab->name]=$tab->label; } - - // Old usage $this->attribute_type[$tab->name]=$tab->type; $this->attribute_label[$tab->name]=$tab->label; @@ -737,12 +746,11 @@ class ExtraFields $this->attribute_pos[$tab->name]=$tab->pos; $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; $this->attribute_perms[$tab->name]=$tab->perms; + $this->attribute_langfile[$tab->langs]=$tab->langs; $this->attribute_list[$tab->name]=$tab->list; $this->attribute_hidden[$tab->name]=$tab->ishidden; $this->attribute_entityid[$tab->name]=$tab->entity; - - // New usage $this->attributes[$tab->elementtype]['type'][$tab->name]=$tab->type; $this->attributes[$tab->elementtype]['label'][$tab->name]=$tab->label; @@ -756,6 +764,7 @@ class ExtraFields $this->attributes[$tab->elementtype]['pos'][$tab->name]=$tab->pos; $this->attributes[$tab->elementtype]['alwayseditable'][$tab->name]=$tab->alwayseditable; $this->attributes[$tab->elementtype]['perms'][$tab->name]=$tab->perms; + $this->attributes[$tab->elementtype]['langfile'][$tab->name]=$tab->langs; $this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list; $this->attributes[$tab->elementtype]['ishidden'][$tab->name]=$tab->ishidden; $this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity; @@ -820,7 +829,7 @@ class ExtraFields $unique=$this->attribute_unique[$key]; $required=$this->attribute_required[$key]; $param=$this->attribute_param[$key]; - $perms=$this->attribute_perms[$key]; + $langfile=$this->attribute_langfile[$key]; $list=$this->attribute_list[$key]; $hidden=$this->attribute_hidden[$key]; @@ -1352,6 +1361,7 @@ class ExtraFields $required=$this->attribute_required[$key]; $params=$this->attribute_param[$key]; $perms=$this->attribute_perms[$key]; + $langfile=$this->attribute_langfile[$key]; $list=$this->attribute_list[$key]; $hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table. diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index f553cbdc4f0..56eb8652d2b 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -37,10 +37,14 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +//var_dump($extrafields->attributes); if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { + // Load language if required + if (! empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + if ($action == 'edit_extras') { $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]); diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 5759423abbb..68cfa63fa16 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -25,6 +25,8 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64); + ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL; ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date; diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index c4f505a978a..3b9a9b2d72b 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -35,7 +35,7 @@ create table llx_extrafields alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status param text, -- extra parameters to define possible values of field list integer DEFAULT 0, -- list of values for field that are combo lists - langs varchar(24), -- example: fileofmymodule@mymodule + langs varchar(64), -- example: fileofmymodule@mymodule ishidden integer DEFAULT 0, -- Can be foreign key of external system fk_user_author integer, -- user making creation fk_user_modif integer, -- user making last change diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 77f860ba92c..00199f1d3a4 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -311,11 +311,11 @@ class modMyModule extends DolibarrModules include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty'); - //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project'); - //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account'); - //$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1); - //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user'); + //$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule'); + //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule'); + //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule'); + //$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1); + //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule'); $sql = array(); From 502ac19a0af335ca90021bcf341cb88f8f01ad97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 12:28:59 +0200 Subject: [PATCH 0164/1137] Fix regression on categories --- htdocs/categories/class/categorie.class.php | 45 ++++++++++++--------- htdocs/categories/index.php | 2 +- htdocs/compta/bank/card.php | 2 +- htdocs/core/class/html.form.class.php | 14 +++---- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index d1b8975eaf4..538f07133c5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -62,14 +62,15 @@ class Categorie extends CommonObject * @note This array should be remove in future, once previous constants are moved to the string value. Deprecated */ private $MAP_ID = array( - 'product' => 0, - 'supplier' => 1, - 'customer' => 2, - 'member' => 3, - 'contact' => 4, - 'account' => 5, - 'project' => 6, - 'user' => 7, + 'product' => 0, + 'supplier' => 1, + 'customer' => 2, + 'member' => 3, + 'contact' => 4, + 'bank_account' => 5, + 'project' => 6, + 'user' => 7, + 'bank_line' => 8, ); public static $MAP_ID_TO_CODE = array( 0 => 'product', @@ -77,9 +78,10 @@ class Categorie extends CommonObject 2 => 'customer', 3 => 'member', 4 => 'contact', - 5 => 'account', + 5 => 'bank_account', 6 => 'project', 7 => 'user', + 8 => 'bank_line', ); /** @@ -94,7 +96,8 @@ class Categorie extends CommonObject 'member' => 'member', 'contact' => 'socpeople', 'user' => 'user', - 'account' => 'account', + 'account' => 'account', // old for bank_account + 'bank_account' => 'account', 'project' => 'project', ); /** @@ -109,7 +112,8 @@ class Categorie extends CommonObject 'member' => 'member', 'contact' => 'contact', 'user' => 'user', - 'account' => 'account', + 'account' => 'account', // old for bank_account + 'bank_account'=> 'account', 'project' => 'project', ); /** @@ -124,7 +128,8 @@ class Categorie extends CommonObject 'member' => 'Adherent', 'contact' => 'Contact', 'user' => 'User', - 'account' => 'Account', + 'account' => 'Account', // old for bank account + 'bank_account' => 'Account', 'project' => 'Project', ); /** @@ -947,8 +952,8 @@ class Categorie extends CommonObject * fulllabel = nom avec chemin complet de la categorie * fullpath = chemin complet compose des id * - * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...). - * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. + * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...). + * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. * * @return array Array of categories. this->cats and this->motherof are set. */ @@ -1340,11 +1345,11 @@ class Categorie extends CommonObject * Return list of categories (object instances or labels) linked to element of id $id and type $type * Should be named getListOfCategForObject * - * @param int $id Id of element - * @param int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) - * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category - * labels, 'id'= Get array of category IDs - * @return mixed Array of category objects or < 0 if KO + * @param int $id Id of element + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) + * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category + * labels, 'id'= Get array of category IDs + * @return mixed Array of category objects or < 0 if KO */ function containing($id, $type, $mode='object') { @@ -1352,7 +1357,7 @@ class Categorie extends CommonObject if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; - if ($type == Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code + if ($type === Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code { // Load bank groups $sql = "SELECT c.label, c.rowid"; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index c751fad67a7..149eb160a78 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -54,7 +54,7 @@ elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCat elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; } elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; } elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; } -elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='account'; } +elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; } elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; } elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; } else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; } diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 6aa7a950683..7c94e03e339 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -658,7 +658,7 @@ else // Categories if ($conf->categorie->enabled) { print '
        '.$langs->trans("Categories").''; - print $form->showCategories($object->id,'account',1); + print $form->showCategories($object->id,'bank_account',1); print "
        trans("Position"); ?>
        trans("Position"); ?>
        trans("LanguageFile"); ?>
        textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>">
        attribute_type[$attrname]; -$size=$extrafields->attribute_size[$attrname]; -$computed=$extrafields->attribute_computed[$attrname]; -$default=$extrafields->attribute_default[$attrname]; -$unique=$extrafields->attribute_unique[$attrname]; -$required=$extrafields->attribute_required[$attrname]; -$pos=$extrafields->attribute_pos[$attrname]; -$alwayseditable=$extrafields->attribute_alwayseditable[$attrname]; -$param=$extrafields->attribute_param[$attrname]; -$perms=$extrafields->attribute_perms[$attrname]; -$list=$extrafields->attribute_list[$attrname]; -if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) { - $ishidden=$extrafields->attribute_hidden[$attrname]; -} -if ($conf->multicompany->enabled) { - $entitycurrentorall=$extrafields->attribute_entityid[$attrname]; -} +$type=$extrafields->attributes[$elementtype]['type'][$attrname]; +$size=$extrafields->attributes[$elementtype]['size'][$attrname]; +$computed=$extrafields->attributes[$elementtype]['computed'][$attrname]; +$default=$extrafields->attributes[$elementtype]['default'][$attrname]; +$unique=$extrafields->attributes[$elementtype]['unique'][$attrname]; +$required=$extrafields->attributes[$elementtype]['required'][$attrname]; +$pos=$extrafields->attributes[$elementtype]['pos'][$attrname]; +$alwayseditable=$extrafields->attributes[$elementtype]['alwayseditable'][$attrname]; +$param=$extrafields->attributes[$elementtype]['param'][$attrname]; +$perms=$extrafields->attributes[$elementtype]['perms'][$attrname]; +$langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname]; +$list=$extrafields->attributes[$elementtype]['list'][$attrname]; +$ishidden=$extrafields->attributes[$elementtype]['hidden'][$attrname]; +$entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname]; if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) { @@ -220,7 +217,9 @@ else - + + + diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 84ee52167a9..b4cce97957a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -345,6 +345,7 @@ AddCRIfTooLong=There is no automatic wrapping, so if line is out of page on docu ConfirmPurge=Are you sure you want to execute this purge?
        This will delete definitely all your data files with no way to restore them (ECM files, attached files...). MinLength=Minimum length LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory +LanguageFile=Language file ExamplesWithCurrentSetup=Examples with current running setup ListOfDirectories=List of OpenDocument templates directories ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.

        Put here full path of directories.
        Add a carriage return between eah directory.
        To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

        Files in those directories must end with .odt or .ods. From d800d1076665d2a07dc65651ad5cff7b865f87f7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 27 Aug 2017 13:19:57 +0200 Subject: [PATCH 0166/1137] Fix: use resprint instead resarray --- htdocs/core/lib/security2.lib.php | 15 ++++++++++----- htdocs/core/tpl/login.tpl.php | 8 +++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 817fd2be8da..39cfb715a28 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2008-2017 Regis Houssin * * 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 @@ -201,11 +201,16 @@ function dol_loginfunction($langs,$conf,$mysoc) $demopassword=$tab[1]; } - // Execute hook getLoginPageOptions - // Should be an array with differents options in $hookmanager->resArray + // Execute hook getLoginPageOptions (for table) $parameters=array('entity' => GETPOST('entity','int')); - $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook. - $morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints + $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. + //$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints + $morelogincontent = $hookmanager->resPrint; + + // Execute hook getLoginPageExtraOptions (eg for js) + $parameters=array('entity' => GETPOST('entity','int')); + $reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks. + $moreloginextracontent = $hookmanager->resPrint; // Login $login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin)); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 35f6f857526..7b6ad88075b 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -123,7 +123,7 @@ if ($disablenofollow) echo ''; $option) { if ($format == 'table') { @@ -131,6 +131,9 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) { echo $option; } } +}*/ +if (! empty($morelogincontent)) { + echo $morelogincontent; } ?> Date: Sun, 27 Aug 2017 13:24:29 +0200 Subject: [PATCH 0167/1137] Fix: comment old code --- htdocs/core/tpl/login.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 7b6ad88075b..6abeaf332a3 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -281,7 +281,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?> $option) { if ($format == 'js') { @@ -289,7 +289,7 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) { echo $option."\n"; } } -} +}*/ if (! empty($moreloginextracontent)) { echo $moreloginextracontent; } From 64bbf35812df3d4360115e222d9f3ca7f91e94b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 13:28:37 +0200 Subject: [PATCH 0168/1137] Debug modulebuilder --- htdocs/ecm/docfile.php | 6 +- htdocs/langs/en_US/modulebuilder.lang | 3 + htdocs/modulebuilder/index.php | 114 +++++++++++++++----------- 3 files changed, 74 insertions(+), 49 deletions(-) diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php index 577ac3e0262..61cce03cc1d 100644 --- a/htdocs/ecm/docfile.php +++ b/htdocs/ecm/docfile.php @@ -268,11 +268,13 @@ $filepath=$relativepath.$file->label; $rellink.='&file='.urlencode($filepath); $fulllink=$urlwithroot.$rellink; print img_picto('','object_globe.png').' '; -print ''; -print ' '.$langs->trans("Download").''; +print ''; +print ' '.$langs->trans("Download").''; print ''; print '
        trans("Position"); ?>
        trans("Position"); ?>
        trans("LanguageFile"); ?>
        textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
        '; +print ajax_autoselect('downloadlink'); + dol_fiche_end(); if ($_GET["action"] == 'edit') diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 034deb7c800..1b9b00a28d2 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -35,6 +35,9 @@ ClassFile=File for PHP DAO CRUD class ApiClassFile=File for PHP API class PageForList=PHP page for list of record PageForCreateEditView=PHP page to create/edit/view a record +PageForAgendaTab=PHP page for event tab +PageForDocumentTab=PHP page for document tab +PageForNoteTab=PHP page for note tab PathToModulePackage=Path to zip of module/application package PathToModuleDocumentation=Path to file of module/application documentation SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d0da95b6947..91bf15787ee 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -411,7 +411,7 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) $filetogenerate = array( 'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_note.php'=>strtolower($objectname).'_note.php', - 'myobject_document.php'=>strtolower($objectname).'_note.php', + 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', @@ -1227,6 +1227,7 @@ elseif (! empty($module)) foreach($listofobject as $fileobj) { if (preg_match('/^api_/',$fileobj['name'])) continue; + if (preg_match('/^actions_/',$fileobj['name'])) continue; $tmpcontent=file_get_contents($fileobj['fullname']); if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims',$tmpcontent,$reg)) @@ -1236,7 +1237,7 @@ elseif (! empty($module)) if (empty($firstobjectname)) $firstobjectname = $objectname; } - $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname; + $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname; $head3[$h][1] = $objectname; $head3[$h][2] = $objectname; $h++; @@ -1302,14 +1303,17 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { try { - $pathtoclass = strtolower($module).'/class/'.strtolower($tabobj).'.class.php'; - $pathtoapi = strtolower($module).'/class/api_'.strtolower($tabobj).'.class.php'; - $pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php'; - $pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php'; - $pathtophpunit = strtolower($module).'/test/phpunit/'.$tabobj.'Test.php'; - $pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql'; + $pathtoclass = strtolower($module).'/class/'.strtolower($tabobj).'.class.php'; + $pathtoapi = strtolower($module).'/class/api_'.strtolower($tabobj).'.class.php'; + $pathtoagenda = strtolower($module).'/'.strtolower($tabobj).'_agenda.php'; + $pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php'; + $pathtodocument = strtolower($module).'/'.strtolower($tabobj).'_document.php'; + $pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php'; + $pathtonote = strtolower($module).'/'.strtolower($tabobj).'_note.php'; + $pathtophpunit = strtolower($module).'/test/phpunit/'.$tabobj.'Test.php'; + $pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql'; $pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql'; - $pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql'; + $pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql'; print '
        '; print ' '.$langs->trans("ClassFile").' : '.$pathtoclass.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; @@ -1335,6 +1339,15 @@ elseif (! empty($module)) print '
        '; print ' '.$langs->trans("PageForCreateEditView").' : '.$pathtocard.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
        '; + print ' '.$langs->trans("PageForAgendaTab").' : '.$pathtoagenda.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
        '; + print ' '.$langs->trans("PageForDocumentTab").' : '.$pathtodocument.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
        '; + print ' '.$langs->trans("PageForNoteTab").' : '.$pathtonote.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
        '; print '


        '; @@ -1708,51 +1721,58 @@ elseif (! empty($module)) print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); print "\n"; - foreach ($cronjobs as $cron) + if (count($cronjobs)) { - print ''; + foreach ($cronjobs as $cron) + { + print ''; - print ''; - print $cron['label']; - print ''; + print ''; + print $cron['label']; + print ''; - print ''; - if ($cron['jobtype']=='method') - { - $text=$langs->trans("CronClass"); - $texttoshow=$langs->trans('CronModule').': '.$module.'
        '; - $texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'
        '; - $texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'
        '; - $texttoshow.=$langs->trans('CronMethod').': '. $cron['method']; - $texttoshow.='
        '.$langs->trans('CronArgs').': '. $cron['parameters']; - $texttoshow.='
        '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); - } - elseif ($cron['jobtype']=='command') - { - $text=$langs->trans('CronCommand'); - $texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']); - $texttoshow.='
        '.$langs->trans('CronArgs').': '. $cron['parameters']; - $texttoshow.='
        '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); - } - print $form->textwithpicto($text, $texttoshow, 1); - print ''; + print ''; + if ($cron['jobtype']=='method') + { + $text=$langs->trans("CronClass"); + $texttoshow=$langs->trans('CronModule').': '.$module.'
        '; + $texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'
        '; + $texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'
        '; + $texttoshow.=$langs->trans('CronMethod').': '. $cron['method']; + $texttoshow.='
        '.$langs->trans('CronArgs').': '. $cron['parameters']; + $texttoshow.='
        '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); + } + elseif ($cron['jobtype']=='command') + { + $text=$langs->trans('CronCommand'); + $texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']); + $texttoshow.='
        '.$langs->trans('CronArgs').': '. $cron['parameters']; + $texttoshow.='
        '.$langs->trans('Comment').': '. $langs->trans($cron['comment']); + } + print $form->textwithpicto($text, $texttoshow, 1); + print ''; - print ''; - if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes'); - if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours'); - if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days'); - if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks'); - print ''; + print ''; + if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes'); + if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours'); + if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days'); + if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks'); + print ''; - print ''; - print $cron['status']; - print ''; + print ''; + print $cron['status']; + print ''; - print ''; - if (!empty($cron['comment'])) {print $cron['comment'];} - print ''; + print ''; + if (!empty($cron['comment'])) {print $cron['comment'];} + print ''; - print ''; + print ''; + } + } + else + { + print ''.$langs->trans("None").''; } print ''; From 6c93c6f6cceab8d9cb7d102058b7f5a05895c254 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 13:38:42 +0200 Subject: [PATCH 0169/1137] Fix PHPunit --- .../facture/class/facture-rec.class.php | 206 +++++++++--------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index ddf813db30b..a1068a8c691 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -43,7 +43,7 @@ class FactureRec extends CommonInvoice public $table_element_line='facturedet_rec'; public $fk_element='fk_facture'; public $picto='bill'; - + var $entity; var $number; var $date; @@ -58,7 +58,7 @@ class FactureRec extends CommonInvoice var $date_when; var $nb_gen_done; var $nb_gen_max; - + var $rang; var $special_code; @@ -91,20 +91,20 @@ class FactureRec extends CommonInvoice // Clean parameters $this->titre=trim($this->titre); $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; - + // No frequency defined then no next date to execution - if (empty($this->frequency)) + if (empty($this->frequency)) { $this->frequency=0; $this->date_when=NULL; } - - + + $this->frequency=abs($this->frequency); $this->nb_gen_done=0; $this->nb_gen_max=empty($this->nb_gen_max)?0:$this->nb_gen_max; $this->auto_validate=empty($this->auto_validate)?0:$this->auto_validate; - + $this->db->begin(); // Charge facture modele @@ -197,7 +197,7 @@ class FactureRec extends CommonInvoice $error++; } } - + // Add object linked if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) { @@ -210,7 +210,7 @@ class FactureRec extends CommonInvoice $error++; } } - } + } if ($error) { @@ -268,7 +268,7 @@ class FactureRec extends CommonInvoice if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; */ - + $result = $this->db->query($sql); if ($result) { @@ -326,14 +326,14 @@ class FactureRec extends CommonInvoice if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; - + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); - + /* * Lines */ @@ -369,8 +369,8 @@ class FactureRec extends CommonInvoice { return $this->fetch_lines(); } - - + + /** * Recupere les lignes de factures predefinies dans this->lines * @@ -394,7 +394,7 @@ class FactureRec extends CommonInvoice $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; $sql.= ' WHERE l.fk_facture = '.$this->id; $sql.= ' ORDER BY l.rang'; - + dol_syslog('FactureRec::fetch_lines', LOG_DEBUG); $result = $this->db->query($sql); if ($result) @@ -439,20 +439,20 @@ class FactureRec extends CommonInvoice $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; $line->fk_contract_line = $objp->fk_contract_line; - + // Ne plus utiliser $line->price = $objp->price; $line->remise = $objp->remise; - + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); $extrafieldsline=new ExtraFields($line->db); $extrafieldsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true); $extralabelsline = $line->fetch_optionals($line->id,$extrafieldsline); - - + + $this->lines[$i] = $line; $i++; @@ -480,12 +480,12 @@ class FactureRec extends CommonInvoice function delete($user, $notrigger=0, $idwarehouse=-1) { $rowid=$this->id; - + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); - + $error=0; $this->db->begin(); - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid; dol_syslog($sql); if ($this->db->query($sql)) @@ -498,7 +498,7 @@ class FactureRec extends CommonInvoice $res = $this->deleteObjectLinked(); if ($res < 0) $error=-3; } - else + else { $this->error=$this->db->lasterror(); $error=-1; @@ -509,7 +509,7 @@ class FactureRec extends CommonInvoice $this->error=$this->db->lasterror(); $error=-2; } - + if (! $error) { $this->db->commit(); @@ -548,7 +548,7 @@ class FactureRec extends CommonInvoice function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null) { global $mysoc; - + $facid=$this->id; dol_syslog(get_class($this)."::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG); @@ -601,7 +601,7 @@ class FactureRec extends CommonInvoice $total_ttc = $tabprice[2]; $total_localtax1=$tabprice[9]; $total_localtax2=$tabprice[10]; - + $product_type=$type; if ($fk_product) { @@ -703,12 +703,12 @@ class FactureRec extends CommonInvoice function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null) { global $mysoc; - + $facid=$this->id; - + dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - + // Check parameters if ($type < 0) return -1; @@ -733,7 +733,7 @@ class FactureRec extends CommonInvoice $txtva=price2num($txtva); $txlocaltax1 = price2num($txlocaltax1); $txlocaltax2 = price2num($txlocaltax2); - + if ($price_base_type=='HT') { $pu=$pu_ht; @@ -742,7 +742,7 @@ class FactureRec extends CommonInvoice { $pu=$pu_ttc; } - + // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker @@ -754,7 +754,7 @@ class FactureRec extends CommonInvoice $total_ttc = $tabprice[2]; $total_localtax1=$tabprice[9]; $total_localtax2=$tabprice[10]; - + $product_type=$type; if ($fk_product) { @@ -762,7 +762,7 @@ class FactureRec extends CommonInvoice $result=$product->fetch($fk_product); $product_type=$product->type; } - + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; $sql.= "fk_facture = '".$facid."'"; $sql.= ", label=".(! empty($label)?"'".$this->db->escape($label)."'":"null"); @@ -802,12 +802,12 @@ class FactureRec extends CommonInvoice return -1; } } - } - - + } + + /** - * Return the next date of - * + * Return the next date of + * * @return timestamp false if KO, timestamp if OK */ function getNextDate() @@ -815,27 +815,27 @@ class FactureRec extends CommonInvoice if (empty($this->date_when)) return false; return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency); } - + /** * Create all recurrents invoices (for all entities if multicompany is used). * A result may also be provided into this->output. - * - * WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found. - * - * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + * + * WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found. + * + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ function createRecurringInvoices() { global $conf, $langs, $db, $user; - + $langs->load("bills"); - + $nb_create=0; - + $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day - + dol_syslog("createRecurringInvoices"); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec'; $sql.= ' WHERE frequency > 0'; // A recurring invoice is an invoice with a frequency @@ -843,30 +843,30 @@ class FactureRec extends CommonInvoice $sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)'; $sql.= $db->order('entity', 'ASC'); //print $sql;exit; - + $resql = $db->query($sql); if ($resql) { $i=0; $num = $db->num_rows($resql); - + if ($num) $this->output.=$langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; else $this->output.=$langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); - + $saventity = $conf->entity; - + while ($i < $num) // Loop on each template invoice { $line = $db->fetch_object($resql); $db->begin(); - + $facturerec = new FactureRec($db); $facturerec->fetch($line->rowid); - + // Set entity context $conf->entity = $facturerec->entity; - + dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity); $error=0; @@ -874,12 +874,12 @@ class FactureRec extends CommonInvoice $facture = new Facture($db); $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice - + $facture->type = self::TYPE_STANDARD; $facture->brouillon = 1; $facture->date = $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; - + $invoiceidgenerated = $facture->create($user); if ($invoiceidgenerated <= 0) { @@ -912,16 +912,16 @@ class FactureRec extends CommonInvoice $i++; } - + $conf->entity = $saventity; // Restore entity context } else dol_print_error($db); - + $this->output=trim($this->output); - + return $error?$error:0; } - + /** * Return clicable name (with picto eventually) * @@ -938,13 +938,13 @@ class FactureRec extends CommonInvoice $result=''; $label=$langs->trans("ShowInvoice").': '.$this->ref; - + $url = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id; - + if ($short) return $url; - + $picto='bill'; - + $link = ''; $linkend=''; @@ -976,7 +976,7 @@ class FactureRec extends CommonInvoice // Load array of products prodids $num_prods = 0; $prodids = array(); - + $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE entity IN (".getEntity('product').")"; @@ -1089,7 +1089,7 @@ class FactureRec extends CommonInvoice $this->lines[$xnbp]=$line; $xnbp++; } - + $this->usenewprice = 1; } @@ -1109,7 +1109,7 @@ class FactureRec extends CommonInvoice return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } - + /** * Update frequency and unit * @@ -1133,12 +1133,12 @@ class FactureRec extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET frequency = '.($frequency?$this->db->escape($frequency):'null'); - if (!empty($unit)) + if (!empty($unit)) { $sql.= ', unit_frequency = \''.$this->db->escape($unit).'\''; } $sql.= ' WHERE rowid = '.$this->id; - + dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG); if ($this->db->query($sql)) { @@ -1152,7 +1152,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the next date of execution * @@ -1185,7 +1185,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the maximum period * @@ -1199,9 +1199,9 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined",LOG_ERR); return -1; } - + if (empty($nb)) $nb=0; - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET nb_gen_max = '.$nb; $sql.= ' WHERE rowid = '.$this->id; @@ -1218,7 +1218,7 @@ class FactureRec extends CommonInvoice return -1; } } - + /** * Update the auto validate invoice * @@ -1232,7 +1232,7 @@ class FactureRec extends CommonInvoice dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined",LOG_ERR); return -1; } - + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql.= ' SET auto_validate = '.$validate; $sql.= ' WHERE rowid = '.$this->id; @@ -1259,10 +1259,10 @@ class FactureRec extends CommonInvoice */ class FactureLigneRec extends CommonInvoiceLine { - + public $element='facturedetrec'; public $table_element='facturedet_rec'; - + /** * Delete line in database * @@ -1271,12 +1271,12 @@ class FactureLigneRec extends CommonInvoiceLine function delete() { global $conf,$langs,$user; - + $error=0; - + $this->db->begin(); - - + + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id); dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql) ) @@ -1289,7 +1289,7 @@ class FactureLigneRec extends CommonInvoiceLine return -1; } // End call triggers - + $this->db->commit(); return 1; } @@ -1300,17 +1300,17 @@ class FactureLigneRec extends CommonInvoiceLine return -1; } } - - - + + + /** * Recupere les lignes de factures predefinies dans this->lines - * @param int $rowid + * @param int $rowid * @return int 1 if OK, < 0 if KO */ function fetch($rowid) { - + $sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, '; $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_ttc,'; @@ -1321,14 +1321,14 @@ class FactureLigneRec extends CommonInvoiceLine $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; $sql.= ' WHERE l.rowid = '.$rowid; $sql.= ' ORDER BY l.rang'; - + dol_syslog('FactureRec::fetch_lines', LOG_DEBUG); $result = $this->db->query($sql); if ($result) { - $objp = $this->db->fetch_object($result); - + $objp = $this->db->fetch_object($result); + $this->id = $objp->rowid; $this->label = $objp->custom_label; // Label line $this->desc = $objp->description; // Description line @@ -1363,7 +1363,7 @@ class FactureLigneRec extends CommonInvoiceLine $this->fk_unit = $objp->fk_unit; $this->fk_contract_line = $objp->fk_contract_line; - + $this->db->free($result); return 1; } @@ -1373,8 +1373,8 @@ class FactureLigneRec extends CommonInvoiceLine return -3; } } - - + + /** * Update a line to invoice_rec * @return int <0 if KO, Id of line if OK @@ -1382,16 +1382,16 @@ class FactureLigneRec extends CommonInvoiceLine function update() { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - + if ($fk_product) { $product=new Product($this->db); $result=$product->fetch($fk_product); $product_type=$product->type; } - + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; - $sql.= " fk_facture = '".$this->fk_facture."'"; + $sql.= " fk_facture = ".$this->fk_facture; $sql.= ", label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= ", description='".$this->db->escape($this->desc)."'"; $sql.= ", price=".price2num($this->price); @@ -1415,9 +1415,9 @@ class FactureLigneRec extends CommonInvoiceLine $sql.= ", special_code=".$this->special_code; $sql.= ", fk_unit=".($this->fk_unit ?"'".$this->db->escape($this->fk_unit )."'":"null"); $sql.= ", fk_contract_line=".($this->fk_contract_line?$this->fk_contract_line:"null"); - + $sql.= " WHERE rowid = ".$this->id; - + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -1430,7 +1430,7 @@ class FactureLigneRec extends CommonInvoiceLine $error++; } } - + if (! $notrigger) { // Call trigger @@ -1451,9 +1451,9 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->rollback(); return -2; } - + } - - - + + + } From 1ce1899a46df1c18d492defa818000a25b7986b3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 27 Aug 2017 13:42:46 +0200 Subject: [PATCH 0170/1137] Fix: add comment --- htdocs/core/lib/security2.lib.php | 1 - htdocs/core/tpl/login.tpl.php | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 39cfb715a28..fa87294b44f 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -204,7 +204,6 @@ function dol_loginfunction($langs,$conf,$mysoc) // Execute hook getLoginPageOptions (for table) $parameters=array('entity' => GETPOST('entity','int')); $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. - //$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints $morelogincontent = $hookmanager->resPrint; // Execute hook getLoginPageExtraOptions (eg for js) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 6abeaf332a3..5c603f531f9 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -133,6 +133,7 @@ if ($disablenofollow) echo ''; } }*/ if (! empty($morelogincontent)) { + echo ''; echo $morelogincontent; } ?> @@ -291,6 +292,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { } }*/ if (! empty($moreloginextracontent)) { + echo ''; echo $moreloginextracontent; } ?> From 526ccc870b652e58768c19bcd7dca9f683c5d6f7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 27 Aug 2017 13:53:08 +0200 Subject: [PATCH 0171/1137] Fix: add compatibility with old modules --- htdocs/core/lib/security2.lib.php | 6 ++- htdocs/core/tpl/login.tpl.php | 67 +++++++++++++++---------------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index fa87294b44f..d0def9d5627 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -204,7 +204,11 @@ function dol_loginfunction($langs,$conf,$mysoc) // Execute hook getLoginPageOptions (for table) $parameters=array('entity' => GETPOST('entity','int')); $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. - $morelogincontent = $hookmanager->resPrint; + if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) { + $morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility + } else { + $morelogincontent = $hookmanager->resPrint; + } // Execute hook getLoginPageExtraOptions (eg for js) $parameters=array('entity' => GETPOST('entity','int')); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 5c603f531f9..b0616cadb80 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -123,27 +123,28 @@ if ($disablenofollow) echo ''; $option) - { - if ($format == 'table') { - echo ''; - echo $option; +if (! empty($morelogincontent)) { + if (is_array($morelogincontent)) { + foreach ($morelogincontent as $format => $option) + { + if ($format == 'table') { + echo ''; + echo $option; + } } } -}*/ -if (! empty($morelogincontent)) { - echo ''; - echo $morelogincontent; + else { + echo ''; + echo $morelogincontent; + } } -?> - @@ -279,25 +280,25 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { -global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?> - $option) - { - if ($format == 'js') { - echo "\n".''; - echo $option."\n"; +if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; + +if (! empty($morelogincontent)) { + if (is_array($morelogincontent)) { + foreach ($morelogincontent as $format => $option) + { + if ($format == 'js') { + echo "\n".''; + echo $option."\n"; + } } } -}*/ -if (! empty($moreloginextracontent)) { - echo ''; - echo $moreloginextracontent; + else { + echo ''; + echo $moreloginextracontent; + } } -?> -google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)) { @@ -317,9 +318,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID) print ''."\n"; } } -?> -google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { From 80af01c20f0137d4cb2cdc9c2f8678d3c75d5e65 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 27 Aug 2017 13:57:52 +0200 Subject: [PATCH 0172/1137] Fix: wrong test --- htdocs/core/tpl/login.tpl.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index b0616cadb80..34f2df1f02f 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -283,20 +283,18 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; -if (! empty($morelogincontent)) { - if (is_array($morelogincontent)) { - foreach ($morelogincontent as $format => $option) - { - if ($format == 'js') { - echo "\n".''; - echo $option."\n"; - } +if (! empty($morelogincontent) && is_array($morelogincontent)) { + foreach ($morelogincontent as $format => $option) + { + if ($format == 'js') { + echo "\n".''; + echo $option."\n"; } } - else { - echo ''; - echo $moreloginextracontent; - } +} +else if (! empty($moreloginextracontent)) { + echo ''; + echo $moreloginextracontent; } // Google Analytics (need Google module) From a4ea9d9c03f64ef6026e48d7a8fa90af77bf7d76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 14:33:53 +0200 Subject: [PATCH 0173/1137] Add login screenshots --- .../dolibarr_screenshot5_1920x1080_a.jpg | Bin 0 -> 227972 bytes .../dolibarr_screenshot5_1920x1080_b.jpg | Bin 0 -> 126498 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/images/dolibarr_screenshot5_1920x1080_a.jpg create mode 100644 doc/images/dolibarr_screenshot5_1920x1080_b.jpg diff --git a/doc/images/dolibarr_screenshot5_1920x1080_a.jpg b/doc/images/dolibarr_screenshot5_1920x1080_a.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1c6e2cbdbdf0c00a5fb4a513e407f9b907fd067c GIT binary patch literal 227972 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 z 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 EEVlz_q{%zuW;! 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 literal 0 HcmV?d00001 diff --git a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5f7d8a5b573d9e7b3e055a62890cb02fa37e1ae0 GIT binary patch literal 126498 zcmb@t2V4`&+b_Ne0h0h4s(_#YLhlfeZls3*La3oAEp$+t3d%VF5$V!P5TrwBQbYk! zLFq_uqTo>w0kI<%^c?>aJ->GEd*6HipU*p+%+Aj4&dxmhl<)J*?2m^(oLm=9hCEFSERB>^l$Dh|v^gvqBsw$Pr-2Yf%|3Wl0JYh{fW>JFk zf&N3mArWC@Qv<9M#TmP25n_Q3KztAmI^^LMeu{a`|B}GH|45(anPZ2b83kr8^F{B; zwGZ}9XAO3rk6h5=WY+yR3FA!-_X6ZI0@p-&f`@~04=D3`+K~-Gc@~0@9Nxj+-VlU( z3hEPme_n(3V_xI?Z`TAx2Kz%0`aH8fnCcM@${C=H^9(!{0m|2z^`=GN4?D z4qb&RAqLb0wL&+cZm1U;fJUK7XbyS|J%!ewE$AKe3HkOqhxx)nV3Dx%unVvhSQd;9D}ym$EwD~lFKie#1zUtYgKfe-z;@v* za1J;xTm&u&SAuK8kHSfCJGdL%7aj_ahR4Ix;RWz=cmwMw%&LU=a!k9fTRe z9^r)uMf`?HMbHtoh#QDL#0=sY;vM2IR!&x7RykH}RwAntt1s&r)&$l()@s&v)_&GG z)-~2oY;0`&Y*K88+057|YyoWN*izYw*{-qmuuZY8vhD2Ivqx}`+#bC>$M$&aiP)2{ zr*Kchp1XUd_pI&tf@DV?LaHK7kj}^uWE?UNS%M_qkVjSa`&F40*hGF7QHzNnodaG6k`J^Vcq9xL zmK7!opA)VSejvOfa!|xnY4h9^|Ie6#b<{_R#`iJ}vOX|t1jy&TO>On2ba^3^Oq}@o04ah*OCvBFPC3X;7~ZKa9W{W;h7@8qJ?6d;!VXj zN;oBFrA(zkrN5Nbm4lQkl^?5ctC*|AsdTA)P?c5nQY})QRpV4MQTtu3L+w3Y4o}6G z;2)~6t6S@9W1wshX3%c%*-+as#<0hT#mLks*=XFD+t}WiZv4bV%*5BE-sGLBy6HL7 z9y3-ml3AwN0#StMMPv})nIATfG4CUBkZehG(u#$wMVLjGCEU{7GTU;=O2R6{>gF-% z81Y#4v1My1>rm@kHf%Q5Hbpis$SUOX@M3qwwJb#w7=)D&%xD! z;qckf$T7?DsgsgZjMFGZh~iJ_aNgtW;9Tvz<6`WR>$2vm?wa5_?(D9(- zw@>Ul;c=qPoz>mZz0Uo+$1#s`j~!2<=M~R)UWQ)zUR&M-?;P(7o0)eg-KeHTUws}6^SyM=c|@B#z#AW}N=V&t>a`lpLde>vlDrtK`(*^sjj zqGY3zqSm8LqN~m!&Uu}?cV6^-?D=OgM`Ox#*W1) z$7RKRyx@4DD_$g?7QcGY^kRL&-h{A(g-be@t|lT9{S(KN)RGF5{z~>v9!XJ7$xHd3 z>XkZ@rjk~W_9NXVef+Y<<&q4xjF61^%p;k#SzKAsS*zKW**9{qImtO6b5GNM}X*QL|deoOIIO}A)w(QUrlm+zqO#NYXGH~Q{Q hQy}rGx_fFhk`G*Ux3r`< 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

        r-nSMh5pl+f>u=M7e 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 literal 0 HcmV?d00001 From e04dd3c80798516a570af6f81e6294557da9f82b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 15:05:35 +0200 Subject: [PATCH 0174/1137] Fix php unit --- .../compta/facture/class/facture-rec.class.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index a1068a8c691..967fdc908bc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1276,7 +1276,6 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id); dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql) ) @@ -1302,15 +1301,14 @@ class FactureLigneRec extends CommonInvoiceLine } - /** * Recupere les lignes de factures predefinies dans this->lines - * @param int $rowid - * @return int 1 if OK, < 0 if KO + * + * @param int $rowid Id of invoice + * @return int 1 if OK, < 0 if KO */ function fetch($rowid) { - $sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, '; $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_ttc,'; @@ -1322,7 +1320,7 @@ class FactureLigneRec extends CommonInvoiceLine $sql.= ' WHERE l.rowid = '.$rowid; $sql.= ' ORDER BY l.rang'; - dol_syslog('FactureRec::fetch_lines', LOG_DEBUG); + dol_syslog('FactureRec::fetch', LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1376,11 +1374,14 @@ class FactureLigneRec extends CommonInvoiceLine /** - * Update a line to invoice_rec + * Update a line to invoice_rec. + * * @return int <0 if KO, Id of line if OK */ function update() { + global $user; + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; if ($fk_product) @@ -1454,6 +1455,4 @@ class FactureLigneRec extends CommonInvoiceLine } - - } From 54afb2f1afd10a7becee46bd96c49b28affce316 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 15:48:26 +0200 Subject: [PATCH 0175/1137] Add demo file for 6.0 --- dev/initdemo/mysqldump_dolibarr_6.0.0.sql | 9419 +++++++++++++++++++++ dev/initdemo/savedemo.sh | 14 + 2 files changed, 9433 insertions(+) create mode 100644 dev/initdemo/mysqldump_dolibarr_6.0.0.sql diff --git a/dev/initdemo/mysqldump_dolibarr_6.0.0.sql b/dev/initdemo/mysqldump_dolibarr_6.0.0.sql new file mode 100644 index 00000000000..0d1c6352a27 --- /dev/null +++ b/dev/initdemo/mysqldump_dolibarr_6.0.0.sql @@ -0,0 +1,9419 @@ +-- MySQL dump 10.13 Distrib 5.5.57, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: dolibarr_6 +-- ------------------------------------------------------ +-- Server version 5.5.57-0ubuntu0.14.04.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `llx_accounting_account` +-- + +DROP TABLE IF EXISTS `llx_accounting_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_account` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_pcg_version` varchar(32) DEFAULT NULL, + `pcg_type` varchar(20) NOT NULL, + `pcg_subtype` varchar(20) NOT NULL, + `account_number` varchar(32) DEFAULT NULL, + `account_parent` varchar(32) DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `fk_accounting_category` int(11) DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + KEY `idx_accountingaccount_fk_pcg_version` (`fk_pcg_version`), + KEY `idx_accounting_account_account_number` (`account_number`), + CONSTRAINT `fk_accountingaccount_fk_pcg_version` FOREIGN KEY (`fk_pcg_version`) REFERENCES `llx_accounting_system` (`pcg_version`) +) ENGINE=InnoDB AUTO_INCREMENT=4785 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_account` +-- + +LOCK TABLES `llx_accounting_account` WRITE; +/*!40000 ALTER TABLE `llx_accounting_account` DISABLE KEYS */; +INSERT INTO `llx_accounting_account` VALUES (1,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','CAPITAL','101','1401','Capital',0,NULL,NULL,1),(2,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','105','1401','Ecarts de réévaluation',0,NULL,NULL,1),(3,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','1061','1401','Réserve légale',0,NULL,NULL,1),(4,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','1063','1401','Réserves statutaires ou contractuelles',0,NULL,NULL,1),(5,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','1064','1401','Réserves réglementées',0,NULL,NULL,1),(6,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','1068','1401','Autres réserves',0,NULL,NULL,1),(7,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','108','1401','Compte de l\'exploitant',0,NULL,NULL,1),(8,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','12','1401','Résultat de l\'exercice',0,NULL,NULL,1),(9,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','145','1401','Amortissements dérogatoires',0,NULL,NULL,1),(10,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','146','1401','Provision spéciale de réévaluation',0,NULL,NULL,1),(11,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','147','1401','Plus-values réinvesties',0,NULL,NULL,1),(12,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','148','1401','Autres provisions réglementées',0,NULL,NULL,1),(13,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','15','1401','Provisions pour risques et charges',0,NULL,NULL,1),(14,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CAPIT','XXXXXX','16','1401','Emprunts et dettes assimilees',0,NULL,NULL,1),(15,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','20','1402','Immobilisations incorporelles',0,NULL,NULL,1),(16,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','201','15','Frais d\'établissement',0,NULL,NULL,1),(17,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','206','15','Droit au bail',0,NULL,NULL,1),(18,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','207','15','Fonds commercial',0,NULL,NULL,1),(19,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','208','15','Autres immobilisations incorporelles',0,NULL,NULL,1),(20,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','21','1402','Immobilisations corporelles',0,NULL,NULL,1),(21,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','23','1402','Immobilisations en cours',0,NULL,NULL,1),(22,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','27','1402','Autres immobilisations financieres',0,NULL,NULL,1),(23,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','280','1402','Amortissements des immobilisations incorporelles',0,NULL,NULL,1),(24,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','281','1402','Amortissements des immobilisations corporelles',0,NULL,NULL,1),(25,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','290','1402','Provisions pour dépréciation des immobilisations incorporelles',0,NULL,NULL,1),(26,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','291','1402','Provisions pour dépréciation des immobilisations corporelles',0,NULL,NULL,1),(27,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','IMMO','XXXXXX','297','1402','Provisions pour dépréciation des autres immobilisations financières',0,NULL,NULL,1),(28,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','31','1403','Matieres premières',0,NULL,NULL,1),(29,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','32','1403','Autres approvisionnements',0,NULL,NULL,1),(30,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','33','1403','En-cours de production de biens',0,NULL,NULL,1),(31,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','34','1403','En-cours de production de services',0,NULL,NULL,1),(32,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','35','1403','Stocks de produits',0,NULL,NULL,1),(33,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','37','1403','Stocks de marchandises',0,NULL,NULL,1),(34,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','391','1403','Provisions pour dépréciation des matières premières',0,NULL,NULL,1),(35,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','392','1403','Provisions pour dépréciation des autres approvisionnements',0,NULL,NULL,1),(36,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','393','1403','Provisions pour dépréciation des en-cours de production de biens',0,NULL,NULL,1),(37,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','394','1403','Provisions pour dépréciation des en-cours de production de services',0,NULL,NULL,1),(38,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','395','1403','Provisions pour dépréciation des stocks de produits',0,NULL,NULL,1),(39,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','STOCK','XXXXXX','397','1403','Provisions pour dépréciation des stocks de marchandises',0,NULL,NULL,1),(40,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','SUPPLIER','400','1404','Fournisseurs et Comptes rattachés',0,NULL,NULL,1),(41,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','409','1404','Fournisseurs débiteurs',0,NULL,NULL,1),(42,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','CUSTOMER','410','1404','Clients et Comptes rattachés',0,NULL,NULL,1),(43,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','419','1404','Clients créditeurs',0,NULL,NULL,1),(44,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','421','1404','Personnel',0,NULL,NULL,1),(45,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','428','1404','Personnel',0,NULL,NULL,1),(46,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','43','1404','Sécurité sociale et autres organismes sociaux',0,NULL,NULL,1),(47,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','444','1404','Etat - impôts sur bénéfice',0,NULL,NULL,1),(48,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','445','1404','Etat - Taxes sur chiffre affaires',0,NULL,NULL,1),(49,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','447','1404','Autres impôts, taxes et versements assimilés',0,NULL,NULL,1),(50,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','45','1404','Groupe et associes',0,NULL,NULL,1),(51,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','455','50','Associés',0,NULL,NULL,1),(52,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','46','1404','Débiteurs divers et créditeurs divers',0,NULL,NULL,1),(53,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','47','1404','Comptes transitoires ou d\'attente',0,NULL,NULL,1),(54,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','481','1404','Charges à répartir sur plusieurs exercices',0,NULL,NULL,1),(55,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','486','1404','Charges constatées d\'avance',0,NULL,NULL,1),(56,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','487','1404','Produits constatés d\'avance',0,NULL,NULL,1),(57,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','491','1404','Provisions pour dépréciation des comptes de clients',0,NULL,NULL,1),(58,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','TIERS','XXXXXX','496','1404','Provisions pour dépréciation des comptes de débiteurs divers',0,NULL,NULL,1),(59,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','FINAN','XXXXXX','50','1405','Valeurs mobilières de placement',0,NULL,NULL,1),(60,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','FINAN','BANK','51','1405','Banques, établissements financiers et assimilés',0,NULL,NULL,1),(61,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','FINAN','CASH','53','1405','Caisse',0,NULL,NULL,1),(62,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','FINAN','XXXXXX','54','1405','Régies d\'avance et accréditifs',0,NULL,NULL,1),(63,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','FINAN','XXXXXX','58','1405','Virements internes',0,NULL,NULL,1),(64,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','FINAN','XXXXXX','590','1405','Provisions pour dépréciation des valeurs mobilières de placement',0,NULL,NULL,1),(65,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','PRODUCT','60','1406','Achats',0,NULL,NULL,1),(66,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','603','65','Variations des stocks',0,NULL,NULL,1),(67,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','SERVICE','61','1406','Services extérieurs',0,NULL,NULL,1),(68,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','62','1406','Autres services extérieurs',0,NULL,NULL,1),(69,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','63','1406','Impôts, taxes et versements assimiles',0,NULL,NULL,1),(70,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','641','1406','Rémunérations du personnel',0,NULL,NULL,1),(71,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','644','1406','Rémunération du travail de l\'exploitant',0,NULL,NULL,1),(72,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','SOCIAL','645','1406','Charges de sécurité sociale et de prévoyance',0,NULL,NULL,1),(73,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','646','1406','Cotisations sociales personnelles de l\'exploitant',0,NULL,NULL,1),(74,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','65','1406','Autres charges de gestion courante',0,NULL,NULL,1),(75,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','66','1406','Charges financières',0,NULL,NULL,1),(76,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','67','1406','Charges exceptionnelles',0,NULL,NULL,1),(77,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','681','1406','Dotations aux amortissements et aux provisions',0,NULL,NULL,1),(78,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','686','1406','Dotations aux amortissements et aux provisions',0,NULL,NULL,1),(79,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','687','1406','Dotations aux amortissements et aux provisions',0,NULL,NULL,1),(80,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','691','1406','Participation des salariés aux résultats',0,NULL,NULL,1),(81,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','695','1406','Impôts sur les bénéfices',0,NULL,NULL,1),(82,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','697','1406','Imposition forfaitaire annuelle des sociétés',0,NULL,NULL,1),(83,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','CHARGE','XXXXXX','699','1406','Produits',0,NULL,NULL,1),(84,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','PRODUCT','701','1407','Ventes de produits finis',0,NULL,NULL,1),(85,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','SERVICE','706','1407','Prestations de services',0,NULL,NULL,1),(86,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','PRODUCT','707','1407','Ventes de marchandises',0,NULL,NULL,1),(87,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','PRODUCT','708','1407','Produits des activités annexes',0,NULL,NULL,1),(88,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','709','1407','Rabais, remises et ristournes accordés par l\'entreprise',0,NULL,NULL,1),(89,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','713','1407','Variation des stocks',0,NULL,NULL,1),(90,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','72','1407','Production immobilisée',0,NULL,NULL,1),(91,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','73','1407','Produits nets partiels sur opérations à long terme',0,NULL,NULL,1),(92,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','74','1407','Subventions d\'exploitation',0,NULL,NULL,1),(93,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','75','1407','Autres produits de gestion courante',0,NULL,NULL,1),(94,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','753','93','Jetons de présence et rémunérations d\'administrateurs, gérants,...',0,NULL,NULL,1),(95,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','754','93','Ristournes perçues des coopératives',0,NULL,NULL,1),(96,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','755','93','Quotes-parts de résultat sur opérations faites en commun',0,NULL,NULL,1),(97,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','76','1407','Produits financiers',0,NULL,NULL,1),(98,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','77','1407','Produits exceptionnels',0,NULL,NULL,1),(99,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','781','1407','Reprises sur amortissements et provisions',0,NULL,NULL,1),(100,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','786','1407','Reprises sur provisions pour risques',0,NULL,NULL,1),(101,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','787','1407','Reprises sur provisions',0,NULL,NULL,1),(102,1,NULL,'2016-01-22 17:28:15','PCG99-ABREGE','PROD','XXXXXX','79','1407','Transferts de charges',0,NULL,NULL,1),(103,1,NULL,'2017-02-20 10:49:11','PCG99-BASE','CAPIT','XXXXXX','10','1501','Capital et réserves',0,NULL,NULL,1),(104,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','CAPITAL','101','103','Capital',0,NULL,NULL,1),(105,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','104','103','Primes liées au capital social',0,NULL,NULL,1),(106,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','105','103','Ecarts de réévaluation',0,NULL,NULL,1),(107,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','106','103','Réserves',0,NULL,NULL,1),(108,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','107','103','Ecart d\'equivalence',0,NULL,NULL,1),(109,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','108','103','Compte de l\'exploitant',0,NULL,NULL,1),(110,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','109','103','Actionnaires : capital souscrit - non appelé',0,NULL,NULL,1),(111,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','11','1501','Report à nouveau (solde créditeur ou débiteur)',0,NULL,NULL,1),(112,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','110','111','Report à nouveau (solde créditeur)',0,NULL,NULL,1),(113,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','119','111','Report à nouveau (solde débiteur)',0,NULL,NULL,1),(114,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','12','1501','Résultat de l\'exercice (bénéfice ou perte)',0,NULL,NULL,1),(115,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','120','114','Résultat de l\'exercice (bénéfice)',0,NULL,NULL,1),(116,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','129','114','Résultat de l\'exercice (perte)',0,NULL,NULL,1),(117,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','13','1501','Subventions d\'investissement',0,NULL,NULL,1),(118,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','131','117','Subventions d\'équipement',0,NULL,NULL,1),(119,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','138','117','Autres subventions d\'investissement',0,NULL,NULL,1),(120,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','139','117','Subventions d\'investissement inscrites au compte de résultat',0,NULL,NULL,1),(121,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','14','1501','Provisions réglementées',0,NULL,NULL,1),(122,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','142','121','Provisions réglementées relatives aux immobilisations',0,NULL,NULL,1),(123,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','143','121','Provisions réglementées relatives aux stocks',0,NULL,NULL,1),(124,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','144','121','Provisions réglementées relatives aux autres éléments de l\'actif',0,NULL,NULL,1),(125,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','145','121','Amortissements dérogatoires',0,NULL,NULL,1),(126,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','146','121','Provision spéciale de réévaluation',0,NULL,NULL,1),(127,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','147','121','Plus-values réinvesties',0,NULL,NULL,1),(128,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','148','121','Autres provisions réglementées',0,NULL,NULL,1),(129,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','15','1501','Provisions pour risques et charges',0,NULL,NULL,1),(130,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','151','129','Provisions pour risques',0,NULL,NULL,1),(131,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','153','129','Provisions pour pensions et obligations similaires',0,NULL,NULL,1),(132,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','154','129','Provisions pour restructurations',0,NULL,NULL,1),(133,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','155','129','Provisions pour impôts',0,NULL,NULL,1),(134,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','156','129','Provisions pour renouvellement des immobilisations (entreprises concessionnaires)',0,NULL,NULL,1),(135,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','157','129','Provisions pour charges à répartir sur plusieurs exercices',0,NULL,NULL,1),(136,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','158','129','Autres provisions pour charges',0,NULL,NULL,1),(137,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','16','1501','Emprunts et dettes assimilees',0,NULL,NULL,1),(138,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','161','137','Emprunts obligataires convertibles',0,NULL,NULL,1),(139,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','163','137','Autres emprunts obligataires',0,NULL,NULL,1),(140,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','164','137','Emprunts auprès des établissements de crédit',0,NULL,NULL,1),(141,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','165','137','Dépôts et cautionnements reçus',0,NULL,NULL,1),(142,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','166','137','Participation des salariés aux résultats',0,NULL,NULL,1),(143,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','167','137','Emprunts et dettes assortis de conditions particulières',0,NULL,NULL,1),(144,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','168','137','Autres emprunts et dettes assimilées',0,NULL,NULL,1),(145,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','169','137','Primes de remboursement des obligations',0,NULL,NULL,1),(146,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','17','1501','Dettes rattachées à des participations',0,NULL,NULL,1),(147,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','171','146','Dettes rattachées à des participations (groupe)',0,NULL,NULL,1),(148,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','174','146','Dettes rattachées à des participations (hors groupe)',0,NULL,NULL,1),(149,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','178','146','Dettes rattachées à des sociétés en participation',0,NULL,NULL,1),(150,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','18','1501','Comptes de liaison des établissements et sociétés en participation',0,NULL,NULL,1),(151,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','181','150','Comptes de liaison des établissements',0,NULL,NULL,1),(152,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','186','150','Biens et prestations de services échangés entre établissements (charges)',0,NULL,NULL,1),(153,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','187','150','Biens et prestations de services échangés entre établissements (produits)',0,NULL,NULL,1),(154,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CAPIT','XXXXXX','188','150','Comptes de liaison des sociétés en participation',0,NULL,NULL,1),(155,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','20','1502','Immobilisations incorporelles',0,NULL,NULL,1),(156,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','201','155','Frais d\'établissement',0,NULL,NULL,1),(157,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','203','155','Frais de recherche et de développement',0,NULL,NULL,1),(158,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','205','155','Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',0,NULL,NULL,1),(159,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','206','155','Droit au bail',0,NULL,NULL,1),(160,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','207','155','Fonds commercial',0,NULL,NULL,1),(161,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','208','155','Autres immobilisations incorporelles',0,NULL,NULL,1),(162,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','21','1502','Immobilisations corporelles',0,NULL,NULL,1),(163,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','211','162','Terrains',0,NULL,NULL,1),(164,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','212','162','Agencements et aménagements de terrains',0,NULL,NULL,1),(165,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','213','162','Constructions',0,NULL,NULL,1),(166,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','214','162','Constructions sur sol d\'autrui',0,NULL,NULL,1),(167,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','215','162','Installations techniques, matériels et outillage industriels',0,NULL,NULL,1),(168,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','218','162','Autres immobilisations corporelles',0,NULL,NULL,1),(169,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','22','1502','Immobilisations mises en concession',0,NULL,NULL,1),(170,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','23','1502','Immobilisations en cours',0,NULL,NULL,1),(171,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','231','170','Immobilisations corporelles en cours',0,NULL,NULL,1),(172,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','232','170','Immobilisations incorporelles en cours',0,NULL,NULL,1),(173,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','237','170','Avances et acomptes versés sur immobilisations incorporelles',0,NULL,NULL,1),(174,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','238','170','Avances et acomptes versés sur commandes d\'immobilisations corporelles',0,NULL,NULL,1),(175,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','25','1502','Parts dans des entreprises liées et créances sur des entreprises liées',0,NULL,NULL,1),(176,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','26','1502','Participations et créances rattachées à des participations',0,NULL,NULL,1),(177,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','261','176','Titres de participation',0,NULL,NULL,1),(178,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','266','176','Autres formes de participation',0,NULL,NULL,1),(179,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','267','176','Créances rattachées à des participations',0,NULL,NULL,1),(180,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','268','176','Créances rattachées à des sociétés en participation',0,NULL,NULL,1),(181,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','269','176','Versements restant à effectuer sur titres de participation non libérés',0,NULL,NULL,1),(182,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','27','1502','Autres immobilisations financieres',0,NULL,NULL,1),(183,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','271','183','Titres immobilisés autres que les titres immobilisés de l\'activité de portefeuille (droit de propriété)',0,NULL,NULL,1),(184,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','272','183','Titres immobilisés (droit de créance)',0,NULL,NULL,1),(185,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','273','183','Titres immobilisés de l\'activité de portefeuille',0,NULL,NULL,1),(186,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','274','183','Prêts',0,NULL,NULL,1),(187,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','275','183','Dépôts et cautionnements versés',0,NULL,NULL,1),(188,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','276','183','Autres créances immobilisées',0,NULL,NULL,1),(189,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','277','183','(Actions propres ou parts propres)',0,NULL,NULL,1),(190,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','279','183','Versements restant à effectuer sur titres immobilisés non libérés',0,NULL,NULL,1),(191,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','28','1502','Amortissements des immobilisations',0,NULL,NULL,1),(192,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','280','191','Amortissements des immobilisations incorporelles',0,NULL,NULL,1),(193,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','281','191','Amortissements des immobilisations corporelles',0,NULL,NULL,1),(194,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','282','191','Amortissements des immobilisations mises en concession',0,NULL,NULL,1),(195,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','29','1502','Dépréciations des immobilisations',0,NULL,NULL,1),(196,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','290','195','Dépréciations des immobilisations incorporelles',0,NULL,NULL,1),(197,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','291','195','Dépréciations des immobilisations corporelles',0,NULL,NULL,1),(198,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','292','195','Dépréciations des immobilisations mises en concession',0,NULL,NULL,1),(199,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','293','195','Dépréciations des immobilisations en cours',0,NULL,NULL,1),(200,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','296','195','Provisions pour dépréciation des participations et créances rattachées à des participations',0,NULL,NULL,1),(201,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','IMMO','XXXXXX','297','195','Provisions pour dépréciation des autres immobilisations financières',0,NULL,NULL,1),(202,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','31','1503','Matières premières (et fournitures)',0,NULL,NULL,1),(203,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','311','202','Matières (ou groupe) A',0,NULL,NULL,1),(204,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','312','202','Matières (ou groupe) B',0,NULL,NULL,1),(205,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','317','202','Fournitures A, B, C,',0,NULL,NULL,1),(206,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','32','1503','Autres approvisionnements',0,NULL,NULL,1),(207,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','321','206','Matières consommables',0,NULL,NULL,1),(208,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','322','206','Fournitures consommables',0,NULL,NULL,1),(209,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','326','206','Emballages',0,NULL,NULL,1),(210,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','33','1503','En-cours de production de biens',0,NULL,NULL,1),(211,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','331','210','Produits en cours',0,NULL,NULL,1),(212,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','335','210','Travaux en cours',0,NULL,NULL,1),(213,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','34','1503','En-cours de production de services',0,NULL,NULL,1),(214,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','341','213','Etudes en cours',0,NULL,NULL,1),(215,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','345','213','Prestations de services en cours',0,NULL,NULL,1),(216,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','35','1503','Stocks de produits',0,NULL,NULL,1),(217,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','351','216','Produits intermédiaires',0,NULL,NULL,1),(218,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','355','216','Produits finis',0,NULL,NULL,1),(219,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','358','216','Produits résiduels (ou matières de récupération)',0,NULL,NULL,1),(220,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','37','1503','Stocks de marchandises',0,NULL,NULL,1),(221,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','371','220','Marchandises (ou groupe) A',0,NULL,NULL,1),(222,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','372','220','Marchandises (ou groupe) B',0,NULL,NULL,1),(223,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','39','1503','Provisions pour dépréciation des stocks et en-cours',0,NULL,NULL,1),(224,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','391','223','Provisions pour dépréciation des matières premières',0,NULL,NULL,1),(225,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','392','223','Provisions pour dépréciation des autres approvisionnements',0,NULL,NULL,1),(226,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','393','223','Provisions pour dépréciation des en-cours de production de biens',0,NULL,NULL,1),(227,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','394','223','Provisions pour dépréciation des en-cours de production de services',0,NULL,NULL,1),(228,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','395','223','Provisions pour dépréciation des stocks de produits',0,NULL,NULL,1),(229,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','STOCK','XXXXXX','397','223','Provisions pour dépréciation des stocks de marchandises',0,NULL,NULL,1),(230,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','40','1504','Fournisseurs et Comptes rattachés',0,NULL,NULL,1),(231,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','400','230','Fournisseurs et Comptes rattachés',0,NULL,NULL,1),(232,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','SUPPLIER','401','230','Fournisseurs',0,NULL,NULL,1),(233,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','403','230','Fournisseurs - Effets à payer',0,NULL,NULL,1),(234,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','404','230','Fournisseurs d\'immobilisations',0,NULL,NULL,1),(235,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','405','230','Fournisseurs d\'immobilisations - Effets à payer',0,NULL,NULL,1),(236,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','408','230','Fournisseurs - Factures non parvenues',0,NULL,NULL,1),(237,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','409','230','Fournisseurs débiteurs',0,NULL,NULL,1),(238,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','41','1504','Clients et comptes rattachés',0,NULL,NULL,1),(239,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','410','238','Clients et Comptes rattachés',0,NULL,NULL,1),(240,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','CUSTOMER','411','238','Clients',0,NULL,NULL,1),(241,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','413','238','Clients - Effets à recevoir',0,NULL,NULL,1),(242,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','416','238','Clients douteux ou litigieux',0,NULL,NULL,1),(243,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','418','238','Clients - Produits non encore facturés',0,NULL,NULL,1),(244,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','419','238','Clients créditeurs',0,NULL,NULL,1),(245,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','42','1504','Personnel et comptes rattachés',0,NULL,NULL,1),(246,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','421','245','Personnel - Rémunérations dues',0,NULL,NULL,1),(247,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','422','245','Comités d\'entreprises, d\'établissement, ...',0,NULL,NULL,1),(248,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','424','245','Participation des salariés aux résultats',0,NULL,NULL,1),(249,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','425','245','Personnel - Avances et acomptes',0,NULL,NULL,1),(250,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','426','245','Personnel - Dépôts',0,NULL,NULL,1),(251,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','427','245','Personnel - Oppositions',0,NULL,NULL,1),(252,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','428','245','Personnel - Charges à payer et produits à recevoir',0,NULL,NULL,1),(253,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','43','1504','Sécurité sociale et autres organismes sociaux',0,NULL,NULL,1),(254,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','431','253','Sécurité sociale',0,NULL,NULL,1),(255,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','437','253','Autres organismes sociaux',0,NULL,NULL,1),(256,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','438','253','Organismes sociaux - Charges à payer et produits à recevoir',0,NULL,NULL,1),(257,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','44','1504','État et autres collectivités publiques',0,NULL,NULL,1),(258,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','441','257','État - Subventions à recevoir',0,NULL,NULL,1),(259,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','442','257','Etat - Impôts et taxes recouvrables sur des tiers',0,NULL,NULL,1),(260,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','443','257','Opérations particulières avec l\'Etat, les collectivités publiques, les organismes internationaux',0,NULL,NULL,1),(261,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','444','257','Etat - Impôts sur les bénéfices',0,NULL,NULL,1),(262,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','445','257','Etat - Taxes sur le chiffre d\'affaires',0,NULL,NULL,1),(263,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','446','257','Obligations cautionnées',0,NULL,NULL,1),(264,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','447','257','Autres impôts, taxes et versements assimilés',0,NULL,NULL,1),(265,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','448','257','Etat - Charges à payer et produits à recevoir',0,NULL,NULL,1),(266,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','449','257','Quotas d\'émission à restituer à l\'Etat',0,NULL,NULL,1),(267,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','45','1504','Groupe et associes',0,NULL,NULL,1),(268,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','451','267','Groupe',0,NULL,NULL,1),(269,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','455','267','Associés - Comptes courants',0,NULL,NULL,1),(270,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','456','267','Associés - Opérations sur le capital',0,NULL,NULL,1),(271,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','457','267','Associés - Dividendes à payer',0,NULL,NULL,1),(272,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','458','267','Associés - Opérations faites en commun et en G.I.E.',0,NULL,NULL,1),(273,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','46','1504','Débiteurs divers et créditeurs divers',0,NULL,NULL,1),(274,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','462','273','Créances sur cessions d\'immobilisations',0,NULL,NULL,1),(275,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','464','273','Dettes sur acquisitions de valeurs mobilières de placement',0,NULL,NULL,1),(276,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','465','273','Créances sur cessions de valeurs mobilières de placement',0,NULL,NULL,1),(277,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','467','273','Autres comptes débiteurs ou créditeurs',0,NULL,NULL,1),(278,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','468','273','Divers - Charges à payer et produits à recevoir',0,NULL,NULL,1),(279,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','47','1504','Comptes transitoires ou d\'attente',0,NULL,NULL,1),(280,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','471','279','Comptes d\'attente',0,NULL,NULL,1),(281,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','476','279','Différence de conversion - Actif',0,NULL,NULL,1),(282,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','477','279','Différences de conversion - Passif',0,NULL,NULL,1),(283,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','478','279','Autres comptes transitoires',0,NULL,NULL,1),(284,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','48','1504','Comptes de régularisation',0,NULL,NULL,1),(285,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','481','284','Charges à répartir sur plusieurs exercices',0,NULL,NULL,1),(286,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','486','284','Charges constatées d\'avance',0,NULL,NULL,1),(287,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','487','284','Produits constatés d\'avance',0,NULL,NULL,1),(288,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','488','284','Comptes de répartition périodique des charges et des produits',0,NULL,NULL,1),(289,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','489','284','Quotas d\'émission alloués par l\'Etat',0,NULL,NULL,1),(290,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','49','1504','Provisions pour dépréciation des comptes de tiers',0,NULL,NULL,1),(291,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','491','290','Provisions pour dépréciation des comptes de clients',0,NULL,NULL,1),(292,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','495','290','Provisions pour dépréciation des comptes du groupe et des associés',0,NULL,NULL,1),(293,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','TIERS','XXXXXX','496','290','Provisions pour dépréciation des comptes de débiteurs divers',0,NULL,NULL,1),(294,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','50','1505','Valeurs mobilières de placement',0,NULL,NULL,1),(295,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','501','294','Parts dans des entreprises liées',0,NULL,NULL,1),(296,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','502','294','Actions propres',0,NULL,NULL,1),(297,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','503','294','Actions',0,NULL,NULL,1),(298,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','504','294','Autres titres conférant un droit de propriété',0,NULL,NULL,1),(299,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','505','294','Obligations et bons émis par la société et rachetés par elle',0,NULL,NULL,1),(300,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','506','294','Obligations',0,NULL,NULL,1),(301,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','507','294','Bons du Trésor et bons de caisse à court terme',0,NULL,NULL,1),(302,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','508','294','Autres valeurs mobilières de placement et autres créances assimilées',0,NULL,NULL,1),(303,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','509','294','Versements restant à effectuer sur valeurs mobilières de placement non libérées',0,NULL,NULL,1),(304,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','51','1505','Banques, établissements financiers et assimilés',0,NULL,NULL,1),(305,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','511','304','Valeurs à l\'encaissement',0,NULL,NULL,1),(306,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','BANK','512','304','Banques',0,NULL,NULL,1),(307,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','514','304','Chèques postaux',0,NULL,NULL,1),(308,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','515','304','\"Caisses\" du Trésor et des établissements publics',0,NULL,NULL,1),(309,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','516','304','Sociétés de bourse',0,NULL,NULL,1),(310,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','517','304','Autres organismes financiers',0,NULL,NULL,1),(311,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','518','304','Intérêts courus',0,NULL,NULL,1),(312,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','519','304','Concours bancaires courants',0,NULL,NULL,1),(313,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','52','1505','Instruments de trésorerie',0,NULL,NULL,1),(314,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','CASH','53','1505','Caisse',0,NULL,NULL,1),(315,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','531','314','Caisse siège social',0,NULL,NULL,1),(316,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','532','314','Caisse succursale (ou usine) A',0,NULL,NULL,1),(317,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','533','314','Caisse succursale (ou usine) B',0,NULL,NULL,1),(318,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','54','1505','Régies d\'avance et accréditifs',0,NULL,NULL,1),(319,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','58','1505','Virements internes',0,NULL,NULL,1),(320,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','59','1505','Provisions pour dépréciation des comptes financiers',0,NULL,NULL,1),(321,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','FINAN','XXXXXX','590','320','Provisions pour dépréciation des valeurs mobilières de placement',0,NULL,NULL,1),(322,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','PRODUCT','60','1506','Achats',0,NULL,NULL,1),(323,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','601','322','Achats stockés - Matières premières (et fournitures)',0,NULL,NULL,1),(324,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','602','322','Achats stockés - Autres approvisionnements',0,NULL,NULL,1),(325,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','603','322','Variations des stocks (approvisionnements et marchandises)',0,NULL,NULL,1),(326,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','604','322','Achats stockés - Matières premières (et fournitures)',0,NULL,NULL,1),(327,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','605','322','Achats de matériel, équipements et travaux',0,NULL,NULL,1),(328,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','606','322','Achats non stockés de matière et fournitures',0,NULL,NULL,1),(329,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','607','322','Achats de marchandises',0,NULL,NULL,1),(330,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','608','322','(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)',0,NULL,NULL,1),(331,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','609','322','Rabais, remises et ristournes obtenus sur achats',0,NULL,NULL,1),(332,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','SERVICE','61','1506','Services extérieurs',0,NULL,NULL,1),(333,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','611','332','Sous-traitance générale',0,NULL,NULL,1),(334,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','612','332','Redevances de crédit-bail',0,NULL,NULL,1),(335,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','613','332','Locations',0,NULL,NULL,1),(336,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','614','332','Charges locatives et de copropriété',0,NULL,NULL,1),(337,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','615','332','Entretien et réparations',0,NULL,NULL,1),(338,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','616','332','Primes d\'assurances',0,NULL,NULL,1),(339,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','617','332','Etudes et recherches',0,NULL,NULL,1),(340,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','618','332','Divers',0,NULL,NULL,1),(341,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','619','332','Rabais, remises et ristournes obtenus sur services extérieurs',0,NULL,NULL,1),(342,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','62','1506','Autres services extérieurs',0,NULL,NULL,1),(343,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','621','342','Personnel extérieur à l\'entreprise',0,NULL,NULL,1),(344,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','622','342','Rémunérations d\'intermédiaires et honoraires',0,NULL,NULL,1),(345,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','623','342','Publicité, publications, relations publiques',0,NULL,NULL,1),(346,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','624','342','Transports de biens et transports collectifs du personnel',0,NULL,NULL,1),(347,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','625','342','Déplacements, missions et réceptions',0,NULL,NULL,1),(348,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','626','342','Frais postaux et de télécommunications',0,NULL,NULL,1),(349,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','627','342','Services bancaires et assimilés',0,NULL,NULL,1),(350,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','628','342','Divers',0,NULL,NULL,1),(351,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','629','342','Rabais, remises et ristournes obtenus sur autres services extérieurs',0,NULL,NULL,1),(352,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','63','1506','Impôts, taxes et versements assimilés',0,NULL,NULL,1),(353,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','631','352','Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)',0,NULL,NULL,1),(354,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','633','352','Impôts, taxes et versements assimilés sur rémunérations (autres organismes)',0,NULL,NULL,1),(355,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','635','352','Autres impôts, taxes et versements assimilés (administrations des impôts)',0,NULL,NULL,1),(356,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','637','352','Autres impôts, taxes et versements assimilés (autres organismes)',0,NULL,NULL,1),(357,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','64','1506','Charges de personnel',0,NULL,NULL,1),(358,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','641','357','Rémunérations du personnel',0,NULL,NULL,1),(359,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','644','357','Rémunération du travail de l\'exploitant',0,NULL,NULL,1),(360,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','SOCIAL','645','357','Charges de sécurité sociale et de prévoyance',0,NULL,NULL,1),(361,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','646','357','Cotisations sociales personnelles de l\'exploitant',0,NULL,NULL,1),(362,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','647','357','Autres charges sociales',0,NULL,NULL,1),(363,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','648','357','Autres charges de personnel',0,NULL,NULL,1),(364,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','65','1506','Autres charges de gestion courante',0,NULL,NULL,1),(365,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','651','364','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',0,NULL,NULL,1),(366,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','653','364','Jetons de présence',0,NULL,NULL,1),(367,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','654','364','Pertes sur créances irrécouvrables',0,NULL,NULL,1),(368,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','655','364','Quote-part de résultat sur opérations faites en commun',0,NULL,NULL,1),(369,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','658','364','Charges diverses de gestion courante',0,NULL,NULL,1),(370,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','66','1506','Charges financières',0,NULL,NULL,1),(371,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','661','370','Charges d\'intérêts',0,NULL,NULL,1),(372,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','664','370','Pertes sur créances liées à des participations',0,NULL,NULL,1),(373,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','665','370','Escomptes accordés',0,NULL,NULL,1),(374,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','666','370','Pertes de change',0,NULL,NULL,1),(375,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','667','370','Charges nettes sur cessions de valeurs mobilières de placement',0,NULL,NULL,1),(376,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','668','370','Autres charges financières',0,NULL,NULL,1),(377,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','67','1506','Charges exceptionnelles',0,NULL,NULL,1),(378,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','671','377','Charges exceptionnelles sur opérations de gestion',0,NULL,NULL,1),(379,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','672','377','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les charges sur exercices antérieurs)',0,NULL,NULL,1),(380,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','675','377','Valeurs comptables des éléments d\'actif cédés',0,NULL,NULL,1),(381,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','678','377','Autres charges exceptionnelles',0,NULL,NULL,1),(382,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','68','1506','Dotations aux amortissements et aux provisions',0,NULL,NULL,1),(383,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','681','382','Dotations aux amortissements et aux provisions - Charges d\'exploitation',0,NULL,NULL,1),(384,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','686','382','Dotations aux amortissements et aux provisions - Charges financières',0,NULL,NULL,1),(385,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','687','382','Dotations aux amortissements et aux provisions - Charges exceptionnelles',0,NULL,NULL,1),(386,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','69','1506','Participation des salariés - impôts sur les bénéfices et assimiles',0,NULL,NULL,1),(387,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','691','386','Participation des salariés aux résultats',0,NULL,NULL,1),(388,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','695','386','Impôts sur les bénéfices',0,NULL,NULL,1),(389,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','696','386','Suppléments d\'impôt sur les sociétés liés aux distributions',0,NULL,NULL,1),(390,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','697','386','Imposition forfaitaire annuelle des sociétés',0,NULL,NULL,1),(391,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','698','386','Intégration fiscale',0,NULL,NULL,1),(392,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','CHARGE','XXXXXX','699','386','Produits - Reports en arrière des déficits',0,NULL,NULL,1),(393,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','70','1507','Ventes de produits fabriqués, prestations de services, marchandises',0,NULL,NULL,1),(394,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','PRODUCT','701','393','Ventes de produits finis',0,NULL,NULL,1),(395,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','702','393','Ventes de produits intermédiaires',0,NULL,NULL,1),(396,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','703','393','Ventes de produits résiduels',0,NULL,NULL,1),(397,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','704','393','Travaux',0,NULL,NULL,1),(398,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','705','393','Etudes',0,NULL,NULL,1),(399,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','SERVICE','706','393','Prestations de services',0,NULL,NULL,1),(400,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','PRODUCT','707','393','Ventes de marchandises',0,NULL,NULL,1),(401,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','PRODUCT','708','393','Produits des activités annexes',0,NULL,NULL,1),(402,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','709','393','Rabais, remises et ristournes accordés par l\'entreprise',0,NULL,NULL,1),(403,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','71','1507','Production stockée (ou déstockage)',0,NULL,NULL,1),(404,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','713','403','Variation des stocks (en-cours de production, produits)',0,NULL,NULL,1),(405,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','72','1507','Production immobilisée',0,NULL,NULL,1),(406,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','721','405','Immobilisations incorporelles',0,NULL,NULL,1),(407,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','722','405','Immobilisations corporelles',0,NULL,NULL,1),(408,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','74','1507','Subventions d\'exploitation',0,NULL,NULL,1),(409,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','75','1507','Autres produits de gestion courante',0,NULL,NULL,1),(410,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','751','409','Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires',0,NULL,NULL,1),(411,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','752','409','Revenus des immeubles non affectés à des activités professionnelles',0,NULL,NULL,1),(412,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','753','409','Jetons de présence et rémunérations d\'administrateurs, gérants,...',0,NULL,NULL,1),(413,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','754','409','Ristournes perçues des coopératives (provenant des excédents)',0,NULL,NULL,1),(414,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','755','409','Quotes-parts de résultat sur opérations faites en commun',0,NULL,NULL,1),(415,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','758','409','Produits divers de gestion courante',0,NULL,NULL,1),(416,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','76','1507','Produits financiers',0,NULL,NULL,1),(417,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','761','416','Produits de participations',0,NULL,NULL,1),(418,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','762','416','Produits des autres immobilisations financières',0,NULL,NULL,1),(419,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','763','416','Revenus des autres créances',0,NULL,NULL,1),(420,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','764','416','Revenus des valeurs mobilières de placement',0,NULL,NULL,1),(421,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','765','416','Escomptes obtenus',0,NULL,NULL,1),(422,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','766','416','Gains de change',0,NULL,NULL,1),(423,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','767','416','Produits nets sur cessions de valeurs mobilières de placement',0,NULL,NULL,1),(424,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','768','416','Autres produits financiers',0,NULL,NULL,1),(425,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','77','1507','Produits exceptionnels',0,NULL,NULL,1),(426,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','771','425','Produits exceptionnels sur opérations de gestion',0,NULL,NULL,1),(427,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','772','425','(Compte à la disposition des entités pour enregistrer, en cours d\'exercice, les produits sur exercices antérieurs)',0,NULL,NULL,1),(428,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','775','425','Produits des cessions d\'éléments d\'actif',0,NULL,NULL,1),(429,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','777','425','Quote-part des subventions d\'investissement virée au résultat de l\'exercice',0,NULL,NULL,1),(430,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','778','425','Autres produits exceptionnels',0,NULL,NULL,1),(431,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','78','1507','Reprises sur amortissements et provisions',0,NULL,NULL,1),(432,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','781','431','Reprises sur amortissements et provisions (à inscrire dans les produits d\'exploitation)',0,NULL,NULL,1),(433,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','786','431','Reprises sur provisions pour risques (à inscrire dans les produits financiers)',0,NULL,NULL,1),(434,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','787','431','Reprises sur provisions (à inscrire dans les produits exceptionnels)',0,NULL,NULL,1),(435,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','79','1507','Transferts de charges',0,NULL,NULL,1),(436,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','791','435','Transferts de charges d\'exploitation ',0,NULL,NULL,1),(437,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','796','435','Transferts de charges financières',0,NULL,NULL,1),(438,1,NULL,'2016-01-22 17:28:15','PCG99-BASE','PROD','XXXXXX','797','435','Transferts de charges exceptionnelles',0,NULL,NULL,1),(439,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','10','1351','Capital',0,NULL,NULL,1),(440,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','100','439','Capital souscrit ou capital personnel',0,NULL,NULL,1),(441,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1000','440','Capital non amorti',0,NULL,NULL,1),(442,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1001','440','Capital amorti',0,NULL,NULL,1),(443,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','101','439','Capital non appelé',0,NULL,NULL,1),(444,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','109','439','Compte de l\'exploitant',0,NULL,NULL,1),(445,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1090','444','Opérations courantes',0,NULL,NULL,1),(446,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1091','444','Impôts personnels',0,NULL,NULL,1),(447,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1092','444','Rémunérations et autres avantages',0,NULL,NULL,1),(448,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','11','1351','Primes d\'émission',0,NULL,NULL,1),(449,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','12','1351','Plus-values de réévaluation',0,NULL,NULL,1),(450,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','120','449','Plus-values de réévaluation sur immobilisations incorporelles',0,NULL,NULL,1),(451,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1200','450','Plus-values de réévaluation',0,NULL,NULL,1),(452,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1201','450','Reprises de réductions de valeur',0,NULL,NULL,1),(453,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','121','449','Plus-values de réévaluation sur immobilisations corporelles',0,NULL,NULL,1),(454,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1210','453','Plus-values de réévaluation',0,NULL,NULL,1),(455,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1211','453','Reprises de réductions de valeur',0,NULL,NULL,1),(456,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','122','449','Plus-values de réévaluation sur immobilisations financières',0,NULL,NULL,1),(457,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1220','456','Plus-values de réévaluation',0,NULL,NULL,1),(458,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1221','456','Reprises de réductions de valeur',0,NULL,NULL,1),(459,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','123','449','Plus-values de réévaluation sur stocks',0,NULL,NULL,1),(460,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','124','449','Reprises de réductions de valeur sur placements de trésorerie',0,NULL,NULL,1),(461,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','13','1351','Réserve',0,NULL,NULL,1),(462,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','130','461','Réserve légale',0,NULL,NULL,1),(463,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','131','461','Réserves indisponibles',0,NULL,NULL,1),(464,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1310','463','Réserve pour actions propres',0,NULL,NULL,1),(465,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1311','463','Autres réserves indisponibles',0,NULL,NULL,1),(466,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','132','461','Réserves immunisées',0,NULL,NULL,1),(467,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','133','461','Réserves disponibles',0,NULL,NULL,1),(468,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1330','467','Réserve pour régularisation de dividendes',0,NULL,NULL,1),(469,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1331','467','Réserve pour renouvellement des immobilisations',0,NULL,NULL,1),(470,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1332','467','Réserve pour installations en faveur du personnel 1333 Réserves libres',0,NULL,NULL,1),(471,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','14','1351','Bénéfice reporté (ou perte reportée)',0,NULL,NULL,1),(472,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','15','1351','Subsides en capital',0,NULL,NULL,1),(473,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','150','472','Montants obtenus',0,NULL,NULL,1),(474,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','151','472','Montants transférés aux résultats',0,NULL,NULL,1),(475,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','16','1351','Provisions pour risques et charges',0,NULL,NULL,1),(476,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','160','475','Provisions pour pensions et obligations similaires',0,NULL,NULL,1),(477,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','161','475','Provisions pour charges fiscales',0,NULL,NULL,1),(478,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','162','475','Provisions pour grosses réparations et gros entretiens',0,NULL,NULL,1),(479,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','163','475','à 169 Provisions pour autres risques et charges',0,NULL,NULL,1),(480,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','164','475','Provisions pour sûretés personnelles ou réelles constituées à l\'appui de dettes et d\'engagements de tiers',0,NULL,NULL,1),(481,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','165','475','Provisions pour engagements relatifs à l\'acquisition ou à la cession d\'immobilisations',0,NULL,NULL,1),(482,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','166','475','Provisions pour exécution de commandes passées ou reçues',0,NULL,NULL,1),(483,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','167','475','Provisions pour positions et marchés à terme en devises ou positions et marchés à terme en marchandises',0,NULL,NULL,1),(484,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','168','475','Provisions pour garanties techniques attachées aux ventes et prestations déjà effectuées par l\'entreprise',0,NULL,NULL,1),(485,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','169','475','Provisions pour autres risques et charges',0,NULL,NULL,1),(486,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1690','485','Pour litiges en cours',0,NULL,NULL,1),(487,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1691','485','Pour amendes, doubles droits et pénalités',0,NULL,NULL,1),(488,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1692','485','Pour propre assureur',0,NULL,NULL,1),(489,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1693','485','Pour risques inhérents aux opérations de crédits à moyen ou long terme',0,NULL,NULL,1),(490,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1695','485','Provision pour charge de liquidation',0,NULL,NULL,1),(491,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1696','485','Provision pour départ de personnel',0,NULL,NULL,1),(492,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1699','485','Pour risques divers',0,NULL,NULL,1),(493,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17','1351','Dettes à plus d\'un an',0,NULL,NULL,1),(494,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','170','493','Emprunts subordonnés',0,NULL,NULL,1),(495,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1700','494','Convertibles',0,NULL,NULL,1),(496,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1701','494','Non convertibles',0,NULL,NULL,1),(497,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','171','493','Emprunts obligataires non subordonnés',0,NULL,NULL,1),(498,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1710','498','Convertibles',0,NULL,NULL,1),(499,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1711','498','Non convertibles',0,NULL,NULL,1),(500,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','172','493','Dettes de location-financement et assimilés',0,NULL,NULL,1),(501,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1720','500','Dettes de location-financement de biens immobiliers',0,NULL,NULL,1),(502,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1721','500','Dettes de location-financement de biens mobiliers',0,NULL,NULL,1),(503,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1722','500','Dettes sur droits réels sur immeubles',0,NULL,NULL,1),(504,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','173','493','Etablissements de crédit',0,NULL,NULL,1),(505,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1730','504','Dettes en compte',0,NULL,NULL,1),(506,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17300','505','Banque A',0,NULL,NULL,1),(507,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17301','505','Banque B',0,NULL,NULL,1),(508,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17302','505','Banque C',0,NULL,NULL,1),(509,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17303','505','Banque D',0,NULL,NULL,1),(510,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1731','504','Promesses',0,NULL,NULL,1),(511,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17310','510','Banque A',0,NULL,NULL,1),(512,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17311','510','Banque B',0,NULL,NULL,1),(513,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17312','510','Banque C',0,NULL,NULL,1),(514,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17313','510','Banque D',0,NULL,NULL,1),(515,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1732','504','Crédits d\'acceptation',0,NULL,NULL,1),(516,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17320','515','Banque A',0,NULL,NULL,1),(517,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17321','515','Banque B',0,NULL,NULL,1),(518,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17322','515','Banque C',0,NULL,NULL,1),(519,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17323','515','Banque D',0,NULL,NULL,1),(520,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','174','493','Autres emprunts',0,NULL,NULL,1),(521,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175','493','Dettes commerciales',0,NULL,NULL,1),(522,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1750','521','Fournisseurs : dettes en compte',0,NULL,NULL,1),(523,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17500','522','Entreprises apparentées',0,NULL,NULL,1),(524,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175000','523','Entreprises liées',0,NULL,NULL,1),(525,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175001','523','Entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(526,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17501','522','Fournisseurs ordinaires',0,NULL,NULL,1),(527,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175010','526','Fournisseurs belges',0,NULL,NULL,1),(528,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175011','526','Fournisseurs C.E.E.',0,NULL,NULL,1),(529,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175012','526','Fournisseurs importation',0,NULL,NULL,1),(530,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1751','521','Effets à payer',0,NULL,NULL,1),(531,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17510','530','Entreprises apparentées',0,NULL,NULL,1),(532,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175100','531','Entreprises liées',0,NULL,NULL,1),(533,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175101','531','Entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(534,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','17511','530','Fournisseurs ordinaires',0,NULL,NULL,1),(535,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175110','534','Fournisseurs belges',0,NULL,NULL,1),(536,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175111','534','Fournisseurs C.E.E.',0,NULL,NULL,1),(537,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','175112','534','Fournisseurs importation',0,NULL,NULL,1),(538,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','176','493','Acomptes reçus sur commandes',0,NULL,NULL,1),(539,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','178','493','Cautionnements reçus en numéraires',0,NULL,NULL,1),(540,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','179','493','Dettes diverses',0,NULL,NULL,1),(541,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1790','540','Entreprises liées',0,NULL,NULL,1),(542,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1791','540','Autres entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(543,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1792','540','Administrateurs, gérants et associés',0,NULL,NULL,1),(544,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1794','540','Rentes viagères capitalisées',0,NULL,NULL,1),(545,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1798','540','Dettes envers les coparticipants des associations momentanées et en participation',0,NULL,NULL,1),(546,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','1799','540','Autres dettes diverses',0,NULL,NULL,1),(547,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','CAPIT','XXXXXX','18','1351','Comptes de liaison des établissements et succursales',0,NULL,NULL,1),(548,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','20','1352','Frais d\'établissement',0,NULL,NULL,1),(549,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','200','548','Frais de constitution et d\'augmentation de capital',0,NULL,NULL,1),(550,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2000','549','Frais de constitution et d\'augmentation de capital',0,NULL,NULL,1),(551,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2009','549','Amortissements sur frais de constitution et d\'augmentation de capital',0,NULL,NULL,1),(552,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','201','548','Frais d\'émission d\'emprunts et primes de remboursement',0,NULL,NULL,1),(553,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2010','552','Agios sur emprunts et frais d\'émission d\'emprunts',0,NULL,NULL,1),(554,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2019','552','Amortissements sur agios sur emprunts et frais d\'émission d\'emprunts',0,NULL,NULL,1),(555,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','202','548','Autres frais d\'établissement',0,NULL,NULL,1),(556,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2020','555','Autres frais d\'établissement',0,NULL,NULL,1),(557,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2029','555','Amortissements sur autres frais d\'établissement',0,NULL,NULL,1),(558,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','203','548','Intérêts intercalaires',0,NULL,NULL,1),(559,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2030','558','Intérêts intercalaires',0,NULL,NULL,1),(560,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2039','558','Amortissements sur intérêts intercalaires',0,NULL,NULL,1),(561,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','204','548','Frais de restructuration',0,NULL,NULL,1),(562,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2040','561','Coût des frais de restructuration',0,NULL,NULL,1),(563,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2049','561','Amortissements sur frais de restructuration',0,NULL,NULL,1),(564,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','21','1352','Immobilisations incorporelles',0,NULL,NULL,1),(565,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','210','564','Frais de recherche et de développement',0,NULL,NULL,1),(566,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2100','565','Frais de recherche et de mise au point',0,NULL,NULL,1),(567,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2108','565','Plus-values actées sur frais de recherche et de mise au point',0,NULL,NULL,1),(568,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2109','565','Amortissements sur frais de recherche et de mise au point',0,NULL,NULL,1),(569,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','211','564','Concessions, brevets, licences, savoir-faire, marque et droits similaires',0,NULL,NULL,1),(570,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2110','569','Concessions, brevets, licences, marques, etc',0,NULL,NULL,1),(571,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2118','569','Plus-values actées sur concessions, etc',0,NULL,NULL,1),(572,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2119','569','Amortissements sur concessions, etc',0,NULL,NULL,1),(573,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','212','564','Goodwill',0,NULL,NULL,1),(574,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2120','573','Coût d\'acquisition',0,NULL,NULL,1),(575,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2128','573','Plus-values actées',0,NULL,NULL,1),(576,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2129','573','Amortissements sur goodwill',0,NULL,NULL,1),(577,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','213','564','Acomptes versés',0,NULL,NULL,1),(578,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22','1352','Terrains et constructions',0,NULL,NULL,1),(579,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','220','578','Terrains',0,NULL,NULL,1),(580,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2200','579','Terrains',0,NULL,NULL,1),(581,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2201','579','Frais d\'acquisition sur terrains',0,NULL,NULL,1),(582,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2208','579','Plus-values actées sur terrains',0,NULL,NULL,1),(583,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2209','579','Amortissements et réductions de valeur',0,NULL,NULL,1),(584,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22090','583','Amortissements sur frais d\'acquisition',0,NULL,NULL,1),(585,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22091','583','Réductions de valeur sur terrains',0,NULL,NULL,1),(586,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','221','578','Constructions',0,NULL,NULL,1),(587,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2210','586','Bâtiments industriels',0,NULL,NULL,1),(588,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2211','586','Bâtiments administratifs et commerciaux',0,NULL,NULL,1),(589,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2212','586','Autres bâtiments d\'exploitation',0,NULL,NULL,1),(590,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2213','586','Voies de transport et ouvrages d\'art',0,NULL,NULL,1),(591,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2215','586','Constructions sur sol d\'autrui',0,NULL,NULL,1),(592,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2216','586','Frais d\'acquisition sur constructions',0,NULL,NULL,1),(593,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2218','586','Plus-values actées',0,NULL,NULL,1),(594,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22180','593','Sur bâtiments industriels',0,NULL,NULL,1),(595,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22181','593','Sur bâtiments administratifs et commerciaux',0,NULL,NULL,1),(596,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22182','593','Sur autres bâtiments d\'exploitation',0,NULL,NULL,1),(597,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22184','593','Sur voies de transport et ouvrages d\'art',0,NULL,NULL,1),(598,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2219','586','Amortissements sur constructions',0,NULL,NULL,1),(599,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22190','598','Sur bâtiments industriels',0,NULL,NULL,1),(600,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22191','598','Sur bâtiments administratifs et commerciaux',0,NULL,NULL,1),(601,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22192','598','Sur autres bâtiments d\'exploitation',0,NULL,NULL,1),(602,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22194','598','Sur voies de transport et ouvrages d\'art',0,NULL,NULL,1),(603,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22195','598','Sur constructions sur sol d\'autrui',0,NULL,NULL,1),(604,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22196','598','Sur frais d\'acquisition sur constructions',0,NULL,NULL,1),(605,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','222','578','Terrains bâtis',0,NULL,NULL,1),(606,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2220','605','Valeur d\'acquisition',0,NULL,NULL,1),(607,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22200','606','Bâtiments industriels',0,NULL,NULL,1),(608,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22201','606','Bâtiments administratifs et commerciaux',0,NULL,NULL,1),(609,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22202','606','Autres bâtiments d\'exploitation',0,NULL,NULL,1),(610,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22203','606','Voies de transport et ouvrages d\'art',0,NULL,NULL,1),(611,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22204','606','Frais d\'acquisition des terrains à bâtir',0,NULL,NULL,1),(612,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2228','605','Plus-values actées',0,NULL,NULL,1),(613,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22280','612','Sur bâtiments industriels',0,NULL,NULL,1),(614,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22281','612','Sur bâtiments administratifs et commerciaux',0,NULL,NULL,1),(615,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22282','612','Sur autres bâtiments d\'exploitation',0,NULL,NULL,1),(616,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22283','612','Sur voies de transport et ouvrages d\'art',0,NULL,NULL,1),(617,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2229','605','Amortissements sur terrains bâtis',0,NULL,NULL,1),(618,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22290','617','Sur bâtiments industriels',0,NULL,NULL,1),(619,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22291','617','Sur bâtiments administratifs et commerciaux',0,NULL,NULL,1),(620,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22292','617','Sur autres bâtiments d\'exploitation',0,NULL,NULL,1),(621,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22293','617','Sur voies de transport et ouvrages d\'art',0,NULL,NULL,1),(622,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','22294','617','Sur frais d\'acquisition des terrains bâtis',0,NULL,NULL,1),(623,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','223','578','Autres droits réels sur des immeubles',0,NULL,NULL,1),(624,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2230','623','Valeur d\'acquisition',0,NULL,NULL,1),(625,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2238','623','Plus-values actées',0,NULL,NULL,1),(626,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2239','623','Amortissements',0,NULL,NULL,1),(627,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','23','1352','Installations, machines et outillages',0,NULL,NULL,1),(628,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','230','627','Installations',0,NULL,NULL,1),(629,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2300','628','Installations bâtiments industriels',0,NULL,NULL,1),(630,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2301','628','Installations bâtiments administratifs et commerciaux',0,NULL,NULL,1),(631,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2302','628','Installations bâtiments d\'exploitation',0,NULL,NULL,1),(632,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2303','628','Installations voies de transport et ouvrages d\'art',0,NULL,NULL,1),(633,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2300','628','Installation d\'eau',0,NULL,NULL,1),(634,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2301','628','Installation d\'électricité',0,NULL,NULL,1),(635,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2302','628','Installation de vapeur',0,NULL,NULL,1),(636,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2303','628','Installation de gaz',0,NULL,NULL,1),(637,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2304','628','Installation de chauffage',0,NULL,NULL,1),(638,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2305','628','Installation de conditionnement d\'air',0,NULL,NULL,1),(639,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2306','628','Installation de chargement',0,NULL,NULL,1),(640,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','231','627','Machines',0,NULL,NULL,1),(641,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2310','640','Division A',0,NULL,NULL,1),(642,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2311','640','Division B',0,NULL,NULL,1),(643,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2312','640','Division C',0,NULL,NULL,1),(644,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','237','627','Outillage',0,NULL,NULL,1),(645,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2370','644','Division A',0,NULL,NULL,1),(646,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2371','644','Division B',0,NULL,NULL,1),(647,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2372','644','Division C',0,NULL,NULL,1),(648,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','238','627','Plus-values actées',0,NULL,NULL,1),(649,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2380','648','Sur installations',0,NULL,NULL,1),(650,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2381','648','Sur machines',0,NULL,NULL,1),(651,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2382','648','Sur outillage',0,NULL,NULL,1),(652,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','239','627','Amortissements',0,NULL,NULL,1),(653,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2390','652','Sur installations',0,NULL,NULL,1),(654,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2391','652','Sur machines',0,NULL,NULL,1),(655,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2392','652','Sur outillage',0,NULL,NULL,1),(656,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24','1352','Mobilier et matériel roulant',0,NULL,NULL,1),(657,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','240','656','Mobilier',0,NULL,NULL,1),(658,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2400','656','Mobilier',0,NULL,NULL,1),(659,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24000','658','Mobilier des bâtiments industriels',0,NULL,NULL,1),(660,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24001','658','Mobilier des bâtiments administratifs et commerciaux',0,NULL,NULL,1),(661,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24002','658','Mobilier des autres bâtiments d\'exploitation',0,NULL,NULL,1),(662,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24003','658','Mobilier oeuvres sociales',0,NULL,NULL,1),(663,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2401','657','Matériel de bureau et de service social',0,NULL,NULL,1),(664,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24010','663','Des bâtiments industriels',0,NULL,NULL,1),(665,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24011','663','Des bâtiments administratifs et commerciaux',0,NULL,NULL,1),(666,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24012','663','Des autres bâtiments d\'exploitation',0,NULL,NULL,1),(667,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24013','663','Des oeuvres sociales',0,NULL,NULL,1),(668,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2408','657','Plus-values actées',0,NULL,NULL,1),(669,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24080','668','Plus-values actées sur mobilier',0,NULL,NULL,1),(670,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24081','668','Plus-values actées sur matériel de bureau et service social',0,NULL,NULL,1),(671,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2409','657','Amortissements',0,NULL,NULL,1),(672,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24090','671','Amortissements sur mobilier',0,NULL,NULL,1),(673,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24091','671','Amortissements sur matériel de bureau et service social',0,NULL,NULL,1),(674,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','241','656','Matériel roulant',0,NULL,NULL,1),(675,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2410','674','Matériel automobile',0,NULL,NULL,1),(676,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24100','675','Voitures',0,NULL,NULL,1),(677,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24105','675','Camions',0,NULL,NULL,1),(678,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2411','674','Matériel ferroviaire',0,NULL,NULL,1),(679,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2412','674','Matériel fluvial',0,NULL,NULL,1),(680,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2413','674','Matériel naval',0,NULL,NULL,1),(681,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2414','674','Matériel aérien',0,NULL,NULL,1),(682,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2418','674','Plus-values sur matériel roulant',0,NULL,NULL,1),(683,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24180','682','Plus-values sur matériel automobile',0,NULL,NULL,1),(684,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24181','682','Idem sur matériel ferroviaire',0,NULL,NULL,1),(685,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24182','682','Idem sur matériel fluvial',0,NULL,NULL,1),(686,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24183','682','Idem sur matériel naval',0,NULL,NULL,1),(687,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24184','682','Idem sur matériel aérien',0,NULL,NULL,1),(688,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2419','674','Amortissements sur matériel roulant',0,NULL,NULL,1),(689,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24190','688','Amortissements sur matériel automobile',0,NULL,NULL,1),(690,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24191','688','Idem sur matériel ferroviaire',0,NULL,NULL,1),(691,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24192','688','Idem sur matériel fluvial',0,NULL,NULL,1),(692,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24193','688','Idem sur matériel naval',0,NULL,NULL,1),(693,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','24194','688','Idem sur matériel aérien',0,NULL,NULL,1),(694,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','25','1352','Immobilisation détenues en location-financement et droits similaires',0,NULL,NULL,1),(695,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','250','694','Terrains et constructions',0,NULL,NULL,1),(696,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2500','695','Terrains',0,NULL,NULL,1),(697,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2501','695','Constructions',0,NULL,NULL,1),(698,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2508','695','Plus-values sur emphytéose, leasing et droits similaires : terrains et constructions',0,NULL,NULL,1),(699,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2509','695','Amortissements et réductions de valeur sur terrains et constructions en leasing',0,NULL,NULL,1),(700,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','251','694','Installations, machines et outillage',0,NULL,NULL,1),(701,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2510','700','Installations',0,NULL,NULL,1),(702,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2511','700','Machines',0,NULL,NULL,1),(703,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2512','700','Outillage',0,NULL,NULL,1),(704,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2518','700','Plus-values actées sur installations machines et outillage pris en leasing',0,NULL,NULL,1),(705,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2519','700','Amortissements sur installations machines et outillage pris en leasing',0,NULL,NULL,1),(706,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','252','694','Mobilier et matériel roulant',0,NULL,NULL,1),(707,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2520','706','Mobilier',0,NULL,NULL,1),(708,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2521','706','Matériel roulant',0,NULL,NULL,1),(709,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2528','706','Plus-values actées sur mobilier et matériel roulant en leasing',0,NULL,NULL,1),(710,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2529','706','Amortissements sur mobilier et matériel roulant en leasing',0,NULL,NULL,1),(711,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','26','1352','Autres immobilisations corporelles',0,NULL,NULL,1),(712,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','260','711','Frais d\'aménagements de locaux pris en location',0,NULL,NULL,1),(713,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','261','711','Maison d\'habitation',0,NULL,NULL,1),(714,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','262','711','Réserve immobilière',0,NULL,NULL,1),(715,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','263','711','Matériel d\'emballage',0,NULL,NULL,1),(716,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','264','711','Emballages récupérables',0,NULL,NULL,1),(717,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','268','711','Plus-values actées sur autres immobilisations corporelles',0,NULL,NULL,1),(718,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','269','711','Amortissements sur autres immobilisations corporelles',0,NULL,NULL,1),(719,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2690','718','Amortissements sur frais d\'aménagement des locaux pris en location',0,NULL,NULL,1),(720,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2691','718','Amortissements sur maison d\'habitation',0,NULL,NULL,1),(721,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2692','718','Amortissements sur réserve immobilière',0,NULL,NULL,1),(722,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2693','718','Amortissements sur matériel d\'emballage',0,NULL,NULL,1),(723,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2694','718','Amortissements sur emballages récupérables',0,NULL,NULL,1),(724,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','27','1352','Immobilisations corporelles en cours et acomptes versés',0,NULL,NULL,1),(725,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','270','724','Immobilisations en cours',0,NULL,NULL,1),(726,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2700','725','Constructions',0,NULL,NULL,1),(727,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2701','725','Installations machines et outillage',0,NULL,NULL,1),(728,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2702','725','Mobilier et matériel roulant',0,NULL,NULL,1),(729,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2703','725','Autres immobilisations corporelles',0,NULL,NULL,1),(730,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','271','724','Avances et acomptes versés sur immobilisations en cours',0,NULL,NULL,1),(731,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','28','1352','Immobilisations financières',0,NULL,NULL,1),(732,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','280','731','Participations dans des entreprises liées',0,NULL,NULL,1),(733,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2800','732','Valeur d\'acquisition (peut être subdivisé par participation)',0,NULL,NULL,1),(734,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2801','732','Montants non appelés (idem)',0,NULL,NULL,1),(735,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2808','732','Plus-values actées (idem)',0,NULL,NULL,1),(736,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2809','732','Réductions de valeurs actées (idem)',0,NULL,NULL,1),(737,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','281','731','Créances sur des entreprises liées',0,NULL,NULL,1),(738,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2810','737','Créances en compte',0,NULL,NULL,1),(739,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2811','737','Effets à recevoir',0,NULL,NULL,1),(740,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2812','737','Titres à revenu fixes',0,NULL,NULL,1),(741,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2817','737','Créances douteuses',0,NULL,NULL,1),(742,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2819','737','Réductions de valeurs actées',0,NULL,NULL,1),(743,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','282','731','Participations dans des entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(744,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2820','743','Valeur d\'acquisition (peut être subdivisé par participation)',0,NULL,NULL,1),(745,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2821','743','Montants non appelés (idem)',0,NULL,NULL,1),(746,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2828','743','Plus-values actées (idem)',0,NULL,NULL,1),(747,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2829','743','Réductions de valeurs actées (idem)',0,NULL,NULL,1),(748,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','283','731','Créances sur des entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(749,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2830','748','Créances en compte',0,NULL,NULL,1),(750,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2831','748','Effets à recevoir',0,NULL,NULL,1),(751,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2832','748','Titres à revenu fixe',0,NULL,NULL,1),(752,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2837','748','Créances douteuses',0,NULL,NULL,1),(753,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','2839','748','Réductions de valeurs actées',0,NULL,NULL,1),(754,1,NULL,'2016-01-22 17:28:15','PCMN-BASE','IMMO','XXXXXX','284','731','Autres actions et parts',0,NULL,NULL,1),(755,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2840','754','Valeur d\'acquisition',0,NULL,NULL,1),(756,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2841','754','Montants non appelés',0,NULL,NULL,1),(757,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2848','754','Plus-values actées',0,NULL,NULL,1),(758,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2849','754','Réductions de valeur actées',0,NULL,NULL,1),(759,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','285','731','Autres créances',0,NULL,NULL,1),(760,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2850','759','Créances en compte',0,NULL,NULL,1),(761,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2851','759','Effets à recevoir',0,NULL,NULL,1),(762,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2852','759','Titres à revenu fixe',0,NULL,NULL,1),(763,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2857','759','Créances douteuses',0,NULL,NULL,1),(764,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2859','759','Réductions de valeur actées',0,NULL,NULL,1),(765,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','288','731','Cautionnements versés en numéraires',0,NULL,NULL,1),(766,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2880','765','Téléphone, téléfax, télex',0,NULL,NULL,1),(767,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2881','765','Gaz',0,NULL,NULL,1),(768,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2882','765','Eau',0,NULL,NULL,1),(769,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2883','765','Electricité',0,NULL,NULL,1),(770,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2887','765','Autres cautionnements versés en numéraires',0,NULL,NULL,1),(771,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29','1352','Créances à plus d\'un an',0,NULL,NULL,1),(772,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','290','771','Créances commerciales',0,NULL,NULL,1),(773,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2900','772','Clients',0,NULL,NULL,1),(774,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29000','773','Créances en compte sur entreprises liées',0,NULL,NULL,1),(775,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29001','773','Sur entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(776,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29002','773','Sur clients Belgique',0,NULL,NULL,1),(777,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29003','773','Sur clients C.E.E.',0,NULL,NULL,1),(778,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29004','773','Sur clients exportation hors C.E.E.',0,NULL,NULL,1),(779,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29005','773','Créances sur les coparticipants (associations momentanées)',0,NULL,NULL,1),(780,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2901','772','Effets à recevoir',0,NULL,NULL,1),(781,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29010','780','Sur entreprises liées',0,NULL,NULL,1),(782,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29011','780','Sur entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(783,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29012','780','Sur clients Belgique',0,NULL,NULL,1),(784,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29013','780','Sur clients C.E.E.',0,NULL,NULL,1),(785,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29014','780','Sur clients exportation hors C.E.E.',0,NULL,NULL,1),(786,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2905','772','Retenues sur garanties',0,NULL,NULL,1),(787,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2906','772','Acomptes versés',0,NULL,NULL,1),(788,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2907','772','Créances douteuses (à ventiler comme clients 2900)',0,NULL,NULL,1),(789,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2909','772','Réductions de valeur actées (à ventiler comme clients 2900)',0,NULL,NULL,1),(790,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','291','771','Autres créances',0,NULL,NULL,1),(791,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2910','790','Créances en compte',0,NULL,NULL,1),(792,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29100','791','Sur entreprises liées',0,NULL,NULL,1),(793,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29101','791','Sur entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(794,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29102','791','Sur autres débiteurs',0,NULL,NULL,1),(795,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2911','790','Effets à recevoir',0,NULL,NULL,1),(796,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29110','795','Sur entreprises liées',0,NULL,NULL,1),(797,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29111','795','Sur entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(798,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','29112','795','Sur autres débiteurs',0,NULL,NULL,1),(799,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2912','790','Créances résultant de la cession d\'immobilisations données en leasing',0,NULL,NULL,1),(800,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2917','790','Créances douteuses',0,NULL,NULL,1),(801,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','IMMO','XXXXXX','2919','790','Réductions de valeur actées',0,NULL,NULL,1),(802,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','30','1353','Approvisionnements - matières premières',0,NULL,NULL,1),(803,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','300','802','Valeur d\'acquisition',0,NULL,NULL,1),(804,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','309','802','Réductions de valeur actées',0,NULL,NULL,1),(805,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','31','1353','Approvsionnements et fournitures',0,NULL,NULL,1),(806,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','310','805','Valeur d\'acquisition',0,NULL,NULL,1),(807,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3100','806','Matières d\'approvisionnement',0,NULL,NULL,1),(808,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3101','806','Energie, charbon, coke, mazout, essence, propane',0,NULL,NULL,1),(809,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3102','806','Produits d\'entretien',0,NULL,NULL,1),(810,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3103','806','Fournitures diverses et petit outillage',0,NULL,NULL,1),(811,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3104','806','Imprimés et fournitures de bureau',0,NULL,NULL,1),(812,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3105','806','Fournitures de services sociaux',0,NULL,NULL,1),(813,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3106','806','Emballages commerciaux',0,NULL,NULL,1),(814,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','31060','813','Emballages perdus',0,NULL,NULL,1),(815,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','31061','813','Emballages récupérables',0,NULL,NULL,1),(816,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','319','805','Réductions de valeur actées',0,NULL,NULL,1),(817,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','32','1353','En cours de fabrication',0,NULL,NULL,1),(818,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','320','817','Valeur d\'acquisition',0,NULL,NULL,1),(819,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3200','818','Produits semi-ouvrés',0,NULL,NULL,1),(820,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3201','818','Produits en cours de fabrication',0,NULL,NULL,1),(821,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3202','818','Travaux en cours',0,NULL,NULL,1),(822,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3205','818','Déchets',0,NULL,NULL,1),(823,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3206','818','Rebuts',0,NULL,NULL,1),(824,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3209','818','Travaux en association momentanée',0,NULL,NULL,1),(825,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','329','817','Réductions de valeur actées',0,NULL,NULL,1),(826,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','33','1353','Produits finis',0,NULL,NULL,1),(827,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','330','826','Valeur d\'acquisition',0,NULL,NULL,1),(828,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3300','827','Produits finis',0,NULL,NULL,1),(829,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','339','826','Réductions de valeur actées',0,NULL,NULL,1),(830,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','34','1353','Marchandises',0,NULL,NULL,1),(831,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','340','830','Valeur d\'acquisition',0,NULL,NULL,1),(832,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3400','831','Groupe A',0,NULL,NULL,1),(833,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3401','831','Groupe B',0,NULL,NULL,1),(834,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3402','831','Groupe C',0,NULL,NULL,1),(835,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','349','830','Réductions de valeur actées',0,NULL,NULL,1),(836,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','35','1353','Immeubles destinés à la vente',0,NULL,NULL,1),(837,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','350','836','Valeur d\'acquisition',0,NULL,NULL,1),(838,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3500','837','Immeuble A',0,NULL,NULL,1),(839,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3501','837','Immeuble B',0,NULL,NULL,1),(840,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3502','837','Immeuble C',0,NULL,NULL,1),(841,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','351','836','Immeubles construits en vue de leur revente',0,NULL,NULL,1),(842,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3510','841','Immeuble A',0,NULL,NULL,1),(843,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3511','841','Immeuble B',0,NULL,NULL,1),(844,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','3512','841','Immeuble C',0,NULL,NULL,1),(845,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','359','836','Réductions de valeurs actées',0,NULL,NULL,1),(846,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','36','1353','Acomptes versés sur achats pour stocks',0,NULL,NULL,1),(847,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','360','846','Acomptes versés (à ventiler éventuellement par catégorie)',0,NULL,NULL,1),(848,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','369','846','Réductions de valeur actées',0,NULL,NULL,1),(849,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','37','1353','Commandes en cours d\'exécution',0,NULL,NULL,1),(850,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','370','849','Valeur d\'acquisition',0,NULL,NULL,1),(851,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','371','849','Bénéfice pris en compte',0,NULL,NULL,1),(852,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','STOCK','XXXXXX','379','849','Réductions de valeur actées',0,NULL,NULL,1),(853,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','40','1354','Créances commerciales',0,NULL,NULL,1),(854,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','400','853','Clients',0,NULL,NULL,1),(855,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4007','854','Rabais, remises et ristournes à accorder et autres notes de crédit à établir',0,NULL,NULL,1),(856,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4008','854','Créances résultant de livraisons de biens (associations momentanées)',0,NULL,NULL,1),(857,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','401','853','Effets à recevoir',0,NULL,NULL,1),(858,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4010','857','Effets à recevoir',0,NULL,NULL,1),(859,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4013','857','Effets à l\'encaissement',0,NULL,NULL,1),(860,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4015','857','Effets à l\'escompte',0,NULL,NULL,1),(861,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','402','853','Clients, créances courantes, entreprises apparentées, administrateurs et gérants',0,NULL,NULL,1),(862,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4020','861','Entreprises liées',0,NULL,NULL,1),(863,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4021','861','Autres entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(864,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4022','861','Administrateurs et gérants d\'entreprise',0,NULL,NULL,1),(865,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','403','853','Effets à recevoir sur entreprises apparentées et administrateurs et gérants',0,NULL,NULL,1),(866,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4030','865','Entreprises liées',0,NULL,NULL,1),(867,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4031','865','Autres entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(868,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4032','865','Administrateurs et gérants de l\'entreprise',0,NULL,NULL,1),(869,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','404','853','Produits à recevoir (factures à établir)',0,NULL,NULL,1),(870,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','405','853','Clients : retenues sur garanties',0,NULL,NULL,1),(871,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','406','853','Acomptes versés',0,NULL,NULL,1),(872,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','407','853','Créances douteuses',0,NULL,NULL,1),(873,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','408','853','Compensation clients',0,NULL,NULL,1),(874,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','409','853','Réductions de valeur actées',0,NULL,NULL,1),(875,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','41','1354','Autres créances',0,NULL,NULL,1),(876,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','410','875','Capital appelé, non versé',0,NULL,NULL,1),(877,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4100','876','Appels de fonds',0,NULL,NULL,1),(878,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4101','876','Actionnaires défaillants',0,NULL,NULL,1),(879,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','411','875','T.V.A. à récupérer',0,NULL,NULL,1),(880,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4110','879','T.V.A. due',0,NULL,NULL,1),(881,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4111','879','T.V.A. déductible',0,NULL,NULL,1),(882,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4112','879','Compte courant administration T.V.A.',0,NULL,NULL,1),(883,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4118','879','Taxe d\'égalisation due',0,NULL,NULL,1),(884,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','412','875','Impôts et versements fiscaux à récupérer',0,NULL,NULL,1),(885,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4120','884','Impôts belges sur le résultat',0,NULL,NULL,1),(886,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4125','884','Autres impôts belges',0,NULL,NULL,1),(887,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4128','884','Impôts étrangers',0,NULL,NULL,1),(888,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','414','875','Produits à recevoir',0,NULL,NULL,1),(889,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','416','875','Créances diverses',0,NULL,NULL,1),(890,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4160','889','Associés (compte d\'apport en société)',0,NULL,NULL,1),(891,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4161','889','Avances et prêts au personnel',0,NULL,NULL,1),(892,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4162','889','Compte courant des associés en S.P.R.L.',0,NULL,NULL,1),(893,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4163','889','Compte courant des administrateurs et gérants',0,NULL,NULL,1),(894,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4164','889','Créances sur sociétés apparentées',0,NULL,NULL,1),(895,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4166','889','Emballages et matériel à rendre',0,NULL,NULL,1),(896,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4167','889','Etat et établissements publics',0,NULL,NULL,1),(897,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','41670','896','Subsides à recevoir',0,NULL,NULL,1),(898,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','41671','896','Autres créances',0,NULL,NULL,1),(899,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4168','889','Rabais, ristournes et remises à obtenir et autres avoirs non encore reçus',0,NULL,NULL,1),(900,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','417','875','Créances douteuses',0,NULL,NULL,1),(901,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','418','875','Cautionnements versés en numéraires',0,NULL,NULL,1),(902,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','419','875','Réductions de valeur actées',0,NULL,NULL,1),(903,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','42','1354','Dettes à plus d\'un an échéant dans l\'année',0,NULL,NULL,1),(904,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','420','903','Emprunts subordonnés',0,NULL,NULL,1),(905,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4200','904','Convertibles',0,NULL,NULL,1),(906,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4201','904','Non convertibles',0,NULL,NULL,1),(907,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','421','903','Emprunts obligataires non subordonnés',0,NULL,NULL,1),(908,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4210','907','Convertibles',0,NULL,NULL,1),(909,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4211','907','Non convertibles',0,NULL,NULL,1),(910,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','422','903','Dettes de location-financement et assimilées',0,NULL,NULL,1),(911,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4220','910','Financement de biens immobiliers',0,NULL,NULL,1),(912,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4221','910','Financement de biens mobiliers',0,NULL,NULL,1),(913,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','423','903','Etablissements de crédit',0,NULL,NULL,1),(914,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4230','913','Dettes en compte',0,NULL,NULL,1),(915,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4231','913','Promesses',0,NULL,NULL,1),(916,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4232','913','Crédits d\'acceptation',0,NULL,NULL,1),(917,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','424','903','Autres emprunts',0,NULL,NULL,1),(918,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','425','903','Dettes commerciales',0,NULL,NULL,1),(919,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4250','918','Fournisseurs',0,NULL,NULL,1),(920,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4251','918','Effets à payer',0,NULL,NULL,1),(921,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','426','903','Cautionnements reçus en numéraires',0,NULL,NULL,1),(922,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','429','903','Dettes diverses',0,NULL,NULL,1),(923,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4290','922','Entreprises liées',0,NULL,NULL,1),(924,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4291','922','Entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(925,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4292','922','Administrateurs, gérants, associés',0,NULL,NULL,1),(926,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4299','922','Autres dettes',0,NULL,NULL,1),(927,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','43','1354','Dettes financières',0,NULL,NULL,1),(928,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','430','927','Etablissements de crédit. Emprunts en compte à terme fixe',0,NULL,NULL,1),(929,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','431','927','Etablissements de crédit. Promesses',0,NULL,NULL,1),(930,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','432','927','Etablissements de crédit. Crédits d\'acceptation',0,NULL,NULL,1),(931,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','433','927','Etablissements de crédit. Dettes en compte courant',0,NULL,NULL,1),(932,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','439','927','Autres emprunts',0,NULL,NULL,1),(933,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44','1354','Dettes commerciales',0,NULL,NULL,1),(934,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','440','933','Fournisseurs',0,NULL,NULL,1),(935,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4400','934','Entreprises apparentées',0,NULL,NULL,1),(936,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44000','935','Entreprises liées',0,NULL,NULL,1),(937,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44001','935','Entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(938,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4401','934','Fournisseurs ordinaires',0,NULL,NULL,1),(939,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44010','938','Fournisseurs belges',0,NULL,NULL,1),(940,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44011','938','Fournisseurs CEE',0,NULL,NULL,1),(941,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44012','938','Fournisseurs importation',0,NULL,NULL,1),(942,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4402','934','Dettes envers les coparticipants (associations momentanées)',0,NULL,NULL,1),(943,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4403','934','Fournisseurs - retenues de garanties',0,NULL,NULL,1),(944,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','441','933','Effets à payer',0,NULL,NULL,1),(945,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4410','944','Entreprises apparentées',0,NULL,NULL,1),(946,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44100','945','Entreprises liées',0,NULL,NULL,1),(947,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44101','945','Entreprises avec lesquelles il existe un lien de participation',0,NULL,NULL,1),(948,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4411','944','Fournisseurs ordinaires',0,NULL,NULL,1),(949,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44110','948','Fournisseurs belges',0,NULL,NULL,1),(950,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44111','948','Fournisseurs CEE',0,NULL,NULL,1),(951,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','44112','948','Fournisseurs importation',0,NULL,NULL,1),(952,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','444','933','Factures à recevoir',0,NULL,NULL,1),(953,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','446','933','Acomptes reçus',0,NULL,NULL,1),(954,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','448','933','Compensations fournisseurs',0,NULL,NULL,1),(955,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45','1354','Dettes fiscales, salariales et sociales',0,NULL,NULL,1),(956,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','450','955','Dettes fiscales estimées',0,NULL,NULL,1),(957,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4501','956','Impôts sur le résultat',0,NULL,NULL,1),(958,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4505','956','Autres impôts en Belgique',0,NULL,NULL,1),(959,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4508','956','Impôts à l\'étranger',0,NULL,NULL,1),(960,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','451','955','T.V.A. à payer',0,NULL,NULL,1),(961,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4510','960','T.V.A. due',0,NULL,NULL,1),(962,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4511','960','T.V.A. déductible',0,NULL,NULL,1),(963,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4512','960','Compte courant administration T.V.A.',0,NULL,NULL,1),(964,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4518','960','Taxe d\'égalisation due',0,NULL,NULL,1),(965,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','452','955','Impôts et taxes à payer',0,NULL,NULL,1),(966,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4520','965','Autres impôts sur le résultat',0,NULL,NULL,1),(967,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4525','965','Autres impôts et taxes en Belgique',0,NULL,NULL,1),(968,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45250','967','Précompte immobilier',0,NULL,NULL,1),(969,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45251','967','Impôts communaux à payer',0,NULL,NULL,1),(970,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45252','967','Impôts provinciaux à payer',0,NULL,NULL,1),(971,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45253','967','Autres impôts et taxes à payer',0,NULL,NULL,1),(972,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4528','965','Impôts et taxes à l\'étranger',0,NULL,NULL,1),(973,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','453','955','Précomptes retenus',0,NULL,NULL,1),(974,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4530','973','Précompte professionnel retenu sur rémunérations',0,NULL,NULL,1),(975,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4531','973','Précompte professionnel retenu sur tantièmes',0,NULL,NULL,1),(976,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4532','973','Précompte mobilier retenu sur dividendes attribués',0,NULL,NULL,1),(977,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4533','973','Précompte mobilier retenu sur intérêts payés',0,NULL,NULL,1),(978,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4538','973','Autres précomptes retenus',0,NULL,NULL,1),(979,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','454','955','Office National de la Sécurité Sociale',0,NULL,NULL,1),(980,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4540','979','Arriérés',0,NULL,NULL,1),(981,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4541','979','1er trimestre',0,NULL,NULL,1),(982,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4542','979','2ème trimestre',0,NULL,NULL,1),(983,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4543','979','3ème trimestre',0,NULL,NULL,1),(984,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4544','979','4ème trimestre',0,NULL,NULL,1),(985,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','455','955','Rémunérations',0,NULL,NULL,1),(986,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4550','985','Administrateurs, gérants et commissaires (non réviseurs)',0,NULL,NULL,1),(987,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4551','985','Direction',0,NULL,NULL,1),(988,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4552','985','Employés',0,NULL,NULL,1),(989,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4553','985','Ouvriers',0,NULL,NULL,1),(990,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','456','955','Pécules de vacances',0,NULL,NULL,1),(991,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4560','990','Direction',0,NULL,NULL,1),(992,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4561','990','Employés',0,NULL,NULL,1),(993,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4562','990','Ouvriers',0,NULL,NULL,1),(994,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','459','955','Autres dettes sociales',0,NULL,NULL,1),(995,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4590','994','Provision pour gratifications de fin d\'année',0,NULL,NULL,1),(996,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4591','994','Départs de personnel',0,NULL,NULL,1),(997,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4592','994','Oppositions sur rémunérations',0,NULL,NULL,1),(998,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4593','994','Assurances relatives au personnel',0,NULL,NULL,1),(999,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45930','998','Assurance loi',0,NULL,NULL,1),(1000,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45931','998','Assurance salaire garanti',0,NULL,NULL,1),(1001,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45932','998','Assurance groupe',0,NULL,NULL,1),(1002,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','45933','998','Assurances individuelles',0,NULL,NULL,1),(1003,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4594','994','Caisse d\'assurances sociales pour travailleurs indépendants',0,NULL,NULL,1),(1004,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4597','994','Dettes et provisions sociales diverses',0,NULL,NULL,1),(1005,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','46','1354','Acomptes reçus sur commande',0,NULL,NULL,1),(1006,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','47','1354','Dettes découlant de l\'affectation des résultats',0,NULL,NULL,1),(1007,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','470','1006','Dividendes et tantièmes d\'exercices antérieurs',0,NULL,NULL,1),(1008,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','471','1006','Dividendes de l\'exercice',0,NULL,NULL,1),(1009,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','472','1006','Tantièmes de l\'exercice',0,NULL,NULL,1),(1010,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','473','1006','Autres allocataires',0,NULL,NULL,1),(1011,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','48','4','Dettes diverses',0,NULL,NULL,1),(1012,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','480','1011','Obligations et coupons échus',0,NULL,NULL,1),(1013,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','481','1011','Actionnaires - capital à rembourser',0,NULL,NULL,1),(1014,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','482','1011','Participation du personnel à payer',0,NULL,NULL,1),(1015,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','483','1011','Acomptes reçus d\'autres tiers à moins d\'un an',0,NULL,NULL,1),(1016,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','486','1011','Emballages et matériel consignés',0,NULL,NULL,1),(1017,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','488','1011','Cautionnements reçus en numéraires',0,NULL,NULL,1),(1018,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','489','1011','Autres dettes diverses',0,NULL,NULL,1),(1019,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','49','1354','Comptes de régularisation et compte d\'attente',0,NULL,NULL,1),(1020,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','490','1019','Charges à reporter (à subdiviser par catégorie de charges)',0,NULL,NULL,1),(1021,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','491','1019','Produits acquis',0,NULL,NULL,1),(1022,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4910','1021','Produits d\'exploitation',0,NULL,NULL,1),(1023,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','49100','1022','Ristournes et rabais à obtenir',0,NULL,NULL,1),(1024,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','49101','1022','Commissions à obtenir',0,NULL,NULL,1),(1025,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','49102','1022','Autres produits d\'exploitation (redevances par exemple)',0,NULL,NULL,1),(1026,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4911','1021','Produits financiers',0,NULL,NULL,1),(1027,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','49110','1026','Intérêts courus et non échus sur prêts et débits',0,NULL,NULL,1),(1028,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','49111','1026','Autres produits financiers',0,NULL,NULL,1),(1029,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','492','1019','Charges à imputer (à subdiviser par catégorie de charges)',0,NULL,NULL,1),(1030,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','493','1019','Produits à reporter',0,NULL,NULL,1),(1031,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4930','1030','Produits d\'exploitation à reporter',0,NULL,NULL,1),(1032,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4931','1030','Produits financiers à reporter',0,NULL,NULL,1),(1033,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','499','1019','Comptes d\'attente',0,NULL,NULL,1),(1034,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4990','1033','Compte d\'attente',0,NULL,NULL,1),(1035,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4991','1033','Compte de répartition périodique des charges',0,NULL,NULL,1),(1036,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','TIERS','XXXXXX','4999','1033','Transferts d\'exercice',0,NULL,NULL,1),(1037,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','50','1355','Actions propres',0,NULL,NULL,1),(1038,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','51','1355','Actions et parts',0,NULL,NULL,1),(1039,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','510','1038','Valeur d\'acquisition',0,NULL,NULL,1),(1040,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','511','1038','Montants non appelés',0,NULL,NULL,1),(1041,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','519','1038','Réductions de valeur actées',0,NULL,NULL,1),(1042,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','52','1355','Titres à revenus fixes',0,NULL,NULL,1),(1043,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','520','1042','Valeur d\'acquisition',0,NULL,NULL,1),(1044,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','529','1042','Réductions de valeur actées',0,NULL,NULL,1),(1045,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','53','1355','Dépots à terme',0,NULL,NULL,1),(1046,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','530','1045','De plus d\'un an',0,NULL,NULL,1),(1047,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','531','1045','De plus d\'un mois et à un an au plus',0,NULL,NULL,1),(1048,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','532','1045','d\'un mois au plus',0,NULL,NULL,1),(1049,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','539','1045','Réductions de valeur actées',0,NULL,NULL,1),(1050,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','54','1355','Valeurs échues à l\'encaissement',0,NULL,NULL,1),(1051,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','540','1050','Chèques à encaisser',0,NULL,NULL,1),(1052,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','541','1050','Coupons à encaisser',0,NULL,NULL,1),(1053,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','55','1355','Etablissements de crédit - Comptes ouverts auprès des divers établissements.',0,NULL,NULL,1),(1054,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','550','1053','Comptes courants',0,NULL,NULL,1),(1055,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','551','1053','Chèques émis',0,NULL,NULL,1),(1056,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','559','1053','Réductions de valeur actées',0,NULL,NULL,1),(1057,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','56','1355','Office des chèques postaux',0,NULL,NULL,1),(1058,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','560','1057','Compte courant',0,NULL,NULL,1),(1059,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','561','1057','Chèques émis',0,NULL,NULL,1),(1060,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','57','1355','Caisses',0,NULL,NULL,1),(1061,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','570','1060','à 577 Caisses - espèces ( 0 - centrale ; 7 - succursales et agences)',0,NULL,NULL,1),(1062,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','578','1060','Caisses - timbres ( 0 - fiscaux ; 1 - postaux)',0,NULL,NULL,1),(1063,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','FINAN','XXXXXX','58','1355','Virements internes',0,NULL,NULL,1),(1064,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','60','1356','Approvisionnements et marchandises',0,NULL,NULL,1),(1065,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','600','1064','Achats de matières premières',0,NULL,NULL,1),(1066,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','601','1064','Achats de fournitures',0,NULL,NULL,1),(1067,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','602','1064','Achats de services, travaux et études',0,NULL,NULL,1),(1068,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','603','1064','Sous-traitances générales',0,NULL,NULL,1),(1069,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','604','1064','Achats de marchandises',0,NULL,NULL,1),(1070,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','605','1064','Achats d\'immeubles destinés à la revente',0,NULL,NULL,1),(1071,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','608','1064','Remises , ristournes et rabais obtenus sur achats',0,NULL,NULL,1),(1072,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','609','1064','Variations de stocks',0,NULL,NULL,1),(1073,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6090','1072','De matières premières',0,NULL,NULL,1),(1074,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6091','1072','De fournitures',0,NULL,NULL,1),(1075,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6094','1072','De marchandises',0,NULL,NULL,1),(1076,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6095','1072','d\'immeubles destinés à la vente',0,NULL,NULL,1),(1077,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61','1356','Services et biens divers',0,NULL,NULL,1),(1078,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','610','1077','Loyers et charges locatives',0,NULL,NULL,1),(1079,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6100','1078','Loyers divers',0,NULL,NULL,1),(1080,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6101','1078','Charges locatives (assurances, frais de confort,etc)',0,NULL,NULL,1),(1081,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','611','1077','Entretien et réparation (fournitures et prestations)',0,NULL,NULL,1),(1082,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','612','1077','Fournitures faites à l\'entreprise',0,NULL,NULL,1),(1083,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6120','1082','Eau, gaz, électricité, vapeur',0,NULL,NULL,1),(1084,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61200','1083','Eau',0,NULL,NULL,1),(1085,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61201','1083','Gaz',0,NULL,NULL,1),(1086,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61202','1083','Electricité',0,NULL,NULL,1),(1087,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61203','1083','Vapeur',0,NULL,NULL,1),(1088,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6121','1082','Téléphone, télégrammes, télex, téléfax, frais postaux',0,NULL,NULL,1),(1089,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61210','1088','Téléphone',0,NULL,NULL,1),(1090,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61211','1088','Télégrammes',0,NULL,NULL,1),(1091,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61212','1088','Télex et téléfax',0,NULL,NULL,1),(1092,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61213','1088','Frais postaux',0,NULL,NULL,1),(1093,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6122','1082','Livres, bibliothèque',0,NULL,NULL,1),(1094,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6123','1082','Imprimés et fournitures de bureau (si non comptabilisé au 601)',0,NULL,NULL,1),(1095,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','613','1077','Rétributions de tiers',0,NULL,NULL,1),(1096,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6130','1095','Redevances et royalties',0,NULL,NULL,1),(1097,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61300','1096','Redevances pour brevets, licences, marques et accessoires',0,NULL,NULL,1),(1098,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61301','1096','Autres redevances (procédés de fabrication)',0,NULL,NULL,1),(1099,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6131','1095','Assurances non relatives au personnel',0,NULL,NULL,1),(1100,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61310','1099','Assurance incendie',0,NULL,NULL,1),(1101,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61311','1099','Assurance vol',0,NULL,NULL,1),(1102,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61312','1099','Assurance autos',0,NULL,NULL,1),(1103,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61313','1099','Assurance crédit',0,NULL,NULL,1),(1104,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61314','1099','Assurances frais généraux',0,NULL,NULL,1),(1105,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6132','1095','Divers',0,NULL,NULL,1),(1106,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61320','1105','Commissions aux tiers',0,NULL,NULL,1),(1107,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61321','1105','Honoraires d\'avocats, d\'experts, etc',0,NULL,NULL,1),(1108,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61322','1105','Cotisations aux groupements professionnels',0,NULL,NULL,1),(1109,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61323','1105','Dons, libéralités, etc',0,NULL,NULL,1),(1110,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61324','1105','Frais de contentieux',0,NULL,NULL,1),(1111,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61325','1105','Publications légales',0,NULL,NULL,1),(1112,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6133','1095','Transports et déplacements',0,NULL,NULL,1),(1113,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61330','1112','Transports de personnel',0,NULL,NULL,1),(1114,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','61331','1112','Voyages, déplacements et représentations',0,NULL,NULL,1),(1115,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6134','1095','Personnel intérimaire',0,NULL,NULL,1),(1116,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','614','1077','Annonces, publicité, propagande et documentation',0,NULL,NULL,1),(1117,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6140','1116','Annonces et insertions',0,NULL,NULL,1),(1118,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6141','1116','Catalogues et imprimés',0,NULL,NULL,1),(1119,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6142','1116','Echantillons',0,NULL,NULL,1),(1120,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6143','1116','Foires et expositions',0,NULL,NULL,1),(1121,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6144','1116','Primes',0,NULL,NULL,1),(1122,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6145','1116','Cadeaux à la clientèle',0,NULL,NULL,1),(1123,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6146','1116','Missions et réceptions',0,NULL,NULL,1),(1124,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6147','1116','Documentation',0,NULL,NULL,1),(1125,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','615','1077','Sous-traitants',0,NULL,NULL,1),(1126,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6150','1125','Sous-traitants pour activités propres',0,NULL,NULL,1),(1127,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6151','1125','Sous-traitants d\'associations momentanées (coparticipants)',0,NULL,NULL,1),(1128,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6152','1125','Quote-part bénéficiaire des coparticipants',0,NULL,NULL,1),(1129,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','617','1077','Personnel intérimaire et personnes mises à la disposition de l\'entreprise',0,NULL,NULL,1),(1130,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','618','1077','Rémunérations, primes pour assurances extralégales, pensions de retraite et de survie des administrateurs, gérants et associés actifs qui ne sont pas attribuées en vertu d\'un contrat de travail',0,NULL,NULL,1),(1131,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62','1356','Rémunérations, charges sociales et pensions',0,NULL,NULL,1),(1132,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','620','1131','Rémunérations et avantages sociaux directs',0,NULL,NULL,1),(1133,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6200','1132','Administrateurs ou gérants',0,NULL,NULL,1),(1134,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6201','1132','Personnel de direction',0,NULL,NULL,1),(1135,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6202','1132','Employés',0,NULL,NULL,1),(1136,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6203','1132','Ouvriers',0,NULL,NULL,1),(1137,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6204','1132','Autres membres du personnel',0,NULL,NULL,1),(1138,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','621','1131','Cotisations patronales d\'assurances sociales',0,NULL,NULL,1),(1139,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6210','1138','Sur salaires',0,NULL,NULL,1),(1140,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6211','1138','Sur appointements et commissions',0,NULL,NULL,1),(1141,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','622','1131','Primes patronales pour assurances extralégales',0,NULL,NULL,1),(1142,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','623','1131','Autres frais de personnel',0,NULL,NULL,1),(1143,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6230','1142','Assurances du personnel',0,NULL,NULL,1),(1144,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62300','1143','Assurances loi, responsabilité civile, chemin du travail',0,NULL,NULL,1),(1145,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62301','1143','Assurance salaire garanti',0,NULL,NULL,1),(1146,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62302','1143','Assurances individuelles',0,NULL,NULL,1),(1147,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6231','1142','Charges sociales diverses',0,NULL,NULL,1),(1148,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62310','1147','Jours fériés payés',0,NULL,NULL,1),(1149,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62311','1147','Salaire hebdomadaire garanti',0,NULL,NULL,1),(1150,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62312','1147','Allocations familiales complémentaires',0,NULL,NULL,1),(1151,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6232','1142','Charges sociales des administrateurs, gérants et commissaires',0,NULL,NULL,1),(1152,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62320','1151','Allocations familiales complémentaires pour non salariés',0,NULL,NULL,1),(1153,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62321','1151','Lois sociales pour indépendants',0,NULL,NULL,1),(1154,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','62322','1151','Divers',0,NULL,NULL,1),(1155,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','624','1131','Pensions de retraite et de survie',0,NULL,NULL,1),(1156,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6240','1155','Administrateurs et gérants',0,NULL,NULL,1),(1157,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6241','1155','Personnel',0,NULL,NULL,1),(1158,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','625','1131','Provision pour pécule de vacances',0,NULL,NULL,1),(1159,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6250','1158','Dotations',0,NULL,NULL,1),(1160,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6251','1158','Utilisations et reprises',0,NULL,NULL,1),(1161,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','63','1356','Amortissements, réductions de valeur et provisions pour risques et charges',0,NULL,NULL,1),(1162,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','630','1161','Dotations aux amortissements et aux réductions de valeur sur immobilisations',0,NULL,NULL,1),(1163,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6300','1162','Dotations aux amortissements sur frais d\'établissement',0,NULL,NULL,1),(1164,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6301','1162','Dotations aux amortissements sur immobilisations incorporelles',0,NULL,NULL,1),(1165,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6302','1162','Dotations aux amortissements sur immobilisations corporelles',0,NULL,NULL,1),(1166,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6308','1162','Dotations aux réductions de valeur sur immobilisations incorporelles',0,NULL,NULL,1),(1167,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6309','1162','Dotations aux réductions de valeur sur immobilisations corporelles',0,NULL,NULL,1),(1168,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','631','1161','Réductions de valeur sur stocks',0,NULL,NULL,1),(1169,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6310','1168','Dotations',0,NULL,NULL,1),(1170,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6311','1168','Reprises',0,NULL,NULL,1),(1171,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','632','1161','Réductions de valeur sur commandes en cours d\'exécution',0,NULL,NULL,1),(1172,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6320','1171','Dotations',0,NULL,NULL,1),(1173,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6321','1171','Reprises',0,NULL,NULL,1),(1174,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','633','1161','Réductions de valeur sur créances commerciales à plus d\'un an',0,NULL,NULL,1),(1175,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6330','1174','Dotations',0,NULL,NULL,1),(1176,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6331','1174','Reprises',0,NULL,NULL,1),(1177,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','634','1161','Réductions de valeur sur créances commerciales à un an au plus',0,NULL,NULL,1),(1178,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6340','1177','Dotations',0,NULL,NULL,1),(1179,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6341','1177','Reprises',0,NULL,NULL,1),(1180,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','635','1161','Provisions pour pensions et obligations similaires',0,NULL,NULL,1),(1181,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6350','1180','Dotations',0,NULL,NULL,1),(1182,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6351','1180','Utilisations et reprises',0,NULL,NULL,1),(1183,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','636','11613','Provisions pour grosses réparations et gros entretiens',0,NULL,NULL,1),(1184,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6360','1183','Dotations',0,NULL,NULL,1),(1185,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6361','1183','Utilisations et reprises',0,NULL,NULL,1),(1186,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','637','1161','Provisions pour autres risques et charges',0,NULL,NULL,1),(1187,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6370','1186','Dotations',0,NULL,NULL,1),(1188,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6371','1186','Utilisations et reprises',0,NULL,NULL,1),(1189,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64','1356','Autres charges d\'exploitation',0,NULL,NULL,1),(1190,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','640','1189','Charges fiscales d\'exploitation',0,NULL,NULL,1),(1191,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6400','1190','Taxes et impôts directs',0,NULL,NULL,1),(1192,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64000','1191','Taxes sur autos et camions',0,NULL,NULL,1),(1193,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6401','1190','Taxes et impôts indirects',0,NULL,NULL,1),(1194,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64010','1193','Timbres fiscaux pris en charge par la firme',0,NULL,NULL,1),(1195,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64011','1193','Droits d\'enregistrement',0,NULL,NULL,1),(1196,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64012','1193','T.V.A. non déductible',0,NULL,NULL,1),(1197,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6402','1190','Impôts provinciaux et communaux',0,NULL,NULL,1),(1198,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64020','1197','Taxe sur la force motrice',0,NULL,NULL,1),(1199,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','64021','1197','Taxe sur le personnel occupé',0,NULL,NULL,1),(1200,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6403','1190','Taxes diverses',0,NULL,NULL,1),(1201,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','641','1189','Moins-values sur réalisations courantes d\'immobilisations corporelles',0,NULL,NULL,1),(1202,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','642','1189','Moins-values sur réalisations de créances commerciales',0,NULL,NULL,1),(1203,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','643','1189','à 648 Charges d\'exploitations diverses',0,NULL,NULL,1),(1204,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','649','1189','Charges d\'exploitation portées à l\'actif au titre de restructuration',0,NULL,NULL,1),(1205,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','65','1356','Charges financières',0,NULL,NULL,1),(1206,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','650','1205','Charges des dettes',0,NULL,NULL,1),(1207,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6500','1206','Intérêts, commissions et frais afférents aux dettes',0,NULL,NULL,1),(1208,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6501','1206','Amortissements des agios et frais d\'émission d\'emprunts',0,NULL,NULL,1),(1209,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6502','1206','Autres charges de dettes',0,NULL,NULL,1),(1210,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6503','1206','Intérêts intercalaires portés à l\'actif',0,NULL,NULL,1),(1211,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','651','1205','Réductions de valeur sur actifs circulants',0,NULL,NULL,1),(1212,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6510','1211','Dotations',0,NULL,NULL,1),(1213,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6511','1211','Reprises',0,NULL,NULL,1),(1214,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','652','1205','Moins-values sur réalisation d\'actifs circulants',0,NULL,NULL,1),(1215,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','653','1205','Charges d\'escompte de créances',0,NULL,NULL,1),(1216,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','654','1205','Différences de change',0,NULL,NULL,1),(1217,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','655','1205','Ecarts de conversion des devises',0,NULL,NULL,1),(1218,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','656','1205','Frais de banques, de chèques postaux',0,NULL,NULL,1),(1219,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','657','1205','Commissions sur ouvertures de crédit, cautions et avals',0,NULL,NULL,1),(1220,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','658','1205','Frais de vente des titres',0,NULL,NULL,1),(1221,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','66','1356','Charges exceptionnelles',0,NULL,NULL,1),(1222,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','660','1221','Amortissements et réductions de valeur exceptionnels',0,NULL,NULL,1),(1223,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6600','1222','Sur frais d\'établissement',0,NULL,NULL,1),(1224,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6601','1222','Sur immobilisations incorporelles',0,NULL,NULL,1),(1225,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6602','1222','Sur immobilisations corporelles',0,NULL,NULL,1),(1226,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','661','1221','Réductions de valeur sur immobilisations financières',0,NULL,NULL,1),(1227,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','662','1221','Provisions pour risques et charges exceptionnels',0,NULL,NULL,1),(1228,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','663','1221','Moins-values sur réalisation d\'actifs immobilisés',0,NULL,NULL,1),(1229,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6630','1228','Sur immobilisations incorporelles',0,NULL,NULL,1),(1230,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6631','1228','Sur immobilisations corporelles',0,NULL,NULL,1),(1231,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6632','1228','Sur immobilisations détenues en location-financement et droits similaires',0,NULL,NULL,1),(1232,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6633','1228','Sur immobilisations financières',0,NULL,NULL,1),(1233,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6634','1228','Sur immeubles acquis ou construits en vue de la revente',0,NULL,NULL,1),(1234,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','664','1221','à 668 Autres charges exceptionnelles',0,NULL,NULL,1),(1235,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','664','1221','Pénalités et amendes diverses',0,NULL,NULL,1),(1236,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','665','1221','Différence de charge',0,NULL,NULL,1),(1237,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','669','1221','Charges exceptionnelles transférées à l\'actif en frais de restructuration',0,NULL,NULL,1),(1238,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','67','1356','Impôts sur le résultat',0,NULL,NULL,1),(1239,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','670','1238','Impôts belges sur le résultat de l\'exercice',0,NULL,NULL,1),(1240,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6700','1239','Impôts et précomptes dus ou versés',0,NULL,NULL,1),(1241,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6701','1239','Excédent de versements d\'impôts et précomptes porté à l\'actif',0,NULL,NULL,1),(1242,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6702','1239','Charges fiscales estimées',0,NULL,NULL,1),(1243,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','671','1238','Impôts belges sur le résultat d\'exercices antérieurs',0,NULL,NULL,1),(1244,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6710','1243','Suppléments d\'impôts dus ou versés',0,NULL,NULL,1),(1245,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6711','1243','Suppléments d\'impôts estimés',0,NULL,NULL,1),(1246,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','6712','1243','Provisions fiscales constituées',0,NULL,NULL,1),(1247,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','672','1238','Impôts étrangers sur le résultat de l\'exercice',0,NULL,NULL,1),(1248,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','673','1238','Impôts étrangers sur le résultat d\'exercices antérieurs',0,NULL,NULL,1),(1249,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','68','1356','Transferts aux réserves immunisées',0,NULL,NULL,1),(1250,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','69','1356','Affectation des résultats',0,NULL,NULL,1),(1251,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','690','1250','Perte reportée de l\'exercice précédent',0,NULL,NULL,1),(1252,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','691','1250','Dotation à la réserve légale',0,NULL,NULL,1),(1253,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','692','1250','Dotation aux autres réserves',0,NULL,NULL,1),(1254,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','693','1250','Bénéfice à reporter',0,NULL,NULL,1),(1255,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','694','1250','Rémunération du capital',0,NULL,NULL,1),(1256,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','695','1250','Administrateurs ou gérants',0,NULL,NULL,1),(1257,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','CHARGE','XXXXXX','696','1250','Autres allocataires',0,NULL,NULL,1),(1258,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','70','1357','Chiffre d\'affaires',0,NULL,NULL,1),(1260,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','700','1258','Ventes de marchandises',0,NULL,NULL,1),(1261,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7000','1260','Ventes en Belgique',0,NULL,NULL,1),(1262,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7001','1260','Ventes dans les pays membres de la C.E.E.',0,NULL,NULL,1),(1263,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7002','1260','Ventes à l\'exportation',0,NULL,NULL,1),(1264,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','701','1258','Ventes de produits finis',0,NULL,NULL,1),(1265,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7010','1264','Ventes en Belgique',0,NULL,NULL,1),(1266,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7011','1264','Ventes dans les pays membres de la C.E.E.',0,NULL,NULL,1),(1267,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7012','1264','Ventes à l\'exportation',0,NULL,NULL,1),(1268,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','702','1258','Ventes de déchets et rebuts',0,NULL,NULL,1),(1269,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7020','1268','Ventes en Belgique',0,NULL,NULL,1),(1270,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7021','1268','Ventes dans les pays membres de la C.E.E.',0,NULL,NULL,1),(1271,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7022','1268','Ventes à l\'exportation',0,NULL,NULL,1),(1272,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','703','1258','Ventes d\'emballages récupérables',0,NULL,NULL,1),(1273,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','704','1258','Facturations des travaux en cours (associations momentanées)',0,NULL,NULL,1),(1274,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','705','1258','Prestations de services',0,NULL,NULL,1),(1275,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7050','1274','Prestations de services en Belgique',0,NULL,NULL,1),(1276,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7051','1274','Prestations de services dans les pays membres de la C.E.E.',0,NULL,NULL,1),(1277,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7052','1274','Prestations de services en vue de l\'exportation',0,NULL,NULL,1),(1278,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','706','1258','Pénalités et dédits obtenus par l\'entreprise',0,NULL,NULL,1),(1279,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','708','1258','Remises, ristournes et rabais accordés',0,NULL,NULL,1),(1280,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7080','1279','Sur ventes de marchandises',0,NULL,NULL,1),(1281,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7081','1279','Sur ventes de produits finis',0,NULL,NULL,1),(1282,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7082','1279','Sur ventes de déchets et rebuts',0,NULL,NULL,1),(1283,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7083','1279','Sur prestations de services',0,NULL,NULL,1),(1284,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7084','1279','Mali sur travaux facturés aux associations momentanées',0,NULL,NULL,1),(1285,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','71','1357','Variation des stocks et des commandes en cours d\'exécution',0,NULL,NULL,1),(1286,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','712','1285','Des en cours de fabrication',0,NULL,NULL,1),(1287,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','713','1285','Des produits finis',0,NULL,NULL,1),(1288,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','715','1285','Des immeubles construits destinés à la vente',0,NULL,NULL,1),(1289,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','717','1285','Des commandes en cours d\'exécution',0,NULL,NULL,1),(1290,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7170','1289','Commandes en cours - Coût de revient',0,NULL,NULL,1),(1291,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','71700','1290','Coût des commandes en cours d\'exécution',0,NULL,NULL,1),(1292,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','71701','1290','Coût des travaux en cours des associations momentanées',0,NULL,NULL,1),(1293,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7171','1289','Bénéfices portés en compte sur commandes en cours',0,NULL,NULL,1),(1294,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','71710','1293','Sur commandes en cours d\'exécution',0,NULL,NULL,1),(1295,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','71711','1293','Sur travaux en cours des associations momentanées',0,NULL,NULL,1),(1296,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','72','1357','Production immobilisée',0,NULL,NULL,1),(1297,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','720','1296','En frais d\'établissement',0,NULL,NULL,1),(1298,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','721','1296','En immobilisations incorporelles',0,NULL,NULL,1),(1299,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','722','1296','En immobilisations corporelles',0,NULL,NULL,1),(1300,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','723','1296','En immobilisations en cours',0,NULL,NULL,1),(1301,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','74','1357','Autres produits d\'exploitation',0,NULL,NULL,1),(1302,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','740','1301','Subsides d\'exploitation et montants compensatoires',0,NULL,NULL,1),(1303,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','741','1301','Plus-values sur réalisations courantes d\'immobilisations corporelles',0,NULL,NULL,1),(1304,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','742','1301','Plus-values sur réalisations de créances commerciales',0,NULL,NULL,1),(1305,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','743','1301','à 749 Produits d\'exploitation divers',0,NULL,NULL,1),(1306,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','743','1301','Produits de services exploités dans l\'intérêt du personnel',0,NULL,NULL,1),(1307,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','744','1301','Commissions et courtages',0,NULL,NULL,1),(1308,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','745','1301','Redevances pour brevets et licences',0,NULL,NULL,1),(1309,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','746','1301','Prestations de services (transports, études, etc)',0,NULL,NULL,1),(1310,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','747','1301','Revenus des immeubles affectés aux activités non professionnelles',0,NULL,NULL,1),(1311,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','748','1301','Locations diverses à caractère professionnel',0,NULL,NULL,1),(1312,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','749','1301','Produits divers',0,NULL,NULL,1),(1313,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7490','1312','Bonis sur reprises d\'emballages consignés',0,NULL,NULL,1),(1314,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7491','1312','Bonis sur travaux en associations momentanées',0,NULL,NULL,1),(1315,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','75','1357','Produits financiers',0,NULL,NULL,1),(1316,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','750','1315','Produits des immobilisations financières',0,NULL,NULL,1),(1317,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7500','1316','Revenus des actions',0,NULL,NULL,1),(1318,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7501','1316','Revenus des obligations',0,NULL,NULL,1),(1319,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7502','1316','Revenus des créances à plus d\'un an',0,NULL,NULL,1),(1320,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','751','1315','Produits des actifs circulants',0,NULL,NULL,1),(1321,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','752','1315','Plus-values sur réalisations d\'actifs circulants',0,NULL,NULL,1),(1322,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','753','1315','Subsides en capital et en intérêts',0,NULL,NULL,1),(1323,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','754','1315','Différences de change',0,NULL,NULL,1),(1324,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','755','1315','Ecarts de conversion des devises',0,NULL,NULL,1),(1325,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','756','1315','à 759 Produits financiers divers',0,NULL,NULL,1),(1326,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','756','1315','Produits des autres créances',0,NULL,NULL,1),(1327,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','757','1315','Escomptes obtenus',0,NULL,NULL,1),(1328,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','76','1357','Produits exceptionnels',0,NULL,NULL,1),(1329,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','760','1328','Reprises d\'amortissements et de réductions de valeur',0,NULL,NULL,1),(1330,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7600','1329','Sur immobilisations incorporelles',0,NULL,NULL,1),(1331,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7601','1329','Sur immobilisations corporelles',0,NULL,NULL,1),(1332,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','761','1328','Reprises de réductions de valeur sur immobilisations financières',0,NULL,NULL,1),(1333,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','762','1328','Reprises de provisions pour risques et charges exceptionnelles',0,NULL,NULL,1),(1334,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','763','1328','Plus-values sur réalisation d\'actifs immobilisés',0,NULL,NULL,1),(1335,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7630','1334','Sur immobilisations incorporelles',0,NULL,NULL,1),(1336,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7631','1334','Sur immobilisations corporelles',0,NULL,NULL,1),(1337,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7632','1334','Sur immobilisations financières',0,NULL,NULL,1),(1338,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','764','1328','Autres produits exceptionnels',0,NULL,NULL,1),(1339,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','77','1357','Régularisations d\'impôts et reprises de provisions fiscales',0,NULL,NULL,1),(1340,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','771','1339','Impôts belges sur le résultat',0,NULL,NULL,1),(1341,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7710','1340','Régularisations d\'impôts dus ou versés',0,NULL,NULL,1),(1342,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7711','1340','Régularisations d\'impôts estimés',0,NULL,NULL,1),(1343,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','7712','1340','Reprises de provisions fiscales',0,NULL,NULL,1),(1344,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','773','1339','Impôts étrangers sur le résultat',0,NULL,NULL,1),(1345,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','79','1357','Affectation aux résultats',0,NULL,NULL,1),(1346,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','790','1345','Bénéfice reporté de l\'exercice précédent',0,NULL,NULL,1),(1347,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','791','1345','Prélèvement sur le capital et les primes d\'émission',0,NULL,NULL,1),(1348,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','792','1345','Prélèvement sur les réserves',0,NULL,NULL,1),(1349,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','793','1345','Perte à reporter',0,NULL,NULL,1),(1350,1,NULL,'2016-01-22 17:28:16','PCMN-BASE','PROD','XXXXXX','794','1345','Intervention d\'associés (ou du propriétaire) dans la perte',0,NULL,NULL,1),(1351,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','CAPIT','XXXXXX','1','0','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',0,NULL,NULL,1),(1352,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','IMMO','XXXXXX','2','0','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',0,NULL,NULL,1),(1353,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','STOCK','XXXXXX','3','0','Stock et commandes en cours d\'exécution',0,NULL,NULL,1),(1354,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','TIERS','XXXXXX','4','0','Créances et dettes à un an au plus',0,NULL,NULL,1),(1355,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','FINAN','XXXXXX','5','0','Placement de trésorerie et de valeurs disponibles',0,NULL,NULL,1),(1356,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','CHARGE','XXXXXX','6','0','Charges',0,NULL,NULL,1),(1357,1,NULL,'2016-07-30 11:12:54','PCMN-BASE','PROD','XXXXXX','7','0','Produits',0,NULL,NULL,1),(1401,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','CAPIT','XXXXXX','1','0','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',0,NULL,NULL,1),(1402,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','IMMO','XXXXXX','2','0','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',0,NULL,NULL,1),(1403,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','STOCK','XXXXXX','3','0','Stock et commandes en cours d\'exécution',0,NULL,NULL,1),(1404,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','TIERS','XXXXXX','4','0','Créances et dettes à un an au plus',0,NULL,NULL,1),(1405,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','FINAN','XXXXXX','5','0','Placement de trésorerie et de valeurs disponibles',0,NULL,NULL,1),(1406,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','CHARGE','XXXXXX','6','0','Charges',0,NULL,NULL,1),(1407,1,NULL,'2016-07-30 11:12:54','PCG99-ABREGE','PROD','XXXXXX','7','0','Produits',0,NULL,NULL,1),(1501,1,NULL,'2017-02-20 10:46:43','PCG99-BASE','CAPIT','XXXXXX','1','0','Fonds propres, provisions pour risques et charges et dettes à plus d\'un an',0,NULL,NULL,1),(1502,1,NULL,'2016-07-30 11:12:54','PCG99-BASE','IMMO','XXXXXX','2','0','Frais d\'établissement. Actifs immobilisés et créances à plus d\'un an',0,NULL,NULL,1),(1503,1,NULL,'2016-07-30 11:12:54','PCG99-BASE','STOCK','XXXXXX','3','0','Stock et commandes en cours d\'exécution',0,NULL,NULL,1),(1504,1,NULL,'2016-07-30 11:12:54','PCG99-BASE','TIERS','XXXXXX','4','0','Créances et dettes à un an au plus',0,NULL,NULL,1),(1505,1,NULL,'2016-07-30 11:12:54','PCG99-BASE','FINAN','XXXXXX','5','0','Placement de trésorerie et de valeurs disponibles',0,NULL,NULL,1),(1506,1,NULL,'2016-07-30 11:12:54','PCG99-BASE','CHARGE','XXXXXX','6','0','Charges',0,NULL,NULL,1),(1507,1,NULL,'2016-07-30 11:12:54','PCG99-BASE','PROD','XXXXXX','7','0','Produits',0,NULL,NULL,1),(4001,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','FINANCIACION','XXXXXX','1','0','Financiación básica',0,NULL,NULL,1),(4002,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','ACTIVO','XXXXXX','2','0','Activo no corriente',0,NULL,NULL,1),(4003,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','EXISTENCIAS','XXXXXX','3','0','Existencias',0,NULL,NULL,1),(4004,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4','0','Acreedores y deudores por operaciones comerciales',0,NULL,NULL,1),(4005,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5','0','Cuentas financieras',0,NULL,NULL,1),(4006,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6','0','Compras y gastos',0,NULL,NULL,1),(4007,1,NULL,'2016-07-30 11:12:54','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7','0','Ventas e ingresos',0,NULL,NULL,1),(4008,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','10','4001','CAPITAL',0,NULL,NULL,1),(4009,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','100','4008','Capital social',0,NULL,NULL,1),(4010,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','101','4008','Fondo social',0,NULL,NULL,1),(4011,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','CAPITAL','102','4008','Capital',0,NULL,NULL,1),(4012,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','103','4008','Socios por desembolsos no exigidos',0,NULL,NULL,1),(4013,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1030','4012','Socios por desembolsos no exigidos capital social',0,NULL,NULL,1),(4014,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1034','4012','Socios por desembolsos no exigidos capital pendiente de inscripción',0,NULL,NULL,1),(4015,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','104','4008','Socios por aportaciones no dineradas pendientes',0,NULL,NULL,1),(4016,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1040','4015','Socios por aportaciones no dineradas pendientes capital social',0,NULL,NULL,1),(4017,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1044','4015','Socios por aportaciones no dineradas pendientes capital pendiente de inscripción',0,NULL,NULL,1),(4018,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','108','4008','Acciones o participaciones propias en situaciones especiales',0,NULL,NULL,1),(4019,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','109','4008','Acciones o participaciones propias para reducción de capital',0,NULL,NULL,1),(4020,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','11','4001','Reservas y otros instrumentos de patrimonio',0,NULL,NULL,1),(4021,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','110','4020','Prima de emisión o asunción',0,NULL,NULL,1),(4022,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','111','4020','Otros instrumentos de patrimonio neto',0,NULL,NULL,1),(4023,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1110','4022','Patrimonio neto por emisión de instrumentos financieros compuestos',0,NULL,NULL,1),(4024,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1111','4022','Resto de instrumentos de patrimoio neto',0,NULL,NULL,1),(4025,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','112','4020','Reserva legal',0,NULL,NULL,1),(4026,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','113','4020','Reservas voluntarias',0,NULL,NULL,1),(4027,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','114','4020','Reservas especiales',0,NULL,NULL,1),(4028,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1140','4027','Reservas para acciones o participaciones de la sociedad dominante',0,NULL,NULL,1),(4029,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1141','4027','Reservas estatutarias',0,NULL,NULL,1),(4030,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1142','4027','Reservas por capital amortizado',0,NULL,NULL,1),(4031,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1143','4027','Reservas por fondo de comercio',0,NULL,NULL,1),(4032,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1144','4028','Reservas por acciones propias aceptadas en garantía',0,NULL,NULL,1),(4033,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','115','4020','Reservas por pérdidas y ganancias actuariales y otros ajustes',0,NULL,NULL,1),(4034,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','118','4020','Aportaciones de socios o propietarios',0,NULL,NULL,1),(4035,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','119','4020','Diferencias por ajuste del capital a euros',0,NULL,NULL,1),(4036,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','12','4001','Resultados pendientes de aplicación',0,NULL,NULL,1),(4037,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','120','4036','Remanente',0,NULL,NULL,1),(4038,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','121','4036','Resultados negativos de ejercicios anteriores',0,NULL,NULL,1),(4039,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','129','4036','Resultado del ejercicio',0,NULL,NULL,1),(4040,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','13','4001','Subvenciones, donaciones y ajustes por cambio de valor',0,NULL,NULL,1),(4041,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','130','4040','Subvenciones oficiales de capital',0,NULL,NULL,1),(4042,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','131','4040','Donaciones y legados de capital',0,NULL,NULL,1),(4043,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','132','4040','Otras subvenciones, donaciones y legados',0,NULL,NULL,1),(4044,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','133','4040','Ajustes por valoración en activos financieros disponibles para la venta',0,NULL,NULL,1),(4045,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','134','4040','Operaciones de cobertura',0,NULL,NULL,1),(4046,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1340','4045','Cobertura de flujos de efectivo',0,NULL,NULL,1),(4047,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1341','4045','Cobertura de una inversión neta en un negocio extranjero',0,NULL,NULL,1),(4048,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','135','4040','Diferencias de conversión',0,NULL,NULL,1),(4049,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','136','4040','Ajustes por valoración en activos no corrientes y grupos enajenables de elementos mantenidos para la venta',0,NULL,NULL,1),(4050,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','137','4040','Ingresos fiscales a distribuir en varios ejercicios',0,NULL,NULL,1),(4051,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1370','4050','Ingresos fiscales por diferencias permanentes a distribuir en varios ejercicios',0,NULL,NULL,1),(4052,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1371','4050','Ingresos fiscales por deducciones y bonificaciones a distribuir en varios ejercicios',0,NULL,NULL,1),(4053,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','14','4001','Provisiones',0,NULL,NULL,1),(4054,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','141','4053','Provisión para impuestos',0,NULL,NULL,1),(4055,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','142','4053','Provisión para otras responsabilidades',0,NULL,NULL,1),(4056,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','143','4053','Provisión por desmantelamiento, retiro o rehabilitación del inmovilizado',0,NULL,NULL,1),(4057,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','145','4053','Provisión para actuaciones medioambientales',0,NULL,NULL,1),(4058,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','15','4001','Deudas a largo plazo con características especiales',0,NULL,NULL,1),(4059,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','150','4058','Acciones o participaciones a largo plazo consideradas como pasivos financieros',0,NULL,NULL,1),(4060,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','153','4058','Desembolsos no exigidos por acciones o participaciones consideradas como pasivos financieros',0,NULL,NULL,1),(4061,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1533','4060','Desembolsos no exigidos empresas del grupo',0,NULL,NULL,1),(4062,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1534','4060','Desembolsos no exigidos empresas asociadas',0,NULL,NULL,1),(4063,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1535','4060','Desembolsos no exigidos otras partes vinculadas',0,NULL,NULL,1),(4064,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1536','4060','Otros desembolsos no exigidos',0,NULL,NULL,1),(4065,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','154','4058','Aportaciones no dinerarias pendientes por acciones o participaciones consideradas como pasivos financieros',0,NULL,NULL,1),(4066,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1543','4065','Aportaciones no dinerarias pendientes empresas del grupo',0,NULL,NULL,1),(4067,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1544','4065','Aportaciones no dinerarias pendientes empresas asociadas',0,NULL,NULL,1),(4068,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1545','4065','Aportaciones no dinerarias pendientes otras partes vinculadas',0,NULL,NULL,1),(4069,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1546','4065','Otras aportaciones no dinerarias pendientes',0,NULL,NULL,1),(4070,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','16','4001','Deudas a largo plazo con partes vinculadas',0,NULL,NULL,1),(4071,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','160','4070','Deudas a largo plazo con entidades de crédito vinculadas',0,NULL,NULL,1),(4072,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1603','4071','Deudas a largo plazo con entidades de crédito empresas del grupo',0,NULL,NULL,1),(4073,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1604','4071','Deudas a largo plazo con entidades de crédito empresas asociadas',0,NULL,NULL,1),(4074,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1605','4071','Deudas a largo plazo con otras entidades de crédito vinculadas',0,NULL,NULL,1),(4075,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','161','4070','Proveedores de inmovilizado a largo plazo partes vinculadas',0,NULL,NULL,1),(4076,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1613','4075','Proveedores de inmovilizado a largo plazo empresas del grupo',0,NULL,NULL,1),(4077,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1614','4075','Proveedores de inmovilizado a largo plazo empresas asociadas',0,NULL,NULL,1),(4078,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1615','4075','Proveedores de inmovilizado a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4079,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','162','4070','Acreedores por arrendamiento financiero a largo plazo partes vinculadas',0,NULL,NULL,1),(4080,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1623','4079','Acreedores por arrendamiento financiero a largo plazo empresas del grupo',0,NULL,NULL,1),(4081,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1624','4080','Acreedores por arrendamiento financiero a largo plazo empresas asociadas',0,NULL,NULL,1),(4082,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1625','4080','Acreedores por arrendamiento financiero a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4083,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','163','4070','Otras deudas a largo plazo con partes vinculadas',0,NULL,NULL,1),(4084,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1633','4083','Otras deudas a largo plazo empresas del grupo',0,NULL,NULL,1),(4085,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1634','4083','Otras deudas a largo plazo empresas asociadas',0,NULL,NULL,1),(4086,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','1635','4083','Otras deudas a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4087,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','17','4001','Deudas a largo plazo por préstamos recibidos empresitos y otros conceptos',0,NULL,NULL,1),(4088,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','170','4087','Deudas a largo plazo con entidades de crédito',0,NULL,NULL,1),(4089,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','171','4087','Deudas a largo plazo',0,NULL,NULL,1),(4090,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','172','4087','Deudas a largo plazo transformables en suvbenciones donaciones y legados',0,NULL,NULL,1),(4091,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','173','4087','Proveedores de inmovilizado a largo plazo',0,NULL,NULL,1),(4092,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','174','4087','Acreedores por arrendamiento financiero a largo plazo',0,NULL,NULL,1),(4093,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','175','4087','Efectos a pagar a largo plazo',0,NULL,NULL,1),(4094,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','176','4087','Pasivos por derivados financieros a largo plazo',0,NULL,NULL,1),(4095,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','177','4087','Obligaciones y bonos',0,NULL,NULL,1),(4096,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','179','4087','Deudas representadas en otros valores negociables',0,NULL,NULL,1),(4097,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','18','4001','Pasivos por fianzas garantias y otros conceptos a largo plazo',0,NULL,NULL,1),(4098,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','180','4097','Fianzas recibidas a largo plazo',0,NULL,NULL,1),(4099,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','181','4097','Anticipos recibidos por ventas o prestaciones de servicios a largo plazo',0,NULL,NULL,1),(4100,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','185','4097','Depositos recibidos a largo plazo',0,NULL,NULL,1),(4101,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','19','4001','Situaciones transitorias de financiación',0,NULL,NULL,1),(4102,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','190','4101','Acciones o participaciones emitidas',0,NULL,NULL,1),(4103,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','192','4101','Suscriptores de acciones',0,NULL,NULL,1),(4104,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','194','4101','Capital emitido pendiente de inscripción',0,NULL,NULL,1),(4105,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','195','4101','Acciones o participaciones emitidas consideradas como pasivos financieros',0,NULL,NULL,1),(4106,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','197','4101','Suscriptores de acciones consideradas como pasivos financieros',0,NULL,NULL,1),(4107,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','FINANCIACION','XXXXXX','199','4101','Acciones o participaciones emitidas consideradas como pasivos financieros pendientes de inscripción',0,NULL,NULL,1),(4108,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','20','4002','Inmovilizaciones intangibles',0,NULL,NULL,1),(4109,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','200','4108','Investigación',0,NULL,NULL,1),(4110,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','201','4108','Desarrollo',0,NULL,NULL,1),(4111,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','202','4108','Concesiones administrativas',0,NULL,NULL,1),(4112,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','203','4108','Propiedad industrial',0,NULL,NULL,1),(4113,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','205','4108','Derechos de transpaso',0,NULL,NULL,1),(4114,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','206','4108','Aplicaciones informáticas',0,NULL,NULL,1),(4115,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','209','4108','Anticipos para inmovilizaciones intangibles',0,NULL,NULL,1),(4116,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','21','4002','Inmovilizaciones materiales',0,NULL,NULL,1),(4117,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','210','4116','Terrenos y bienes naturales',0,NULL,NULL,1),(4118,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','211','4116','Construcciones',0,NULL,NULL,1),(4119,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','212','4116','Instalaciones técnicas',0,NULL,NULL,1),(4120,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','213','4116','Maquinaria',0,NULL,NULL,1),(4121,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','214','4116','Utillaje',0,NULL,NULL,1),(4122,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','215','4116','Otras instalaciones',0,NULL,NULL,1),(4123,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','216','4116','Mobiliario',0,NULL,NULL,1),(4124,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','217','4116','Equipos para procesos de información',0,NULL,NULL,1),(4125,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','218','4116','Elementos de transporte',0,NULL,NULL,1),(4126,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','219','4116','Otro inmovilizado material',0,NULL,NULL,1),(4127,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','22','4002','Inversiones inmobiliarias',0,NULL,NULL,1),(4128,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','220','4127','Inversiones en terreons y bienes naturales',0,NULL,NULL,1),(4129,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','221','4127','Inversiones en construcciones',0,NULL,NULL,1),(4130,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','23','4002','Inmovilizaciones materiales en curso',0,NULL,NULL,1),(4131,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','230','4130','Adaptación de terrenos y bienes naturales',0,NULL,NULL,1),(4132,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','231','4130','Construcciones en curso',0,NULL,NULL,1),(4133,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','232','4130','Instalaciones técnicas en montaje',0,NULL,NULL,1),(4134,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','233','4130','Maquinaria en montaje',0,NULL,NULL,1),(4135,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','237','4130','Equipos para procesos de información en montaje',0,NULL,NULL,1),(4136,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','239','4130','Anticipos para inmovilizaciones materiales',0,NULL,NULL,1),(4137,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','24','4002','Inversiones financieras a largo plazo en partes vinculadas',0,NULL,NULL,1),(4138,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','240','4137','Participaciones a largo plazo en partes vinculadas',0,NULL,NULL,1),(4139,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2403','4138','Participaciones a largo plazo en empresas del grupo',0,NULL,NULL,1),(4140,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2404','4138','Participaciones a largo plazo en empresas asociadas',0,NULL,NULL,1),(4141,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2405','4138','Participaciones a largo plazo en otras partes vinculadas',0,NULL,NULL,1),(4142,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','241','4137','Valores representativos de deuda a largo plazo de partes vinculadas',0,NULL,NULL,1),(4143,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2413','4142','Valores representativos de deuda a largo plazo de empresas del grupo',0,NULL,NULL,1),(4144,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2414','4142','Valores representativos de deuda a largo plazo de empresas asociadas',0,NULL,NULL,1),(4145,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2415','4142','Valores representativos de deuda a largo plazo de otras partes vinculadas',0,NULL,NULL,1),(4146,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','242','4137','Créditos a largo plazo a partes vinculadas',0,NULL,NULL,1),(4147,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2423','4146','Créditos a largo plazo a empresas del grupo',0,NULL,NULL,1),(4148,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2424','4146','Créditos a largo plazo a empresas asociadas',0,NULL,NULL,1),(4149,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2425','4146','Créditos a largo plazo a otras partes vinculadas',0,NULL,NULL,1),(4150,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','249','4137','Desembolsos pendientes sobre participaciones a largo plazo en partes vinculadas',0,NULL,NULL,1),(4151,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2493','4150','Desembolsos pendientes sobre participaciones a largo plazo en empresas del grupo',0,NULL,NULL,1),(4152,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2494','4150','Desembolsos pendientes sobre participaciones a largo plazo en empresas asociadas',0,NULL,NULL,1),(4153,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2495','4150','Desembolsos pendientes sobre participaciones a largo plazo en otras partes vinculadas',0,NULL,NULL,1),(4154,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','25','4002','Otras inversiones financieras a largo plazo',0,NULL,NULL,1),(4155,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','250','4154','Inversiones financieras a largo plazo en instrumentos de patrimonio',0,NULL,NULL,1),(4156,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','251','4154','Valores representativos de deuda a largo plazo',0,NULL,NULL,1),(4157,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','252','4154','Créditos a largo plazo',0,NULL,NULL,1),(4158,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','253','4154','Créditos a largo plazo por enajenación de inmovilizado',0,NULL,NULL,1),(4159,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','254','4154','Créditos a largo plazo al personal',0,NULL,NULL,1),(4160,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','255','4154','Activos por derivados financieros a largo plazo',0,NULL,NULL,1),(4161,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','258','4154','Imposiciones a largo plazo',0,NULL,NULL,1),(4162,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','259','4154','Desembolsos pendientes sobre participaciones en el patrimonio neto a largo plazo',0,NULL,NULL,1),(4163,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','26','4002','Fianzas y depósitos constituidos a largo plazo',0,NULL,NULL,1),(4164,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','260','4163','Fianzas constituidas a largo plazo',0,NULL,NULL,1),(4165,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','261','4163','Depósitos constituidos a largo plazo',0,NULL,NULL,1),(4166,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','28','4002','Amortización acumulada del inmovilizado',0,NULL,NULL,1),(4167,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','280','4166','Amortización acumulado del inmovilizado intangible',0,NULL,NULL,1),(4168,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2800','4167','Amortización acumulada de investigación',0,NULL,NULL,1),(4169,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2801','4167','Amortización acumulada de desarrollo',0,NULL,NULL,1),(4170,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2802','4167','Amortización acumulada de concesiones administrativas',0,NULL,NULL,1),(4171,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2803','4167','Amortización acumulada de propiedad industrial',0,NULL,NULL,1),(4172,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2805','4167','Amortización acumulada de derechos de transpaso',0,NULL,NULL,1),(4173,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2806','4167','Amortización acumulada de aplicaciones informáticas',0,NULL,NULL,1),(4174,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','281','4166','Amortización acumulado del inmovilizado material',0,NULL,NULL,1),(4175,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2811','4174','Amortización acumulada de construcciones',0,NULL,NULL,1),(4176,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2812','4174','Amortización acumulada de instalaciones técnicas',0,NULL,NULL,1),(4177,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2813','4174','Amortización acumulada de maquinaria',0,NULL,NULL,1),(4178,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2814','4174','Amortización acumulada de utillaje',0,NULL,NULL,1),(4179,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2815','4174','Amortización acumulada de otras instalaciones',0,NULL,NULL,1),(4180,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2816','4174','Amortización acumulada de mobiliario',0,NULL,NULL,1),(4181,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2817','4174','Amortización acumulada de equipos para proceso de información',0,NULL,NULL,1),(4182,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2818','4174','Amortización acumulada de elementos de transporte',0,NULL,NULL,1),(4183,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2819','4175','Amortización acumulada de otro inmovilizado material',0,NULL,NULL,1),(4184,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','282','4166','Amortización acumulada de las inversiones inmobiliarias',0,NULL,NULL,1),(4185,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','29','4002','Deterioro de valor de activos no corrientes',0,NULL,NULL,1),(4186,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','290','4185','Deterioro de valor del inmovilizado intangible',0,NULL,NULL,1),(4187,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2900','4186','Deterioro de valor de investigación',0,NULL,NULL,1),(4188,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2901','4186','Deterioro de valor de desarrollo',0,NULL,NULL,1),(4189,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2902','4186','Deterioro de valor de concesiones administrativas',0,NULL,NULL,1),(4190,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2903','4186','Deterioro de valor de propiedad industrial',0,NULL,NULL,1),(4191,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2905','4186','Deterioro de valor de derechos de transpaso',0,NULL,NULL,1),(4192,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2906','4186','Deterioro de valor de aplicaciones informáticas',0,NULL,NULL,1),(4193,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','291','4185','Deterioro de valor del inmovilizado material',0,NULL,NULL,1),(4194,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2910','4193','Deterioro de valor de terrenos y bienes naturales',0,NULL,NULL,1),(4195,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2911','4193','Deterioro de valor de construcciones',0,NULL,NULL,1),(4196,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2912','4193','Deterioro de valor de instalaciones técnicas',0,NULL,NULL,1),(4197,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2913','4193','Deterioro de valor de maquinaria',0,NULL,NULL,1),(4198,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2914','4193','Deterioro de valor de utillajes',0,NULL,NULL,1),(4199,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2915','4194','Deterioro de valor de otras instalaciones',0,NULL,NULL,1),(4200,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2916','4194','Deterioro de valor de mobiliario',0,NULL,NULL,1),(4201,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2917','4194','Deterioro de valor de equipos para proceso de información',0,NULL,NULL,1),(4202,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2918','4194','Deterioro de valor de elementos de transporte',0,NULL,NULL,1),(4203,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2919','4194','Deterioro de valor de otro inmovilizado material',0,NULL,NULL,1),(4204,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','292','4185','Deterioro de valor de las inversiones inmobiliarias',0,NULL,NULL,1),(4205,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2920','4204','Deterioro de valor de terrenos y bienes naturales',0,NULL,NULL,1),(4206,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2921','4204','Deterioro de valor de construcciones',0,NULL,NULL,1),(4207,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','293','4185','Deterioro de valor de participaciones a largo plazo en partes vinculadas',0,NULL,NULL,1),(4208,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2933','4207','Deterioro de valor de participaciones a largo plazo en empresas del grupo',0,NULL,NULL,1),(4209,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2934','4207','Deterioro de valor de sobre participaciones a largo plazo en empresas asociadas',0,NULL,NULL,1),(4210,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2935','4207','Deterioro de valor de sobre participaciones a largo plazo en otras partes vinculadas',0,NULL,NULL,1),(4211,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','294','4185','Deterioro de valor de valores representativos de deuda a largo plazo en partes vinculadas',0,NULL,NULL,1),(4212,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2943','4211','Deterioro de valor de valores representativos de deuda a largo plazo en empresas del grupo',0,NULL,NULL,1),(4213,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2944','4211','Deterioro de valor de valores representativos de deuda a largo plazo en empresas asociadas',0,NULL,NULL,1),(4214,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2945','4211','Deterioro de valor de valores representativos de deuda a largo plazo en otras partes vinculadas',0,NULL,NULL,1),(4215,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','295','4185','Deterioro de valor de créditos a largo plazo a partes vinculadas',0,NULL,NULL,1),(4216,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2953','4215','Deterioro de valor de créditos a largo plazo a empresas del grupo',0,NULL,NULL,1),(4217,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2954','4215','Deterioro de valor de créditos a largo plazo a empresas asociadas',0,NULL,NULL,1),(4218,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','2955','4215','Deterioro de valor de créditos a largo plazo a otras partes vinculadas',0,NULL,NULL,1),(4219,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','296','4185','Deterioro de valor de participaciones en el patrimonio netoa largo plazo',0,NULL,NULL,1),(4220,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','297','4185','Deterioro de valor de valores representativos de deuda a largo plazo',0,NULL,NULL,1),(4221,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACTIVO','XXXXXX','298','4185','Deterioro de valor de créditos a largo plazo',0,NULL,NULL,1),(4222,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','30','4003','Comerciales',0,NULL,NULL,1),(4223,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','300','4222','Mercaderías A',0,NULL,NULL,1),(4224,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','301','4222','Mercaderías B',0,NULL,NULL,1),(4225,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','31','4003','Materias primas',0,NULL,NULL,1),(4226,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','310','4225','Materias primas A',0,NULL,NULL,1),(4227,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','311','4225','Materias primas B',0,NULL,NULL,1),(4228,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','32','4003','Otros aprovisionamientos',0,NULL,NULL,1),(4229,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','320','4228','Elementos y conjuntos incorporables',0,NULL,NULL,1),(4230,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','321','4228','Combustibles',0,NULL,NULL,1),(4231,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','322','4228','Repuestos',0,NULL,NULL,1),(4232,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','325','4228','Materiales diversos',0,NULL,NULL,1),(4233,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','326','4228','Embalajes',0,NULL,NULL,1),(4234,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','327','4228','Envases',0,NULL,NULL,1),(4235,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','328','4229','Material de oficina',0,NULL,NULL,1),(4236,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','33','4003','Productos en curso',0,NULL,NULL,1),(4237,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','330','4236','Productos en curos A',0,NULL,NULL,1),(4238,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','331','4236','Productos en curso B',0,NULL,NULL,1),(4239,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','34','4003','Productos semiterminados',0,NULL,NULL,1),(4240,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','340','4239','Productos semiterminados A',0,NULL,NULL,1),(4241,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','341','4239','Productos semiterminados B',0,NULL,NULL,1),(4242,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','35','4003','Productos terminados',0,NULL,NULL,1),(4243,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','350','4242','Productos terminados A',0,NULL,NULL,1),(4244,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','351','4242','Productos terminados B',0,NULL,NULL,1),(4245,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','36','4003','Subproductos, residuos y materiales recuperados',0,NULL,NULL,1),(4246,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','360','4245','Subproductos A',0,NULL,NULL,1),(4247,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','361','4245','Subproductos B',0,NULL,NULL,1),(4248,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','365','4245','Residuos A',0,NULL,NULL,1),(4249,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','366','4245','Residuos B',0,NULL,NULL,1),(4250,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','368','4245','Materiales recuperados A',0,NULL,NULL,1),(4251,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','369','4245','Materiales recuperados B',0,NULL,NULL,1),(4252,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','39','4003','Deterioro de valor de las existencias',0,NULL,NULL,1),(4253,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','390','4252','Deterioro de valor de las mercaderías',0,NULL,NULL,1),(4254,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','391','4252','Deterioro de valor de las materias primas',0,NULL,NULL,1),(4255,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','392','4252','Deterioro de valor de otros aprovisionamientos',0,NULL,NULL,1),(4256,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','393','4252','Deterioro de valor de los productos en curso',0,NULL,NULL,1),(4257,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','394','4252','Deterioro de valor de los productos semiterminados',0,NULL,NULL,1),(4258,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','395','4252','Deterioro de valor de los productos terminados',0,NULL,NULL,1),(4259,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','EXISTENCIAS','XXXXXX','396','4252','Deterioro de valor de los subproductos, residuos y materiales recuperados',0,NULL,NULL,1),(4260,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','PROVEEDORES','40','4004','Proveedores',0,NULL,NULL,1),(4261,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','PROVEEDORES','400','4260','Proveedores',0,NULL,NULL,1),(4262,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4000','4261','Proveedores euros',0,NULL,NULL,1),(4263,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4004','4261','Proveedores moneda extranjera',0,NULL,NULL,1),(4264,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4009','4261','Proveedores facturas pendientes de recibir o formalizar',0,NULL,NULL,1),(4265,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','401','4260','Proveedores efectos comerciales a pagar',0,NULL,NULL,1),(4266,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','403','4260','Proveedores empresas del grupo',0,NULL,NULL,1),(4267,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4030','4266','Proveedores empresas del grupo euros',0,NULL,NULL,1),(4268,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4031','4266','Efectos comerciales a pagar empresas del grupo',0,NULL,NULL,1),(4269,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4034','4266','Proveedores empresas del grupo moneda extranjera',0,NULL,NULL,1),(4270,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4036','4266','Envases y embalajes a devolver a proveedores empresas del grupo',0,NULL,NULL,1),(4271,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4039','4266','Proveedores empresas del grupo facturas pendientes de recibir o de formalizar',0,NULL,NULL,1),(4272,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','404','4260','Proveedores empresas asociadas',0,NULL,NULL,1),(4273,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','405','4260','Proveedores otras partes vinculadas',0,NULL,NULL,1),(4274,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','406','4260','Envases y embalajes a devolver a proveedores',0,NULL,NULL,1),(4275,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','407','4260','Anticipos a proveedores',0,NULL,NULL,1),(4276,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','41','4004','Acreedores varios',0,NULL,NULL,1),(4277,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','410','4276','Acreedores por prestaciones de servicios',0,NULL,NULL,1),(4278,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4100','4277','Acreedores por prestaciones de servicios euros',0,NULL,NULL,1),(4279,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4104','4277','Acreedores por prestaciones de servicios moneda extranjera',0,NULL,NULL,1),(4280,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4109','4277','Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar',0,NULL,NULL,1),(4281,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','411','4276','Acreedores efectos comerciales a pagar',0,NULL,NULL,1),(4282,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','419','4276','Acreedores por operaciones en común',0,NULL,NULL,1),(4283,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','CLIENTES','43','4004','Clientes',0,NULL,NULL,1),(4284,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','CLIENTES','430','4283','Clientes',0,NULL,NULL,1),(4285,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4300','4284','Clientes euros',0,NULL,NULL,1),(4286,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4304','4284','Clientes moneda extranjera',0,NULL,NULL,1),(4287,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4309','4284','Clientes facturas pendientes de formalizar',0,NULL,NULL,1),(4288,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','431','4283','Clientes efectos comerciales a cobrar',0,NULL,NULL,1),(4289,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4310','4288','Efectos comerciales en cartera',0,NULL,NULL,1),(4290,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4311','4288','Efectos comerciales descontados',0,NULL,NULL,1),(4291,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4312','4288','Efectos comerciales en gestión de cobro',0,NULL,NULL,1),(4292,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4315','4288','Efectos comerciales impagados',0,NULL,NULL,1),(4293,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','432','4283','Clientes operaciones de factoring',0,NULL,NULL,1),(4294,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','433','4283','Clientes empresas del grupo',0,NULL,NULL,1),(4295,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4330','4294','Clientes empresas del grupo euros',0,NULL,NULL,1),(4296,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4331','4294','Efectos comerciales a cobrar empresas del grupo',0,NULL,NULL,1),(4297,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4332','4294','Clientes empresas del grupo operaciones de factoring',0,NULL,NULL,1),(4298,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4334','4294','Clientes empresas del grupo moneda extranjera',0,NULL,NULL,1),(4299,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4336','4294','Clientes empresas del grupo dudoso cobro',0,NULL,NULL,1),(4300,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4337','4294','Envases y embalajes a devolver a clientes empresas del grupo',0,NULL,NULL,1),(4301,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4339','4294','Clientes empresas del grupo facturas pendientes de formalizar',0,NULL,NULL,1),(4302,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','434','4283','Clientes empresas asociadas',0,NULL,NULL,1),(4303,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','435','4283','Clientes otras partes vinculadas',0,NULL,NULL,1),(4304,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','436','4283','Clientes de dudoso cobro',0,NULL,NULL,1),(4305,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','437','4283','Envases y embalajes a devolver por clientes',0,NULL,NULL,1),(4306,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','438','4283','Anticipos de clientes',0,NULL,NULL,1),(4307,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','44','4004','Deudores varios',0,NULL,NULL,1),(4308,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','440','4307','Deudores',0,NULL,NULL,1),(4309,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4400','4308','Deudores euros',0,NULL,NULL,1),(4310,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4404','4308','Deudores moneda extranjera',0,NULL,NULL,1),(4311,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4409','4308','Deudores facturas pendientes de formalizar',0,NULL,NULL,1),(4312,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','441','4307','Deudores efectos comerciales a cobrar',0,NULL,NULL,1),(4313,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4410','4312','Deudores efectos comerciales en cartera',0,NULL,NULL,1),(4314,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4411','4312','Deudores efectos comerciales descontados',0,NULL,NULL,1),(4315,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4412','4312','Deudores efectos comerciales en gestión de cobro',0,NULL,NULL,1),(4316,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4415','4312','Deudores efectos comerciales impagados',0,NULL,NULL,1),(4317,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','446','4307','Deudores de dusoso cobro',0,NULL,NULL,1),(4318,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','449','4307','Deudores por operaciones en común',0,NULL,NULL,1),(4319,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','46','4004','Personal',0,NULL,NULL,1),(4320,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','460','4319','Anticipos de renumeraciones',0,NULL,NULL,1),(4321,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','465','4319','Renumeraciones pendientes de pago',0,NULL,NULL,1),(4322,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','47','4004','Administraciones Públicas',0,NULL,NULL,1),(4323,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','470','4322','Hacienda Pública deudora por diversos conceptos',0,NULL,NULL,1),(4324,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4700','4323','Hacienda Pública deudora por IVA',0,NULL,NULL,1),(4325,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4708','4323','Hacienda Pública deudora por subvenciones concedidas',0,NULL,NULL,1),(4326,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4709','4323','Hacienda Pública deudora por devolución de impuestos',0,NULL,NULL,1),(4327,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','471','4322','Organismos de la Seguridad Social deudores',0,NULL,NULL,1),(4328,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','472','4322','Hacienda Pública IVA soportado',0,NULL,NULL,1),(4329,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','473','4322','Hacienda Pública retenciones y pagos a cuenta',0,NULL,NULL,1),(4330,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','474','4322','Activos por impuesto diferido',0,NULL,NULL,1),(4331,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4740','4330','Activos por diferencias temporarias deducibles',0,NULL,NULL,1),(4332,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4742','4330','Derechos por deducciones y bonificaciones pendientes de aplicar',0,NULL,NULL,1),(4333,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4745','4330','Crédito por pérdidasa compensar del ejercicio',0,NULL,NULL,1),(4334,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','475','4322','Hacienda Pública acreedora por conceptos fiscales',0,NULL,NULL,1),(4335,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4750','4334','Hacienda Pública acreedora por IVA',0,NULL,NULL,1),(4336,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4751','4334','Hacienda Pública acreedora por retenciones practicadas',0,NULL,NULL,1),(4337,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4752','4334','Hacienda Pública acreedora por impuesto sobre sociedades',0,NULL,NULL,1),(4338,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4758','4334','Hacienda Pública acreedora por subvenciones a integrar',0,NULL,NULL,1),(4339,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','476','4322','Organismos de la Seguridad Social acreedores',0,NULL,NULL,1),(4340,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','477','4322','Hacienda Pública IVA repercutido',0,NULL,NULL,1),(4341,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','479','4322','Pasivos por diferencias temporarias imponibles',0,NULL,NULL,1),(4342,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','48','4004','Ajustes por periodificación',0,NULL,NULL,1),(4343,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','480','4342','Gastos anticipados',0,NULL,NULL,1),(4344,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','485','4342','Ingresos anticipados',0,NULL,NULL,1),(4345,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','49','4004','Deterioro de valor de créditos comerciales y provisiones a corto plazo',0,NULL,NULL,1),(4346,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','490','4345','Deterioro de valor de créditos por operaciones comerciales',0,NULL,NULL,1),(4347,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','493','4345','Deterioro de valor de créditos por operaciones comerciales con partes vinculadas',0,NULL,NULL,1),(4348,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4933','4347','Deterioro de valor de créditos por operaciones comerciales con empresas del grupo',0,NULL,NULL,1),(4349,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4934','4347','Deterioro de valor de créditos por operaciones comerciales con empresas asociadas',0,NULL,NULL,1),(4350,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4935','4347','Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas',0,NULL,NULL,1),(4351,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','499','4345','Provisiones por operaciones comerciales',0,NULL,NULL,1),(4352,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4994','4351','Provisión para contratos anerosos',0,NULL,NULL,1),(4353,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','ACREEDORES_DEUDORES','XXXXXX','4999','4351','Provisión para otras operaciones comerciales',0,NULL,NULL,1),(4354,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','50','4005','Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo',0,NULL,NULL,1),(4355,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','500','4354','Obligaciones y bonos a corto plazo',0,NULL,NULL,1),(4356,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','502','4354','Acciones o participaciones a corto plazo consideradas como pasivos financieros',0,NULL,NULL,1),(4357,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','505','4354','Deudas representadas en otros valores negociables a corto plazo',0,NULL,NULL,1),(4358,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','506','4354','Intereses a corto plazo de emprésitos y otras emisiones analógicas',0,NULL,NULL,1),(4359,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','507','4354','Dividendos de acciones o participaciones consideradas como pasivos financieros',0,NULL,NULL,1),(4360,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','509','4354','Valores negociables amortizados',0,NULL,NULL,1),(4361,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5090','4360','Obligaciones y bonos amortizados',0,NULL,NULL,1),(4362,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5095','4360','Otros valores negociables amortizados',0,NULL,NULL,1),(4363,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','51','4005','Deudas a corto plazo con partes vinculadas',0,NULL,NULL,1),(4364,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','510','4363','Deudas a corto plazo con entidades de crédito vinculadas',0,NULL,NULL,1),(4365,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5103','4364','Deudas a corto plazo con entidades de crédito empresas del grupo',0,NULL,NULL,1),(4366,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5104','4364','Deudas a corto plazo con entidades de crédito empresas asociadas',0,NULL,NULL,1),(4367,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5105','4364','Deudas a corto plazo con otras entidades de crédito vinculadas',0,NULL,NULL,1),(4368,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','511','4363','Proveedores de inmovilizado a corto plazo partes vinculadas',0,NULL,NULL,1),(4369,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5113','4368','Proveedores de inmovilizado a corto plazo empresas del grupo',0,NULL,NULL,1),(4370,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5114','4368','Proveedores de inmovilizado a corto plazo empresas asociadas',0,NULL,NULL,1),(4371,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5115','4368','Proveedores de inmovilizado a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4372,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','512','4363','Acreedores por arrendamiento financiero a corto plazo partes vinculadas',0,NULL,NULL,1),(4373,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5123','4372','Acreedores por arrendamiento financiero a corto plazo empresas del grupo',0,NULL,NULL,1),(4374,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5124','4372','Acreedores por arrendamiento financiero a corto plazo empresas asociadas',0,NULL,NULL,1),(4375,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5125','4372','Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4376,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','513','4363','Otras deudas a corto plazo con partes vinculadas',0,NULL,NULL,1),(4377,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5133','4376','Otras deudas a corto plazo con empresas del grupo',0,NULL,NULL,1),(4378,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5134','4376','Otras deudas a corto plazo con empresas asociadas',0,NULL,NULL,1),(4379,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5135','4376','Otras deudas a corto plazo con partes vinculadas',0,NULL,NULL,1),(4380,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','514','4363','Intereses a corto plazo con partes vinculadas',0,NULL,NULL,1),(4381,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5143','4380','Intereses a corto plazo empresas del grupo',0,NULL,NULL,1),(4382,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5144','4380','Intereses a corto plazo empresas asociadas',0,NULL,NULL,1),(4383,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5145','4380','Intereses deudas a corto plazo partes vinculadas',0,NULL,NULL,1),(4384,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','52','4005','Deudas a corto plazo por préstamos recibidos y otros conceptos',0,NULL,NULL,1),(4385,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','520','4384','Deudas a corto plazo con entidades de crédito',0,NULL,NULL,1),(4386,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5200','4385','Préstamos a corto plazo de entidades de crédito',0,NULL,NULL,1),(4387,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5201','4385','Deudas a corto plazo por crédito dispuesto',0,NULL,NULL,1),(4388,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5208','4385','Deudas por efectos descontados',0,NULL,NULL,1),(4389,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5209','4385','Deudas por operaciones de factoring',0,NULL,NULL,1),(4390,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','521','4384','Deudas a corto plazo',0,NULL,NULL,1),(4391,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','522','4384','Deudas a corto plazo transformables en subvenciones donaciones y legados',0,NULL,NULL,1),(4392,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','523','4384','Proveedores de inmovilizado a corto plazo',0,NULL,NULL,1),(4393,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','526','4384','Dividendo activo a pagar',0,NULL,NULL,1),(4394,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','527','4384','Intereses a corto plazo de deudas con entidades de crédito',0,NULL,NULL,1),(4395,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','528','4384','Intereses a corto plazo de deudas',0,NULL,NULL,1),(4396,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','529','4384','Provisiones a corto plazo',0,NULL,NULL,1),(4397,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5291','4396','Provisión a corto plazo para impuestos',0,NULL,NULL,1),(4398,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5292','4396','Provisión a corto plazo para otras responsabilidades',0,NULL,NULL,1),(4399,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5293','4396','Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado',0,NULL,NULL,1),(4400,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5295','4396','Provisión a corto plazo para actuaciones medioambientales',0,NULL,NULL,1),(4401,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','53','4005','Inversiones financieras a corto plazo en partes vinculadas',0,NULL,NULL,1),(4402,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','530','4401','Participaciones a corto plazo en partes vinculadas',0,NULL,NULL,1),(4403,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5303','4402','Participaciones a corto plazo en empresas del grupo',0,NULL,NULL,1),(4404,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5304','4402','Participaciones a corto plazo en empresas asociadas',0,NULL,NULL,1),(4405,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5305','4402','Participaciones a corto plazo en otras partes vinculadas',0,NULL,NULL,1),(4406,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','531','4401','Valores representativos de deuda a corto plazo de partes vinculadas',0,NULL,NULL,1),(4407,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5313','4406','Valores representativos de deuda a corto plazo de empresas del grupo',0,NULL,NULL,1),(4408,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5314','4406','Valores representativos de deuda a corto plazo de empresas asociadas',0,NULL,NULL,1),(4409,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5315','4406','Valores representativos de deuda a corto plazo de otras partes vinculadas',0,NULL,NULL,1),(4410,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','532','4401','Créditos a corto plazo a partes vinculadas',0,NULL,NULL,1),(4411,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5323','4410','Créditos a corto plazo a empresas del grupo',0,NULL,NULL,1),(4412,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5324','4410','Créditos a corto plazo a empresas asociadas',0,NULL,NULL,1),(4413,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5325','4410','Créditos a corto plazo a otras partes vinculadas',0,NULL,NULL,1),(4414,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','533','4401','Intereses a corto plazo de valores representativos de deuda de partes vinculadas',0,NULL,NULL,1),(4415,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5333','4414','Intereses a corto plazo de valores representativos de deuda en empresas del grupo',0,NULL,NULL,1),(4416,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5334','4414','Intereses a corto plazo de valores representativos de deuda en empresas asociadas',0,NULL,NULL,1),(4417,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5335','4414','Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas',0,NULL,NULL,1),(4418,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','534','4401','Intereses a corto plazo de créditos a partes vinculadas',0,NULL,NULL,1),(4419,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5343','4418','Intereses a corto plazo de créditos a empresas del grupo',0,NULL,NULL,1),(4420,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5344','4418','Intereses a corto plazo de créditos a empresas asociadas',0,NULL,NULL,1),(4421,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5345','4418','Intereses a corto plazo de créditos a otras partes vinculadas',0,NULL,NULL,1),(4422,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','535','4401','Dividendo a cobrar de inversiones financieras en partes vinculadas',0,NULL,NULL,1),(4423,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5353','4422','Dividendo a cobrar de empresas del grupo',0,NULL,NULL,1),(4424,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5354','4422','Dividendo a cobrar de empresas asociadas',0,NULL,NULL,1),(4425,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5355','4422','Dividendo a cobrar de otras partes vinculadas',0,NULL,NULL,1),(4426,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','539','4401','Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas',0,NULL,NULL,1),(4427,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5393','4426','Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo',0,NULL,NULL,1),(4428,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5394','4426','Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas',0,NULL,NULL,1),(4429,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5395','4426','Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas',0,NULL,NULL,1),(4430,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','54','4005','Otras inversiones financieras a corto plazo',0,NULL,NULL,1),(4431,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','540','4430','Inversiones financieras a corto plazo en instrumentos de patrimonio',0,NULL,NULL,1),(4432,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','541','4430','Valores representativos de deuda a corto plazo',0,NULL,NULL,1),(4433,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','542','4430','Créditos a corto plazo',0,NULL,NULL,1),(4434,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','543','4430','Créditos a corto plazo por enejenación de inmovilizado',0,NULL,NULL,1),(4435,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','544','4430','Créditos a corto plazo al personal',0,NULL,NULL,1),(4436,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','545','4430','Dividendo a cobrar',0,NULL,NULL,1),(4437,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','546','4430','Intereses a corto plazo de valores reprsentativos de deuda',0,NULL,NULL,1),(4438,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','547','4430','Intereses a corto plazo de créditos',0,NULL,NULL,1),(4439,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','548','4430','Imposiciones a corto plazo',0,NULL,NULL,1),(4440,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','549','4430','Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo',0,NULL,NULL,1),(4441,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','55','4005','Otras cuentas no bancarias',0,NULL,NULL,1),(4442,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','550','4441','Titular de la explotación',0,NULL,NULL,1),(4443,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','551','4441','Cuenta corriente con socios y administradores',0,NULL,NULL,1),(4444,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','552','4441','Cuenta corriente otras personas y entidades vinculadas',0,NULL,NULL,1),(4445,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5523','4444','Cuenta corriente con empresas del grupo',0,NULL,NULL,1),(4446,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5524','4444','Cuenta corriente con empresas asociadas',0,NULL,NULL,1),(4447,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5525','4444','Cuenta corriente con otras partes vinculadas',0,NULL,NULL,1),(4448,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','554','4441','Cuenta corriente con uniones temporales de empresas y comunidades de bienes',0,NULL,NULL,1),(4449,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','555','4441','Partidas pendientes de aplicación',0,NULL,NULL,1),(4450,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','556','4441','Desembolsos exigidos sobre participaciones en el patrimonio neto',0,NULL,NULL,1),(4451,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5563','4450','Desembolsos exigidos sobre participaciones empresas del grupo',0,NULL,NULL,1),(4452,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5564','4450','Desembolsos exigidos sobre participaciones empresas asociadas',0,NULL,NULL,1),(4453,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5565','4450','Desembolsos exigidos sobre participaciones otras partes vinculadas',0,NULL,NULL,1),(4454,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5566','4450','Desembolsos exigidos sobre participaciones otras empresas',0,NULL,NULL,1),(4455,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','557','4441','Dividendo activo a cuenta',0,NULL,NULL,1),(4456,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','558','4441','Socios por desembolsos exigidos',0,NULL,NULL,1),(4457,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5580','4456','Socios por desembolsos exigidos sobre acciones o participaciones ordinarias',0,NULL,NULL,1),(4458,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5585','4456','Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros',0,NULL,NULL,1),(4459,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','559','4441','Derivados financieros a corto plazo',0,NULL,NULL,1),(4460,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5590','4459','Activos por derivados financieros a corto plazo',0,NULL,NULL,1),(4461,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5595','4459','Pasivos por derivados financieros a corto plazo',0,NULL,NULL,1),(4462,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','56','4005','Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación',0,NULL,NULL,1),(4463,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','560','4462','Finanzas recibidas a corto plazo',0,NULL,NULL,1),(4464,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','561','4462','Depósitos recibidos a corto plazo',0,NULL,NULL,1),(4465,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','565','4462','Finanzas constituidas a corto plazo',0,NULL,NULL,1),(4466,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','566','4462','Depósitos constituidos a corto plazo',0,NULL,NULL,1),(4467,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','567','4462','Intereses pagados por anticipado',0,NULL,NULL,1),(4468,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','568','4462','Intereses cobrados a corto plazo',0,NULL,NULL,1),(4469,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','57','4005','Tesorería',0,NULL,NULL,1),(4470,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','CAJA','570','4469','Caja euros',0,NULL,NULL,1),(4471,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','571','4469','Caja moneda extranjera',0,NULL,NULL,1),(4472,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','BANCOS','572','4469','Bancos e instituciones de crédito cc vista euros',0,NULL,NULL,1),(4473,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','573','4469','Bancos e instituciones de crédito cc vista moneda extranjera',0,NULL,NULL,1),(4474,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','574','4469','Bancos e instituciones de crédito cuentas de ahorro euros',0,NULL,NULL,1),(4475,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','575','4469','Bancos e instituciones de crédito cuentas de ahorro moneda extranjera',0,NULL,NULL,1),(4476,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','576','4469','Inversiones a corto plazo de gran liquidez',0,NULL,NULL,1),(4477,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','59','4005','Deterioro del valor de las inversiones financieras a corto plazo',0,NULL,NULL,1),(4478,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','593','4477','Deterioro del valor de participaciones a corto plazo en partes vinculadas',0,NULL,NULL,1),(4479,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5933','4478','Deterioro del valor de participaciones a corto plazo en empresas del grupo',0,NULL,NULL,1),(4480,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5934','4478','Deterioro del valor de participaciones a corto plazo en empresas asociadas',0,NULL,NULL,1),(4481,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5935','4478','Deterioro del valor de participaciones a corto plazo en otras partes vinculadas',0,NULL,NULL,1),(4482,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','594','4477','Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas',0,NULL,NULL,1),(4483,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5943','4482','Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo',0,NULL,NULL,1),(4484,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5944','4482','Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas',0,NULL,NULL,1),(4485,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5945','4482','Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas',0,NULL,NULL,1),(4486,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','595','4477','Deterioro del valor de créditos a corto plazo en partes vinculadas',0,NULL,NULL,1),(4487,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5953','4486','Deterioro del valor de créditos a corto plazo en empresas del grupo',0,NULL,NULL,1),(4488,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5954','4486','Deterioro del valor de créditos a corto plazo en empresas asociadas',0,NULL,NULL,1),(4489,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','5955','4486','Deterioro del valor de créditos a corto plazo en otras partes vinculadas',0,NULL,NULL,1),(4490,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','596','4477','Deterioro del valor de participaciones a corto plazo',0,NULL,NULL,1),(4491,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','597','4477','Deterioro del valor de valores representativos de deuda a corto plazo',0,NULL,NULL,1),(4492,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','CUENTAS_FINANCIERAS','XXXXXX','598','4477','Deterioro de valor de créditos a corto plazo',0,NULL,NULL,1),(4493,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','60','4006','Compras',0,NULL,NULL,1),(4494,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','COMPRAS','600','4493','Compras de mercaderías',0,NULL,NULL,1),(4495,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','COMPRAS','601','4493','Compras de materias primas',0,NULL,NULL,1),(4496,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','602','4493','Compras de otros aprovisionamientos',0,NULL,NULL,1),(4497,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','606','4493','Descuentos sobre compras por pronto pago',0,NULL,NULL,1),(4498,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6060','4497','Descuentos sobre compras por pronto pago de mercaderías',0,NULL,NULL,1),(4499,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6061','4497','Descuentos sobre compras por pronto pago de materias primas',0,NULL,NULL,1),(4500,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6062','4497','Descuentos sobre compras por pronto pago de otros aprovisionamientos',0,NULL,NULL,1),(4501,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','COMPRAS','607','4493','Trabajos realizados por otras empresas',0,NULL,NULL,1),(4502,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','608','4493','Devoluciones de compras y operaciones similares',0,NULL,NULL,1),(4503,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6080','4502','Devoluciones de compras de mercaderías',0,NULL,NULL,1),(4504,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6081','4502','Devoluciones de compras de materias primas',0,NULL,NULL,1),(4505,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6082','4502','Devoluciones de compras de otros aprovisionamientos',0,NULL,NULL,1),(4506,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','609','4493','Rappels por compras',0,NULL,NULL,1),(4507,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6090','4506','Rappels por compras de mercaderías',0,NULL,NULL,1),(4508,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6091','4506','Rappels por compras de materias primas',0,NULL,NULL,1),(4509,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6092','4506','Rappels por compras de otros aprovisionamientos',0,NULL,NULL,1),(4510,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','61','4006','Variación de existencias',0,NULL,NULL,1),(4511,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','610','4510','Variación de existencias de mercaderías',0,NULL,NULL,1),(4512,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','611','4510','Variación de existencias de materias primas',0,NULL,NULL,1),(4513,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','612','4510','Variación de existencias de otros aprovisionamientos',0,NULL,NULL,1),(4514,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','62','4006','Servicios exteriores',0,NULL,NULL,1),(4515,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','620','4514','Gastos en investigación y desarrollo del ejercicio',0,NULL,NULL,1),(4516,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','621','4514','Arrendamientos y cánones',0,NULL,NULL,1),(4517,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','622','4514','Reparaciones y conservación',0,NULL,NULL,1),(4518,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','623','4514','Servicios profesionales independientes',0,NULL,NULL,1),(4519,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','624','4514','Transportes',0,NULL,NULL,1),(4520,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','625','4514','Primas de seguros',0,NULL,NULL,1),(4521,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','626','4514','Servicios bancarios y similares',0,NULL,NULL,1),(4522,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','627','4514','Publicidad, propaganda y relaciones públicas',0,NULL,NULL,1),(4523,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','628','4514','Suministros',0,NULL,NULL,1),(4524,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','629','4514','Otros servicios',0,NULL,NULL,1),(4525,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','63','4006','Tributos',0,NULL,NULL,1),(4526,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','630','4525','Impuesto sobre benecifios',0,NULL,NULL,1),(4527,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6300','4526','Impuesto corriente',0,NULL,NULL,1),(4528,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6301','4526','Impuesto diferido',0,NULL,NULL,1),(4529,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','631','4525','Otros tributos',0,NULL,NULL,1),(4530,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','633','4525','Ajustes negativos en la imposición sobre beneficios',0,NULL,NULL,1),(4531,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','634','4525','Ajustes negativos en la imposición indirecta',0,NULL,NULL,1),(4532,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6341','4531','Ajustes negativos en IVA de activo corriente',0,NULL,NULL,1),(4533,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6342','4531','Ajustes negativos en IVA de inversiones',0,NULL,NULL,1),(4534,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','636','4525','Devolución de impuestos',0,NULL,NULL,1),(4535,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','638','4525','Ajustes positivos en la imposición sobre beneficios',0,NULL,NULL,1),(4536,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','639','4525','Ajustes positivos en la imposición directa',0,NULL,NULL,1),(4537,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6391','4536','Ajustes positivos en IVA de activo corriente',0,NULL,NULL,1),(4538,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6392','4536','Ajustes positivos en IVA de inversiones',0,NULL,NULL,1),(4539,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','64','4006','Gastos de personal',0,NULL,NULL,1),(4540,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','640','4539','Sueldos y salarios',0,NULL,NULL,1),(4541,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','641','4539','Indemnizaciones',0,NULL,NULL,1),(4542,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','642','4539','Seguridad social a cargo de la empresa',0,NULL,NULL,1),(4543,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','649','4539','Otros gastos sociales',0,NULL,NULL,1),(4544,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','65','4006','Otros gastos de gestión',0,NULL,NULL,1),(4545,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','650','4544','Pérdidas de créditos comerciales incobrables',0,NULL,NULL,1),(4546,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','651','4544','Resultados de operaciones en común',0,NULL,NULL,1),(4547,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6510','4546','Beneficio transferido gestor',0,NULL,NULL,1),(4548,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6511','4546','Pérdida soportada participe o asociado no gestor',0,NULL,NULL,1),(4549,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','659','4544','Otras pérdidas en gestión corriente',0,NULL,NULL,1),(4550,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','66','4006','Gastos financieros',0,NULL,NULL,1),(4551,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','660','4550','Gastos financieros por actualización de provisiones',0,NULL,NULL,1),(4552,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','661','4550','Intereses de obligaciones y bonos',0,NULL,NULL,1),(4553,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6610','4452','Intereses de obligaciones y bonos a largo plazo empresas del grupo',0,NULL,NULL,1),(4554,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6611','4452','Intereses de obligaciones y bonos a largo plazo empresas asociadas',0,NULL,NULL,1),(4555,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6612','4452','Intereses de obligaciones y bonos a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4556,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6613','4452','Intereses de obligaciones y bonos a largo plazo otras empresas',0,NULL,NULL,1),(4557,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6615','4452','Intereses de obligaciones y bonos a corto plazo empresas del grupo',0,NULL,NULL,1),(4558,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6616','4452','Intereses de obligaciones y bonos a corto plazo empresas asociadas',0,NULL,NULL,1),(4559,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6617','4452','Intereses de obligaciones y bonos a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4560,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6618','4452','Intereses de obligaciones y bonos a corto plazo otras empresas',0,NULL,NULL,1),(4561,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','662','4550','Intereses de deudas',0,NULL,NULL,1),(4562,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6620','4561','Intereses de deudas empresas del grupo',0,NULL,NULL,1),(4563,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6621','4561','Intereses de deudas empresas asociadas',0,NULL,NULL,1),(4564,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6622','4561','Intereses de deudas otras partes vinculadas',0,NULL,NULL,1),(4565,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6623','4561','Intereses de deudas con entidades de crédito',0,NULL,NULL,1),(4566,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6624','4561','Intereses de deudas otras empresas',0,NULL,NULL,1),(4567,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','663','4550','Pérdidas por valorización de activos y pasivos financieros por su valor razonable',0,NULL,NULL,1),(4568,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','664','4550','Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros',0,NULL,NULL,1),(4569,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6640','4568','Dividendos de pasivos empresas del grupo',0,NULL,NULL,1),(4570,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6641','4568','Dividendos de pasivos empresas asociadas',0,NULL,NULL,1),(4571,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6642','4568','Dividendos de pasivos otras partes vinculadas',0,NULL,NULL,1),(4572,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6643','4568','Dividendos de pasivos otras empresas',0,NULL,NULL,1),(4573,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','665','4550','Intereses por descuento de efectos y operaciones de factoring',0,NULL,NULL,1),(4574,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6650','4573','Intereses por descuento de efectos en entidades de crédito del grupo',0,NULL,NULL,1),(4575,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6651','4573','Intereses por descuento de efectos en entidades de crédito asociadas',0,NULL,NULL,1),(4576,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6652','4573','Intereses por descuento de efectos en entidades de crédito vinculadas',0,NULL,NULL,1),(4577,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6653','4573','Intereses por descuento de efectos en otras entidades de crédito',0,NULL,NULL,1),(4578,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6654','4573','Intereses por operaciones de factoring con entidades de crédito del grupo',0,NULL,NULL,1),(4579,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6655','4573','Intereses por operaciones de factoring con entidades de crédito asociadas',0,NULL,NULL,1),(4580,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6656','4573','Intereses por operaciones de factoring con otras entidades de crédito vinculadas',0,NULL,NULL,1),(4581,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6657','4573','Intereses por operaciones de factoring con otras entidades de crédito',0,NULL,NULL,1),(4582,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','666','4550','Pérdidas en participaciones y valores representativos de deuda',0,NULL,NULL,1),(4583,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6660','4582','Pérdidas en valores representativos de deuda a largo plazo empresas del grupo',0,NULL,NULL,1),(4584,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6661','4582','Pérdidas en valores representativos de deuda a largo plazo empresas asociadas',0,NULL,NULL,1),(4585,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6662','4582','Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4586,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6663','4582','Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas',0,NULL,NULL,1),(4587,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6665','4582','Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo',0,NULL,NULL,1),(4588,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6666','4582','Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas',0,NULL,NULL,1),(4589,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6667','4582','Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4590,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6668','4582','Pérdidas en valores representativos de deuda a corto plazo otras empresas',0,NULL,NULL,1),(4591,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','667','4550','Pérdidas de créditos no comerciales',0,NULL,NULL,1),(4592,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6670','4591','Pérdidas de créditos a largo plazo empresas del grupo',0,NULL,NULL,1),(4593,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6671','4591','Pérdidas de créditos a largo plazo empresas asociadas',0,NULL,NULL,1),(4594,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6672','4591','Pérdidas de créditos a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4595,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6673','4591','Pérdidas de créditos a largo plazo otras empresas',0,NULL,NULL,1),(4596,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6675','4591','Pérdidas de créditos a corto plazo empresas del grupo',0,NULL,NULL,1),(4597,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6676','4591','Pérdidas de créditos a corto plazo empresas asociadas',0,NULL,NULL,1),(4598,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6677','4591','Pérdidas de créditos a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4599,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6678','4591','Pérdidas de créditos a corto plazo otras empresas',0,NULL,NULL,1),(4600,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','668','4550','Diferencias negativas de cambio',0,NULL,NULL,1),(4601,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','669','4550','Otros gastos financieros',0,NULL,NULL,1),(4602,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','67','4006','Pérdidas procedentes de activos no corrientes y gastos excepcionales',0,NULL,NULL,1),(4603,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','670','4602','Pérdidas procedentes del inmovilizado intangible',0,NULL,NULL,1),(4604,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','671','4602','Pérdidas procedentes del inmovilizado material',0,NULL,NULL,1),(4605,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','672','4602','Pérdidas procedentes de las inversiones inmobiliarias',0,NULL,NULL,1),(4607,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','673','4602','Pérdidas procedentes de participaciones a largo plazo en partes vinculadas',0,NULL,NULL,1),(4608,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6733','4607','Pérdidas procedentes de participaciones a largo plazo empresas del grupo',0,NULL,NULL,1),(4609,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6734','4607','Pérdidas procedentes de participaciones a largo plazo empresas asociadas',0,NULL,NULL,1),(4610,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6735','4607','Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4611,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','675','4602','Pérdidas por operaciones con obligaciones propias',0,NULL,NULL,1),(4612,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','678','4602','Gastos excepcionales',0,NULL,NULL,1),(4613,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','68','4006','Dotaciones para amortizaciones',0,NULL,NULL,1),(4614,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','680','4613','Amortización del inmovilizado intangible',0,NULL,NULL,1),(4615,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','681','4613','Amortización del inmovilizado material',0,NULL,NULL,1),(4616,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','682','4613','Amortización de las inversiones inmobiliarias',0,NULL,NULL,1),(4617,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','69','4006','Pérdidas por deterioro y otras dotaciones',0,NULL,NULL,1),(4618,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','690','4617','Pérdidas por deterioro del inmovilizado intangible',0,NULL,NULL,1),(4619,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','691','4617','Pérdidas por deterioro del inmovilizado material',0,NULL,NULL,1),(4620,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','692','4617','Pérdidas por deterioro de las inversiones inmobiliarias',0,NULL,NULL,1),(4621,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','693','4617','Pérdidas por deterioro de existencias',0,NULL,NULL,1),(4622,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6930','4621','Pérdidas por deterioro de productos terminados y en curso de fabricación',0,NULL,NULL,1),(4623,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6931','4621','Pérdidas por deterioro de mercaderías',0,NULL,NULL,1),(4624,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6932','4621','Pérdidas por deterioro de materias primas',0,NULL,NULL,1),(4625,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6933','4621','Pérdidas por deterioro de otros aprovisionamientos',0,NULL,NULL,1),(4626,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','694','4617','Pérdidas por deterioro de créditos por operaciones comerciales',0,NULL,NULL,1),(4627,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','695','4617','Dotación a la provisión por operaciones comerciales',0,NULL,NULL,1),(4628,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6954','4627','Dotación a la provisión por contratos onerosos',0,NULL,NULL,1),(4629,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6959','4628','Dotación a la provisión para otras operaciones comerciales',0,NULL,NULL,1),(4630,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','696','4617','Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo',0,NULL,NULL,1),(4631,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6960','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo',0,NULL,NULL,1),(4632,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6961','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas',0,NULL,NULL,1),(4633,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6962','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4634,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6963','4630','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas',0,NULL,NULL,1),(4635,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6965','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo',0,NULL,NULL,1),(4636,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6966','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas',0,NULL,NULL,1),(4637,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6967','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4638,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6968','4630','Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas',0,NULL,NULL,1),(4639,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','697','4617','Pérdidas por deterioro de créditos a largo plazo',0,NULL,NULL,1),(4640,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6970','4639','Pérdidas por deterioro de créditos a largo plazo empresas del grupo',0,NULL,NULL,1),(4641,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6971','4639','Pérdidas por deterioro de créditos a largo plazo empresas asociadas',0,NULL,NULL,1),(4642,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6972','4639','Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4643,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6973','4639','Pérdidas por deterioro de créditos a largo plazo otras empresas',0,NULL,NULL,1),(4644,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','698','4617','Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo',0,NULL,NULL,1),(4645,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6980','4644','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo',0,NULL,NULL,1),(4646,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6981','4644','Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas',0,NULL,NULL,1),(4647,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6985','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo',0,NULL,NULL,1),(4648,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6986','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas',0,NULL,NULL,1),(4649,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6988','4644','Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas',0,NULL,NULL,1),(4650,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','699','4617','Pérdidas por deterioro de crédito a corto plazo',0,NULL,NULL,1),(4651,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6990','4650','Pérdidas por deterioro de crédito a corto plazo empresas del grupo',0,NULL,NULL,1),(4652,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6991','4650','Pérdidas por deterioro de crédito a corto plazo empresas asociadas',0,NULL,NULL,1),(4653,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6992','4650','Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4654,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','COMPRAS_GASTOS','XXXXXX','6993','4650','Pérdidas por deterioro de crédito a corto plazo otras empresas',0,NULL,NULL,1),(4655,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','70','4007','Ventas',0,NULL,NULL,1),(4656,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','700','4655','Ventas de mercaderías',0,NULL,NULL,1),(4657,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','701','4655','Ventas de productos terminados',0,NULL,NULL,1),(4658,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','702','4655','Ventas de productos semiterminados',0,NULL,NULL,1),(4659,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','703','4655','Ventas de subproductos y residuos',0,NULL,NULL,1),(4660,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','704','4655','Ventas de envases y embalajes',0,NULL,NULL,1),(4661,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','VENTAS','705','4655','Prestaciones de servicios',0,NULL,NULL,1),(4662,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','706','4655','Descuentos sobre ventas por pronto pago',0,NULL,NULL,1),(4663,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7060','4662','Descuentos sobre ventas por pronto pago de mercaderías',0,NULL,NULL,1),(4664,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7061','4662','Descuentos sobre ventas por pronto pago de productos terminados',0,NULL,NULL,1),(4665,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7062','4662','Descuentos sobre ventas por pronto pago de productos semiterminados',0,NULL,NULL,1),(4666,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7063','4662','Descuentos sobre ventas por pronto pago de subproductos y residuos',0,NULL,NULL,1),(4667,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','708','4655','Devoluciones de ventas y operacioes similares',0,NULL,NULL,1),(4668,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7080','4667','Devoluciones de ventas de mercaderías',0,NULL,NULL,1),(4669,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7081','4667','Devoluciones de ventas de productos terminados',0,NULL,NULL,1),(4670,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7082','4667','Devoluciones de ventas de productos semiterminados',0,NULL,NULL,1),(4671,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7083','4667','Devoluciones de ventas de subproductos y residuos',0,NULL,NULL,1),(4672,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7084','4667','Devoluciones de ventas de envases y embalajes',0,NULL,NULL,1),(4673,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','71','4007','Variación de existencias',0,NULL,NULL,1),(4674,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','710','4673','Variación de existencias de productos en curso',0,NULL,NULL,1),(4675,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','711','4673','Variación de existencias de productos semiterminados',0,NULL,NULL,1),(4676,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','712','4673','Variación de existencias de productos terminados',0,NULL,NULL,1),(4677,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','713','4673','Variación de existencias de subproductos, residuos y materiales recuperados',0,NULL,NULL,1),(4678,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','73','4007','Trabajos realizados para la empresa',0,NULL,NULL,1),(4679,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','730','4678','Trabajos realizados para el inmovilizado intangible',0,NULL,NULL,1),(4680,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','731','4678','Trabajos realizados para el inmovilizado tangible',0,NULL,NULL,1),(4681,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','732','4678','Trabajos realizados en inversiones inmobiliarias',0,NULL,NULL,1),(4682,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','733','4678','Trabajos realizados para el inmovilizado material en curso',0,NULL,NULL,1),(4683,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','74','4007','Subvenciones, donaciones y legados',0,NULL,NULL,1),(4684,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','740','4683','Subvenciones, donaciones y legados a la explotación',0,NULL,NULL,1),(4685,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','746','4683','Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio',0,NULL,NULL,1),(4686,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','747','4683','Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio',0,NULL,NULL,1),(4687,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','75','4007','Otros ingresos de gestión',0,NULL,NULL,1),(4688,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','751','4687','Resultados de operaciones en común',0,NULL,NULL,1),(4689,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7510','4688','Pérdida transferida gestor',0,NULL,NULL,1),(4690,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7511','4688','Beneficio atribuido participe o asociado no gestor',0,NULL,NULL,1),(4691,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','752','4687','Ingreso por arrendamiento',0,NULL,NULL,1),(4692,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','753','4687','Ingresos de propiedad industrial cedida en explotación',0,NULL,NULL,1),(4693,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','754','4687','Ingresos por comisiones',0,NULL,NULL,1),(4694,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','755','4687','Ingresos por servicios al personal',0,NULL,NULL,1),(4695,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','759','4687','Ingresos por servicios diversos',0,NULL,NULL,1),(4696,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76','4007','Ingresos financieros',0,NULL,NULL,1),(4697,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','760','4696','Ingresos de participaciones en instrumentos de patrimonio',0,NULL,NULL,1),(4698,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7600','4697','Ingresos de participaciones en instrumentos de patrimonio empresas del grupo',0,NULL,NULL,1),(4699,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7601','4697','Ingresos de participaciones en instrumentos de patrimonio empresas asociadas',0,NULL,NULL,1),(4700,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7602','4697','Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas',0,NULL,NULL,1),(4701,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7603','4697','Ingresos de participaciones en instrumentos de patrimonio otras empresas',0,NULL,NULL,1),(4702,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','761','4696','Ingresos de valores representativos de deuda',0,NULL,NULL,1),(4703,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7610','4702','Ingresos de valores representativos de deuda empresas del grupo',0,NULL,NULL,1),(4704,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7611','4702','Ingresos de valores representativos de deuda empresas asociadas',0,NULL,NULL,1),(4705,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7612','4702','Ingresos de valores representativos de deuda otras partes asociadas',0,NULL,NULL,1),(4706,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7613','4702','Ingresos de valores representativos de deuda otras empresas',0,NULL,NULL,1),(4707,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','762','4696','Ingresos de créditos',0,NULL,NULL,1),(4708,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7620','4707','Ingresos de créditos a largo plazo',0,NULL,NULL,1),(4709,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76200','4708','Ingresos de crédito a largo plazo empresas del grupo',0,NULL,NULL,1),(4710,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76201','4708','Ingresos de crédito a largo plazo empresas asociadas',0,NULL,NULL,1),(4711,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76202','4708','Ingresos de crédito a largo plazo otras partes asociadas',0,NULL,NULL,1),(4712,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76203','4708','Ingresos de crédito a largo plazo otras empresas',0,NULL,NULL,1),(4713,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7621','4707','Ingresos de créditos a corto plazo',0,NULL,NULL,1),(4714,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76210','4713','Ingresos de crédito a corto plazo empresas del grupo',0,NULL,NULL,1),(4715,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76211','4713','Ingresos de crédito a corto plazo empresas asociadas',0,NULL,NULL,1),(4716,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76212','4713','Ingresos de crédito a corto plazo otras partes asociadas',0,NULL,NULL,1),(4717,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','76213','4713','Ingresos de crédito a corto plazo otras empresas',0,NULL,NULL,1),(4718,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','763','4696','Beneficios por valorización de activos y pasivos financieros por su valor razonable',0,NULL,NULL,1),(4719,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','766','4696','Beneficios en participaciones y valores representativos de deuda',0,NULL,NULL,1),(4720,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7660','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo',0,NULL,NULL,1),(4721,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7661','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas',0,NULL,NULL,1),(4722,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7662','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas',0,NULL,NULL,1),(4723,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7663','4719','Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas',0,NULL,NULL,1),(4724,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7665','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo',0,NULL,NULL,1),(4725,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7666','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas',0,NULL,NULL,1),(4726,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7667','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas',0,NULL,NULL,1),(4727,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7668','4719','Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas',0,NULL,NULL,1),(4728,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','768','4696','Diferencias positivas de cambio',0,NULL,NULL,1),(4729,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','769','4696','Otros ingresos financieros',0,NULL,NULL,1),(4730,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','77','4007','Beneficios procedentes de activos no corrientes e ingresos excepcionales',0,NULL,NULL,1),(4731,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','770','4730','Beneficios procedentes del inmovilizado intangible',0,NULL,NULL,1),(4732,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','771','4730','Beneficios procedentes del inmovilizado material',0,NULL,NULL,1),(4733,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','772','4730','Beneficios procedentes de las inversiones inmobiliarias',0,NULL,NULL,1),(4734,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','773','4730','Beneficios procedentes de participaciones a largo plazo en partes vinculadas',0,NULL,NULL,1),(4735,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7733','4734','Beneficios procedentes de participaciones a largo plazo empresas del grupo',0,NULL,NULL,1),(4736,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7734','4734','Beneficios procedentes de participaciones a largo plazo empresas asociadas',0,NULL,NULL,1),(4737,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7735','4734','Beneficios procedentes de participaciones a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4738,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','775','4730','Beneficios por operaciones con obligaciones propias',0,NULL,NULL,1),(4739,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','778','4730','Ingresos excepcionales',0,NULL,NULL,1),(4741,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79','4007','Excesos y aplicaciones de provisiones y pérdidas por deterioro',0,NULL,NULL,1),(4742,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','790','4741','Revisión del deterioro del inmovilizado intangible',0,NULL,NULL,1),(4743,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','791','4741','Revisión del deterioro del inmovilizado material',0,NULL,NULL,1),(4744,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','792','4741','Revisión del deterioro de las inversiones inmobiliarias',0,NULL,NULL,1),(4745,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','793','4741','Revisión del deterioro de las existencias',0,NULL,NULL,1),(4746,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7930','4745','Revisión del deterioro de productos terminados y en curso de fabricación',0,NULL,NULL,1),(4747,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7931','4745','Revisión del deterioro de mercaderías',0,NULL,NULL,1),(4748,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7932','4745','Revisión del deterioro de materias primas',0,NULL,NULL,1),(4749,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7933','4745','Revisión del deterioro de otros aprovisionamientos',0,NULL,NULL,1),(4750,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','794','4741','Revisión del deterioro de créditos por operaciones comerciales',0,NULL,NULL,1),(4751,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','795','4741','Exceso de provisiones',0,NULL,NULL,1),(4752,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7951','4751','Exceso de provisión para impuestos',0,NULL,NULL,1),(4753,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7952','4751','Exceso de provisión para otras responsabilidades',0,NULL,NULL,1),(4755,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7954','4751','Exceso de provisión para operaciones comerciales',0,NULL,NULL,1),(4756,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79544','4755','Exceso de provisión por contratos onerosos',0,NULL,NULL,1),(4757,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','79549','4755','Exceso de provisión para otras operaciones comerciales',0,NULL,NULL,1),(4758,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7955','4751','Exceso de provisión para actuaciones medioambienteales',0,NULL,NULL,1),(4759,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','796','4741','Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo',0,NULL,NULL,1),(4760,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7960','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo',0,NULL,NULL,1),(4761,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7961','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas',0,NULL,NULL,1),(4762,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7962','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4763,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7963','4759','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas',0,NULL,NULL,1),(4764,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7965','4759','Revisión del deterioro de valores representativos a largo plazo empresas del grupo',0,NULL,NULL,1),(4765,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7966','4759','Revisión del deterioro de valores representativos a largo plazo empresas asociadas',0,NULL,NULL,1),(4766,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7967','4759','Revisión del deterioro de valores representativos a largo otras partes vinculadas',0,NULL,NULL,1),(4767,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7968','4759','Revisión del deterioro de valores representativos a largo plazo otras empresas',0,NULL,NULL,1),(4768,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','797','4741','Revisión del deterioro de créditos a largo plazo',0,NULL,NULL,1),(4769,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7970','4768','Revisión del deterioro de créditos a largo plazo empresas del grupo',0,NULL,NULL,1),(4770,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7971','4768','Revisión del deterioro de créditos a largo plazo empresas asociadas',0,NULL,NULL,1),(4771,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7972','4768','Revisión del deterioro de créditos a largo plazo otras partes vinculadas',0,NULL,NULL,1),(4772,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7973','4768','Revisión del deterioro de créditos a largo plazo otras empresas',0,NULL,NULL,1),(4773,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','798','4741','Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo',0,NULL,NULL,1),(4774,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7980','4773','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo',0,NULL,NULL,1),(4775,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7981','4773','Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas',0,NULL,NULL,1),(4776,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7985','4773','Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo',0,NULL,NULL,1),(4777,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7986','4773','Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas',0,NULL,NULL,1),(4778,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7987','4773','Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4779,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7988','4773','Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas',0,NULL,NULL,1),(4780,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','799','4741','Revisión del deterioro de créditos a corto plazo',0,NULL,NULL,1),(4781,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7990','4780','Revisión del deterioro de créditos a corto plazo empresas del grupo',0,NULL,NULL,1),(4782,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7991','4780','Revisión del deterioro de créditos a corto plazo empresas asociadas',0,NULL,NULL,1),(4783,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7992','4780','Revisión del deterioro de créditos a corto plazo otras partes vinculadas',0,NULL,NULL,1),(4784,1,NULL,'2016-01-22 17:28:16','PCG08-PYME','VENTAS_E_INGRESOS','XXXXXX','7993','4780','Revisión del deterioro de créditos a corto plazo otras empresas',0,NULL,NULL,1); +/*!40000 ALTER TABLE `llx_accounting_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accounting_bookkeeping` +-- + +DROP TABLE IF EXISTS `llx_accounting_bookkeeping`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_bookkeeping` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `doc_date` date NOT NULL, + `doc_type` varchar(30) NOT NULL, + `doc_ref` varchar(300) NOT NULL, + `fk_doc` int(11) NOT NULL, + `fk_docdet` int(11) NOT NULL, + `thirdparty_code` varchar(32) DEFAULT NULL, + `numero_compte` varchar(32) NOT NULL, + `label_compte` varchar(255) DEFAULT NULL, + `label_operation` varchar(255) DEFAULT NULL, + `debit` double(24,8) DEFAULT NULL, + `credit` double(24,8) DEFAULT NULL, + `montant` double(24,8) DEFAULT NULL, + `sens` varchar(1) DEFAULT NULL, + `multicurrency_amount` double(24,8) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `lettering_code` varchar(255) DEFAULT NULL, + `date_lettering` datetime DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + `code_journal` varchar(32) DEFAULT NULL, + `journal_label` varchar(255) DEFAULT NULL, + `piece_num` int(11) NOT NULL, + `validated` tinyint(4) NOT NULL DEFAULT '0', + `date_validated` datetime DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_user_modif` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `subledger_account` varchar(32) DEFAULT NULL, + `subledger_label` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_bookkeeping` +-- + +LOCK TABLES `llx_accounting_bookkeeping` WRITE; +/*!40000 ALTER TABLE `llx_accounting_bookkeeping` DISABLE KEYS */; +INSERT INTO `llx_accounting_bookkeeping` VALUES (2,'2017-02-19','','',0,0,NULL,'1','ttt',NULL,5.00000000,0.00000000,5.00000000,'D',NULL,NULL,NULL,NULL,12,NULL,'VTE',NULL,1,0,NULL,1,NULL,NULL,'2017-08-27 13:29:05','1',NULL),(4,'2017-02-19','','',0,0,NULL,'10','',NULL,0.00000000,5.00000000,5.00000000,'C',NULL,NULL,NULL,NULL,12,NULL,'VTE',NULL,1,0,NULL,1,NULL,NULL,'2017-08-27 13:29:05','10',NULL),(6,'2017-02-19','','',0,0,NULL,'NotDefined','',NULL,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL,NULL,12,NULL,'VTE',NULL,2,0,NULL,1,NULL,NULL,'2017-08-27 13:29:05','NotDefined',NULL),(9,'2017-02-19','','',0,0,NULL,'NotDefined','',NULL,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL,NULL,12,NULL,'VTE',NULL,3,0,NULL,1,NULL,NULL,'2017-08-27 13:29:05','NotDefined',NULL); +/*!40000 ALTER TABLE `llx_accounting_bookkeeping` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accounting_bookkeeping_tmp` +-- + +DROP TABLE IF EXISTS `llx_accounting_bookkeeping_tmp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_bookkeeping_tmp` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `doc_date` date NOT NULL, + `doc_type` varchar(30) COLLATE utf8_unicode_ci NOT NULL, + `doc_ref` varchar(300) COLLATE utf8_unicode_ci NOT NULL, + `fk_doc` int(11) NOT NULL, + `fk_docdet` int(11) NOT NULL, + `thirdparty_code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `subledger_account` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `subledger_label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `numero_compte` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `label_compte` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `label_operation` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `debit` double(24,8) NOT NULL, + `credit` double(24,8) NOT NULL, + `montant` double(24,8) NOT NULL, + `sens` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, + `multicurrency_amount` double(24,8) DEFAULT NULL, + `multicurrency_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `lettering_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `date_lettering` datetime DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + `code_journal` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `journal_label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `piece_num` int(11) NOT NULL, + `validated` tinyint(4) NOT NULL DEFAULT '0', + `date_validated` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_accounting_bookkeeping_doc_date` (`doc_date`), + KEY `idx_accounting_bookkeeping_fk_docdet` (`fk_docdet`), + KEY `idx_accounting_bookkeeping_numero_compte` (`numero_compte`), + KEY `idx_accounting_bookkeeping_code_journal` (`code_journal`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_bookkeeping_tmp` +-- + +LOCK TABLES `llx_accounting_bookkeeping_tmp` WRITE; +/*!40000 ALTER TABLE `llx_accounting_bookkeeping_tmp` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_accounting_bookkeeping_tmp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accounting_fiscalyear` +-- + +DROP TABLE IF EXISTS `llx_accounting_fiscalyear`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_fiscalyear` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(128) NOT NULL, + `date_start` date DEFAULT NULL, + `date_end` date DEFAULT NULL, + `statut` tinyint(4) NOT NULL DEFAULT '0', + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_fiscalyear` +-- + +LOCK TABLES `llx_accounting_fiscalyear` WRITE; +/*!40000 ALTER TABLE `llx_accounting_fiscalyear` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_accounting_fiscalyear` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accounting_journal` +-- + +DROP TABLE IF EXISTS `llx_accounting_journal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_journal` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(32) NOT NULL, + `label` varchar(128) NOT NULL, + `nature` smallint(6) NOT NULL DEFAULT '0', + `active` smallint(6) DEFAULT '0', + `entity` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_accounting_journal_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_journal` +-- + +LOCK TABLES `llx_accounting_journal` WRITE; +/*!40000 ALTER TABLE `llx_accounting_journal` DISABLE KEYS */; +INSERT INTO `llx_accounting_journal` VALUES (1,'VT','Sale journal',2,1,1),(2,'AC','Purchase journal',3,1,1),(3,'BQ','Bank journal',4,1,1),(4,'OD','Other journal',1,1,1),(5,'AN','Has new journal',9,1,1),(6,'ER','Expense report journal',5,1,1); +/*!40000 ALTER TABLE `llx_accounting_journal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_accounting_system` +-- + +DROP TABLE IF EXISTS `llx_accounting_system`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_accounting_system` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `pcg_version` varchar(32) DEFAULT NULL, + `label` varchar(128) NOT NULL, + `active` smallint(6) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_accounting_system_pcg_version` (`pcg_version`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_accounting_system` +-- + +LOCK TABLES `llx_accounting_system` WRITE; +/*!40000 ALTER TABLE `llx_accounting_system` DISABLE KEYS */; +INSERT INTO `llx_accounting_system` VALUES (1,'PCG99-ABREGE','The simple accountancy french plan',1),(2,'PCG99-BASE','The base accountancy french plan',1),(3,'PCMN-BASE','The base accountancy belgium plan',1),(4,'PCG08-PYME','The PYME accountancy spanish plan',1); +/*!40000 ALTER TABLE `llx_accounting_system` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm` +-- + +DROP TABLE IF EXISTS `llx_actioncomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ref_ext` varchar(128) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datep` datetime DEFAULT NULL, + `datep2` datetime DEFAULT NULL, + `fk_action` int(11) DEFAULT NULL, + `code` varchar(32) DEFAULT NULL, + `label` varchar(128) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `fk_project` int(11) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_parent` int(11) NOT NULL DEFAULT '0', + `fk_user_action` int(11) DEFAULT NULL, + `transparency` int(11) DEFAULT NULL, + `fk_user_done` int(11) DEFAULT NULL, + `priority` smallint(6) DEFAULT NULL, + `fulldayevent` smallint(6) NOT NULL DEFAULT '0', + `punctual` smallint(6) NOT NULL DEFAULT '1', + `percent` smallint(6) NOT NULL DEFAULT '0', + `location` varchar(128) DEFAULT NULL, + `durationp` double DEFAULT NULL, + `durationa` double DEFAULT NULL, + `note` text, + `fk_element` int(11) DEFAULT NULL, + `elementtype` varchar(255) DEFAULT NULL, + `email_msgid` varchar(256) DEFAULT NULL, + `email_subject` varchar(256) DEFAULT NULL, + `email_from` varchar(256) DEFAULT NULL, + `email_sender` varchar(256) DEFAULT NULL, + `email_to` varchar(256) DEFAULT NULL, + `email_tocc` varchar(256) DEFAULT NULL, + `email_tobcc` varchar(256) DEFAULT NULL, + `errors_to` varchar(256) DEFAULT NULL, + `recurid` varchar(128) DEFAULT NULL, + `recurrule` varchar(128) DEFAULT NULL, + `recurdateend` datetime DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx_actioncomm_fk_soc` (`fk_soc`), + KEY `idx_actioncomm_fk_contact` (`fk_contact`), + KEY `idx_actioncomm_fk_element` (`fk_element`), + KEY `idx_actioncomm_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=328 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm` +-- + +LOCK TABLES `llx_actioncomm` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm` DISABLE KEYS */; +INSERT INTO `llx_actioncomm` VALUES (1,NULL,1,'2010-07-08 14:21:44','2010-07-08 14:21:44',50,NULL,'Company AAA and Co added into Dolibarr','2010-07-08 14:21:44','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company AAA and Co added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,NULL,1,'2010-07-08 14:23:48','2010-07-08 14:23:48',50,NULL,'Company Belin SARL added into Dolibarr','2010-07-08 14:23:48','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Belin SARL added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,NULL,1,'2010-07-08 22:42:12','2010-07-08 22:42:12',50,NULL,'Company Spanish Comp added into Dolibarr','2010-07-08 22:42:12','2014-12-21 12:50:33',1,NULL,NULL,3,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Spanish Comp added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,NULL,1,'2010-07-08 22:48:18','2010-07-08 22:48:18',50,NULL,'Company Prospector Vaalen added into Dolibarr','2010-07-08 22:48:18','2014-12-21 12:50:33',1,NULL,NULL,4,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Prospector Vaalen added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,NULL,1,'2010-07-08 23:22:57','2010-07-08 23:22:57',50,NULL,'Company NoCountry Co added into Dolibarr','2010-07-08 23:22:57','2014-12-21 12:50:33',1,NULL,NULL,5,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company NoCountry Co added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,NULL,1,'2010-07-09 00:15:09','2010-07-09 00:15:09',50,NULL,'Company Swiss customer added into Dolibarr','2010-07-09 00:15:09','2014-12-21 12:50:33',1,NULL,NULL,6,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Swiss customer added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,NULL,1,'2010-07-09 01:24:26','2010-07-09 01:24:26',50,NULL,'Company Generic customer added into Dolibarr','2010-07-09 01:24:26','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Generic customer added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,NULL,1,'2010-07-10 14:54:27','2010-07-10 14:54:27',50,NULL,'Société Client salon ajoutée dans Dolibarr','2010-07-10 14:54:27','2014-12-21 12:50:33',1,NULL,NULL,8,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,NULL,1,'2010-07-10 14:54:44','2010-07-10 14:54:44',50,NULL,'Société Client salon invidivdu ajoutée dans Doliba','2010-07-10 14:54:44','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon invidivdu ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,NULL,1,'2010-07-10 14:56:10','2010-07-10 14:56:10',50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:56:10','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,NULL,1,'2010-07-10 14:58:53','2010-07-10 14:58:53',50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:58:53','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,NULL,1,'2010-07-10 15:00:55','2010-07-10 15:00:55',50,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr','2010-07-10 15:00:55','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,NULL,1,'2010-07-10 15:13:08','2010-07-10 15:13:08',50,NULL,'Société Smith Vick ajoutée dans Dolibarr','2010-07-10 15:13:08','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Smith Vick ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,NULL,1,'2010-07-10 15:21:00','2010-07-10 16:21:00',5,NULL,'RDV avec mon chef','2010-07-10 15:21:48','2010-07-10 13:21:48',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'',3600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,NULL,1,'2010-07-10 18:18:16','2010-07-10 18:18:16',50,NULL,'Contrat CONTRAT1 validé dans Dolibarr','2010-07-10 18:18:16','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Contrat CONTRAT1 validé dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,NULL,1,'2010-07-10 18:35:57','2010-07-10 18:35:57',50,NULL,'Société Mon client ajoutée dans Dolibarr','2010-07-10 18:35:57','2014-12-21 12:50:33',1,NULL,NULL,11,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Mon client ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,NULL,1,'2010-07-11 16:18:08','2010-07-11 16:18:08',50,NULL,'Société Dupont Alain ajoutée dans Dolibarr','2010-07-11 16:18:08','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Dupont Alain ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,NULL,1,'2010-07-11 17:11:00','2010-07-11 17:17:00',5,NULL,'Rendez-vous','2010-07-11 17:11:22','2010-07-11 15:11:22',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'gfgdfgdf',360,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,NULL,1,'2010-07-11 17:13:20','2010-07-11 17:13:20',50,NULL,'Société Vendeur de chips ajoutée dans Dolibarr','2010-07-11 17:13:20','2014-12-21 12:50:33',1,NULL,NULL,13,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Vendeur de chips ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,NULL,1,'2010-07-11 17:15:42','2010-07-11 17:15:42',50,NULL,'Commande CF1007-0001 validée','2010-07-11 17:15:42','2014-12-21 12:50:33',1,NULL,NULL,13,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0001 validée\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,NULL,1,'2010-07-11 18:47:33','2010-07-11 18:47:33',50,NULL,'Commande CF1007-0002 validée','2010-07-11 18:47:33','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0002 validée\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,NULL,1,'2010-07-18 11:36:18','2010-07-18 11:36:18',50,NULL,'Proposition PR1007-0003 validée','2010-07-18 11:36:18','2014-12-21 12:50:33',1,NULL,NULL,4,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Proposition PR1007-0003 validée\nAuteur: admin',3,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,NULL,1,'2011-07-18 20:49:58','2011-07-18 20:49:58',50,NULL,'Invoice FA1007-0002 validated in Dolibarr','2011-07-18 20:49:58','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 validated in Dolibarr\nAuthor: admin',2,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,NULL,1,'2011-07-28 01:37:00',NULL,1,NULL,'Phone call','2011-07-28 01:37:48','2011-07-27 23:37:48',1,NULL,NULL,NULL,2,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,NULL,1,'2011-08-01 02:31:24','2011-08-01 02:31:24',50,NULL,'Company mmm added into Dolibarr','2011-08-01 02:31:24','2014-12-21 12:50:33',1,NULL,NULL,15,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company mmm added into Dolibarr\nAuthor: admin',15,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,NULL,1,'2011-08-01 02:31:43','2011-08-01 02:31:43',50,NULL,'Company ppp added into Dolibarr','2011-08-01 02:31:43','2014-12-21 12:50:33',1,NULL,NULL,16,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ppp added into Dolibarr\nAuthor: admin',16,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,NULL,1,'2011-08-01 02:41:26','2011-08-01 02:41:26',50,NULL,'Company aaa added into Dolibarr','2011-08-01 02:41:26','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company aaa added into Dolibarr\nAuthor: admin',17,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 validated in Dolibarr\nAuthor: admin',5,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 changed to paid in Dolibarr\nAuthor: admin',5,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 validated in Dolibarr\nAuthor: admin',6,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 changed to paid in Dolibarr\nAuthor: admin',6,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,NULL,1,'2011-08-08 02:41:55','2011-08-08 02:41:55',50,NULL,'Invoice FA1108-0005 validated in Dolibarr','2011-08-08 02:41:55','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 validated in Dolibarr\nAuthor: admin',8,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(40,NULL,1,'2011-08-08 02:53:40','2011-08-08 02:53:40',50,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr','2011-08-08 02:53:40','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr\nAuthor: admin',8,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(41,NULL,1,'2011-08-08 02:54:05','2011-08-08 02:54:05',50,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr','2011-08-08 02:54:05','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr\nAuthor: admin',2,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(42,NULL,1,'2011-08-08 02:55:04','2011-08-08 02:55:04',50,NULL,'Invoice FA1107-0006 validated in Dolibarr','2011-08-08 02:55:04','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 validated in Dolibarr\nAuthor: admin',3,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(43,NULL,1,'2011-08-08 02:55:26','2011-08-08 02:55:26',50,NULL,'Invoice FA1108-0007 validated in Dolibarr','2011-08-08 02:55:26','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0007 validated in Dolibarr\nAuthor: admin',9,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(44,NULL,1,'2011-08-08 02:55:58','2011-08-08 02:55:58',50,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr','2011-08-08 02:55:58','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr\nAuthor: admin',3,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(45,NULL,1,'2011-08-08 03:04:22','2011-08-08 03:04:22',50,NULL,'Order CO1108-0001 validated','2011-08-08 03:04:22','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1108-0001 validated\nAuthor: admin',5,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(46,NULL,1,'2011-08-08 13:59:09','2011-08-08 13:59:09',50,NULL,'Order CO1107-0002 validated','2011-08-08 13:59:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1107-0002 validated\nAuthor: admin',1,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(47,NULL,1,'2011-08-08 14:24:18','2011-08-08 14:24:18',50,NULL,'Proposal PR1007-0001 validated','2011-08-08 14:24:18','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1007-0001 validated\nAuthor: admin',1,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(48,NULL,1,'2011-08-08 14:24:24','2011-08-08 14:24:24',50,NULL,'Proposal PR1108-0004 validated','2011-08-08 14:24:24','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1108-0004 validated\nAuthor: admin',4,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(49,NULL,1,'2011-08-08 15:04:37','2011-08-08 15:04:37',50,NULL,'Order CF1108-0003 validated','2011-08-08 15:04:37','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CF1108-0003 validated\nAuthor: admin',6,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(50,NULL,1,'2012-12-08 17:56:47','2012-12-08 17:56:47',40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:56:47','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(51,NULL,1,'2012-12-08 17:57:11','2012-12-08 17:57:11',40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:57:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(52,NULL,1,'2012-12-08 17:58:27','2012-12-08 17:58:27',40,NULL,'Facture FA1212-0008 validée dans Dolibarr','2012-12-08 17:58:27','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0008 validée dans Dolibarr\nAuteur: admin',11,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(53,NULL,1,'2012-12-08 18:20:49','2012-12-08 18:20:49',40,NULL,'Facture AV1212-0002 validée dans Dolibarr','2012-12-08 18:20:49','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 validée dans Dolibarr\nAuteur: admin',12,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(54,NULL,1,'2012-12-09 18:35:07','2012-12-09 18:35:07',40,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr','2012-12-09 18:35:07','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr\nAuteur: admin',12,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(55,NULL,1,'2012-12-09 20:14:42','2012-12-09 20:14:42',40,NULL,'Société doe john ajoutée dans Dolibarr','2012-12-09 20:14:42','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société doe john ajoutée dans Dolibarr\nAuteur: admin',18,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(56,NULL,1,'2012-12-12 18:54:19','2012-12-12 18:54:19',40,NULL,'Facture FA1212-0009 validée dans Dolibarr','2012-12-12 18:54:19','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0009 validée dans Dolibarr\nAuteur: admin',55,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(121,NULL,1,'2012-12-06 10:00:00',NULL,50,NULL,'aaab','2012-12-21 17:48:08','2012-12-21 16:54:07',3,1,NULL,NULL,NULL,0,3,NULL,NULL,1,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(122,NULL,1,'2012-12-21 18:09:52','2012-12-21 18:09:52',40,NULL,'Facture client FA1007-0001 envoyée par EMail','2012-12-21 18:09:52','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Mail envoyé par Firstname SuperAdminName à laurent@destailleur.fr.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2014-12-21 12:50:33',1,NULL,NULL,20,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2014-12-21 12:50:33',1,NULL,NULL,21,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,NULL,1,'2013-01-23 17:34:00',NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2014-12-21 12:50:33',1,1,NULL,7,NULL,0,1,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
        \r\nAuteur: admin',13,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2014-12-21 12:50:33',1,NULL,NULL,22,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2014-12-21 12:50:33',1,NULL,NULL,24,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2014-12-21 12:50:33',1,NULL,NULL,25,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2014-12-21 12:50:33',1,NULL,NULL,27,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2014-12-21 12:50:33',1,NULL,NULL,28,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2014-12-21 12:50:33',1,NULL,NULL,29,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2014-12-21 12:50:33',1,NULL,NULL,30,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2014-12-21 12:50:33',1,NULL,NULL,31,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2014-12-21 12:50:33',1,NULL,NULL,32,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2014-12-21 12:50:33',1,NULL,NULL,33,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,NULL,1,'2014-03-02 17:24:04','2014-03-02 17:24:04',40,'AC_BILL_VALIDATE','Invoice FA1302-0022 validated','2014-03-02 17:24:04','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1302-0022 validated\nAuthor: admin',157,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,NULL,1,'2014-03-02 17:24:28','2014-03-02 17:24:28',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 17:24:28','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,NULL,1,'2014-03-05 10:00:00','2014-03-05 10:00:00',5,NULL,'RDV John','2014-03-02 19:54:48','2014-03-02 18:55:29',1,1,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,NULL,NULL,NULL,'gfdgdfgdf',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(223,NULL,1,'2014-03-13 10:00:00','2014-03-17 00:00:00',50,NULL,'Congress','2014-03-02 19:55:11','2014-03-02 18:55:11',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,'',309600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,NULL,1,'2014-03-14 10:00:00',NULL,1,NULL,'Call john','2014-03-02 19:55:56','2014-03-02 18:55:56',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,0,'',NULL,NULL,'tttt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(225,NULL,1,'2014-03-02 20:11:31','2014-03-02 20:11:31',40,'AC_BILL_UNVALIDATE','Invoice FA1303-0020 go back to draft status','2014-03-02 20:11:31','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 go back to draft status\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,NULL,1,'2014-03-02 20:13:39','2014-03-02 20:13:39',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 20:13:39','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,NULL,1,'2014-03-03 19:20:10','2014-03-03 19:20:10',40,'AC_BILL_VALIDATE','Invoice FA1212-0023 validated','2014-03-03 19:20:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 validated\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(228,NULL,1,'2014-03-03 19:20:25','2014-03-03 19:20:25',40,'AC_BILL_CANCEL','Invoice FA1212-0023 canceled in Dolibarr','2014-03-03 19:20:25','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 canceled in Dolibarr\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(229,NULL,1,'2014-03-03 19:20:56','2014-03-03 19:20:56',40,'AC_BILL_VALIDATE','Invoice AV1403-0003 validated','2014-03-03 19:20:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 validated\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(230,NULL,1,'2014-03-03 19:21:29','2014-03-03 19:21:29',40,'AC_BILL_UNVALIDATE','Invoice AV1403-0003 go back to draft status','2014-03-03 19:21:29','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 go back to draft status\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(231,NULL,1,'2014-03-03 19:22:16','2014-03-03 19:22:16',40,'AC_BILL_VALIDATE','Invoice AV1303-0003 validated','2014-03-03 19:22:16','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1303-0003 validated\nAuthor: admin',213,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(232,NULL,1,'2016-01-22 18:54:39','2016-01-22 18:54:39',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:39','2016-01-22 17:54:39',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(233,NULL,1,'2016-01-22 18:54:46','2016-01-22 18:54:46',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:46','2016-01-22 17:54:46',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(234,NULL,1,'2016-07-05 10:00:00','2016-07-05 11:19:00',5,'AC_RDV','Meeting with my boss','2016-07-31 18:19:48','2016-07-31 14:19:48',12,NULL,NULL,NULL,NULL,0,12,1,NULL,0,0,1,-1,'',4740,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(235,NULL,1,'2016-07-13 00:00:00','2016-07-14 23:59:59',50,'AC_OTH','Trip at Las Vegas','2016-07-31 18:20:36','2016-07-31 14:20:36',12,NULL,4,NULL,2,0,12,1,NULL,0,1,1,-1,'',172799,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(236,NULL,1,'2016-07-29 10:00:00',NULL,4,'AC_EMAIL','Remind to send an email','2016-07-31 18:21:04','2016-07-31 14:21:04',12,NULL,NULL,NULL,NULL,0,4,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(237,NULL,1,'2016-07-01 10:00:00',NULL,1,'AC_TEL','Phone call with Mr Vaalen','2016-07-31 18:22:04','2016-07-31 14:22:04',12,NULL,6,4,NULL,0,13,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(238,NULL,1,'2016-08-02 10:00:00','2016-08-02 12:00:00',5,'AC_RDV','Meeting on radium','2016-08-01 01:15:50','2016-07-31 21:15:50',12,NULL,8,10,10,0,12,1,NULL,0,0,1,-1,'',7200,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(239,NULL,1,'2017-01-29 21:49:33','2017-01-29 21:49:33',40,'AC_OTH_AUTO','Proposal PR1302-0007 validated','2017-01-29 21:49:33','2017-01-29 17:49:33',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1302-0007 validated\nAuthor: admin',7,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(240,NULL,1,'2017-01-31 20:52:00',NULL,1,'AC_TEL','Call the boss','2017-01-31 20:52:10','2017-01-31 16:52:25',12,12,6,NULL,NULL,0,12,1,NULL,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(242,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 validated','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 validated\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(243,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 approved','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 approved\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(245,NULL,1,'2017-02-01 18:52:32','2017-02-01 18:52:32',40,'AC_OTH_AUTO','Supplier order CF1007-0001 submited','2017-02-01 18:52:32','2017-02-01 14:52:32',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 submited\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(249,NULL,1,'2017-02-01 18:54:01','2017-02-01 18:54:01',40,'AC_OTH_AUTO','Supplier order CF1007-0001 received','2017-02-01 18:54:01','2017-02-01 14:54:01',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 received \nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(250,NULL,1,'2017-02-01 18:54:42','2017-02-01 18:54:42',40,'AC_OTH_AUTO','Email sent by MyBigCompany To mycustomer@example.com','2017-02-01 18:54:42','2017-02-01 14:54:42',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
        \nReceiver(s): mycustomer@example.com
        \nEMail topic: Submission of order CF1007-0001
        \nEmail body:
        \nYou will find here our order CF1007-0001
        \r\n
        \r\nSincerely
        \n
        \nAttached files and documents: CF1007-0001.pdf',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(251,NULL,1,'2017-02-01 19:02:21','2017-02-01 19:02:21',40,'AC_OTH_AUTO','Invoice SI1702-0001 validated','2017-02-01 19:02:21','2017-02-01 15:02:21',12,NULL,5,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice SI1702-0001 validated\nAuthor: admin',20,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(252,NULL,1,'2017-02-12 23:17:04','2017-02-12 23:17:04',40,'AC_OTH_AUTO','Patient créé','2017-02-12 23:17:04','2017-02-12 19:17:04',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuthor: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(253,NULL,1,'2017-02-12 23:18:33','2017-02-12 23:18:33',40,'AC_OTH_AUTO','Consultation 2 recorded (aaa)','2017-02-12 23:18:33','2017-02-12 19:18:33',12,NULL,NULL,NULL,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Consultation 2 recorded (aaa)\nAuthor: admin',2,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(254,NULL,1,'2017-02-15 23:28:41','2017-02-15 23:28:41',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:28:41','2017-02-15 22:28:41',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,NULL,1,'2017-02-15 23:28:56','2017-02-15 23:28:56',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:28:56','2017-02-15 22:28:56',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',8,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(256,NULL,1,'2017-02-15 23:34:33','2017-02-15 23:34:33',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:34:33','2017-02-15 22:34:33',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',9,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,NULL,1,'2017-02-15 23:35:03','2017-02-15 23:35:03',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-15 23:35:03','2017-02-15 22:35:03',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',10,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(263,NULL,1,'2017-02-15 23:50:34','2017-02-15 23:50:34',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:50:34','2017-02-15 22:50:34',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',17,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(264,NULL,1,'2017-02-15 23:51:23','2017-02-15 23:51:23',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:51:23','2017-02-15 22:51:23',12,NULL,NULL,7,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',18,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(265,NULL,1,'2017-02-15 23:54:51','2017-02-15 23:54:51',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:54:51','2017-02-15 22:54:51',12,NULL,NULL,17,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',19,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(266,NULL,1,'2017-02-15 23:55:52','2017-02-15 23:55:52',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:55:52','2017-02-15 22:55:52',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',20,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(267,NULL,1,'2017-02-16 00:03:44','2017-02-16 00:03:44',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-16 00:03:44','2017-02-15 23:03:44',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',29,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(268,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0009 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0009 validated\nAuthor: admin',34,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(269,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0010 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0010 validated\nAuthor: admin',38,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(270,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0011 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0011 validated\nAuthor: admin',40,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0012 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0012 validated\nAuthor: admin',43,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(272,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0013 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0013 validated\nAuthor: admin',47,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0014 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0014 validated\nAuthor: admin',48,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(274,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0015 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0015 validated\nAuthor: admin',50,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(275,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0016 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0016 validated\nAuthor: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(277,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0018 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0018 validated\nAuthor: admin',62,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(278,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0019 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0019 validated\nAuthor: admin',68,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(279,NULL,1,'2017-02-16 00:05:36','2017-02-16 00:05:36',40,'AC_OTH_AUTO','Order CO7001-0020 validated','2017-02-16 00:05:36','2017-02-15 23:05:36',12,NULL,NULL,6,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0020 validated\nAuthor: admin',72,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(281,NULL,1,'2017-02-16 00:05:37','2017-02-16 00:05:37',40,'AC_OTH_AUTO','Order CO7001-0022 validated','2017-02-16 00:05:37','2017-02-15 23:05:37',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0022 validated\nAuthor: admin',78,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(282,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0023 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0023 validated\nAuthor: admin',81,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(283,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0024 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0024 validated\nAuthor: admin',83,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(284,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0025 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,2,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0025 validated\nAuthor: admin',84,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(285,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0026 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0026 validated\nAuthor: admin',85,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(286,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0027 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0027 validated\nAuthor: admin',88,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(287,NULL,1,'2017-02-16 03:05:56','2017-02-16 03:05:56',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Livrée','2017-02-16 03:05:56','2017-02-15 23:05:56',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Livrée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(288,NULL,1,'2017-02-16 03:06:01','2017-02-16 03:06:01',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Facturée','2017-02-16 03:06:01','2017-02-15 23:06:01',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Facturée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(294,NULL,1,'2017-02-16 03:53:04','2017-02-16 03:53:04',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 03:53:04','2017-02-15 23:53:04',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(295,NULL,1,'2017-02-16 03:58:08','2017-02-16 03:58:08',40,'AC_OTH_AUTO','Expédition SH1702-0002 validée','2017-02-16 03:58:08','2017-02-15 23:58:08',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Expédition SH1702-0002 validée\nAuteur: admin',3,'shipping',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(296,NULL,1,'2017-02-16 04:12:29','2017-02-16 04:12:29',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:12:29','2017-02-16 00:12:29',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(297,NULL,1,'2017-02-16 04:14:20','2017-02-16 04:14:20',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:14:20','2017-02-16 00:14:20',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(298,NULL,1,'2017-02-16 01:44:58','2017-02-16 01:44:58',40,'AC_OTH_AUTO','Proposal PR1702-0009 validated','2017-02-16 01:44:58','2017-02-16 00:44:58',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0009 validated\nAuthor: aeinstein',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(299,NULL,1,'2017-02-16 01:45:44','2017-02-16 01:45:44',40,'AC_OTH_AUTO','Proposal PR1702-0010 validated','2017-02-16 01:45:44','2017-02-16 00:45:44',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0010 validated\nAuthor: demo',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(300,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0011 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0011 validated\nAuthor: aeinstein',13,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(301,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0012 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,3,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0012 validated\nAuthor: demo',14,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(302,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0013 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0013 validated\nAuthor: demo',15,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(303,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0014 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0014 validated\nAuthor: demo',16,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(304,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0015 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0015 validated\nAuthor: aeinstein',17,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(305,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0016 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0016 validated\nAuthor: demo',18,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(306,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0017 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0017 validated\nAuthor: demo',19,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(307,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0018 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0018 validated\nAuthor: aeinstein',20,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(308,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0019 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0019 validated\nAuthor: aeinstein',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(309,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0020 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0020 validated\nAuthor: aeinstein',22,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(310,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0021 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0021 validated\nAuthor: demo',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(311,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0022 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0022 validated\nAuthor: demo',24,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(312,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0023 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',1,NULL,NULL,3,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0023 validated\nAuthor: aeinstein',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(313,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0024 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0024 validated\nAuthor: demo',26,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(314,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0025 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,6,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0025 validated\nAuthor: aeinstein',27,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(315,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0026 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0026 validated\nAuthor: demo',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(316,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0027 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0027 validated\nAuthor: demo',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(317,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0028 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0028 validated\nAuthor: demo',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(318,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0029 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,11,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0029 validated\nAuthor: aeinstein',31,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(319,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0030 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0030 validated\nAuthor: demo',32,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(320,NULL,1,'2017-02-16 04:46:31','2017-02-16 04:46:31',40,'AC_OTH_AUTO','Proposition PR1702-0026 signée','2017-02-16 04:46:31','2017-02-16 00:46:31',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0026 signée\nAuteur: admin',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(321,NULL,1,'2017-02-16 04:46:37','2017-02-16 04:46:37',40,'AC_OTH_AUTO','Proposition PR1702-0027 signée','2017-02-16 04:46:37','2017-02-16 00:46:37',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0027 signée\nAuteur: admin',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(322,NULL,1,'2017-02-16 04:46:42','2017-02-16 04:46:42',40,'AC_OTH_AUTO','Proposition PR1702-0028 refusée','2017-02-16 04:46:42','2017-02-16 00:46:42',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0028 refusée\nAuteur: admin',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(323,NULL,1,'2017-02-16 04:47:09','2017-02-16 04:47:09',40,'AC_OTH_AUTO','Proposition PR1702-0019 validée','2017-02-16 04:47:09','2017-02-16 00:47:09',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0019 validée\nAuteur: admin',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(324,NULL,1,'2017-02-16 04:47:25','2017-02-16 04:47:25',40,'AC_OTH_AUTO','Proposition PR1702-0023 signée','2017-02-16 04:47:25','2017-02-16 00:47:25',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 signée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(325,NULL,1,'2017-02-16 04:47:29','2017-02-16 04:47:29',40,'AC_OTH_AUTO','Proposition PR1702-0023 classée payée','2017-02-16 04:47:29','2017-02-16 00:47:29',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 classée payée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(326,NULL,1,'2017-02-17 16:07:18','2017-02-17 16:07:18',40,'AC_OTH_AUTO','Proposition PR1702-0021 validée','2017-02-17 16:07:18','2017-02-17 12:07:18',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0021 validée\nAuteur: admin',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(327,NULL,1,'2017-05-12 13:53:44','2017-05-12 13:53:44',40,'AC_OTH_AUTO','Email sent by MyBigCompany To Einstein','2017-05-12 13:53:44','2017-05-12 09:53:44',12,NULL,NULL,11,12,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
        \nReceiver(s): Einstein <genius@example.com>
        \nBcc: Einstein <genius@example.com>
        \nEMail topic: Test
        \nEmail body:
        \nTest\nAuthor: admin',11,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_actioncomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm_extrafields` +-- + +DROP TABLE IF EXISTS `llx_actioncomm_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_actioncomm_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm_extrafields` +-- + +LOCK TABLES `llx_actioncomm_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_actioncomm_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_actioncomm_resources` +-- + +DROP TABLE IF EXISTS `llx_actioncomm_resources`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_actioncomm_resources` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_actioncomm` int(11) NOT NULL, + `element_type` varchar(50) NOT NULL, + `fk_element` int(11) NOT NULL, + `answer_status` varchar(50) DEFAULT NULL, + `mandatory` smallint(6) DEFAULT NULL, + `transparency` smallint(6) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_actioncomm_resources` (`fk_actioncomm`,`element_type`,`fk_element`), + KEY `idx_actioncomm_resources_fk_element` (`fk_element`) +) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_actioncomm_resources` +-- + +LOCK TABLES `llx_actioncomm_resources` WRITE; +/*!40000 ALTER TABLE `llx_actioncomm_resources` DISABLE KEYS */; +INSERT INTO `llx_actioncomm_resources` VALUES (1,1,'user',1,NULL,NULL,1),(2,2,'user',1,NULL,NULL,1),(3,3,'user',1,NULL,NULL,1),(4,4,'user',1,NULL,NULL,1),(5,5,'user',1,NULL,NULL,1),(6,6,'user',1,NULL,NULL,1),(7,7,'user',1,NULL,NULL,1),(8,8,'user',1,NULL,NULL,1),(9,9,'user',1,NULL,NULL,1),(10,10,'user',1,NULL,NULL,1),(11,11,'user',1,NULL,NULL,1),(12,12,'user',1,NULL,NULL,1),(13,13,'user',1,NULL,NULL,1),(14,14,'user',1,NULL,NULL,1),(15,15,'user',1,NULL,NULL,1),(16,16,'user',1,NULL,NULL,1),(17,17,'user',1,NULL,NULL,1),(18,18,'user',1,NULL,NULL,1),(19,19,'user',1,NULL,NULL,1),(20,20,'user',1,NULL,NULL,1),(21,21,'user',1,NULL,NULL,1),(22,22,'user',1,NULL,NULL,1),(23,23,'user',1,NULL,NULL,1),(24,24,'user',1,NULL,NULL,1),(25,25,'user',1,NULL,NULL,1),(26,26,'user',1,NULL,NULL,1),(27,27,'user',1,NULL,NULL,1),(28,28,'user',1,NULL,NULL,1),(29,29,'user',1,NULL,NULL,1),(30,30,'user',1,NULL,NULL,1),(31,31,'user',1,NULL,NULL,1),(32,38,'user',1,NULL,NULL,1),(33,40,'user',1,NULL,NULL,1),(34,41,'user',1,NULL,NULL,1),(35,42,'user',1,NULL,NULL,1),(36,43,'user',1,NULL,NULL,1),(37,44,'user',1,NULL,NULL,1),(38,45,'user',1,NULL,NULL,1),(39,46,'user',1,NULL,NULL,1),(40,47,'user',1,NULL,NULL,1),(41,48,'user',1,NULL,NULL,1),(42,49,'user',1,NULL,NULL,1),(43,50,'user',1,NULL,NULL,1),(44,51,'user',1,NULL,NULL,1),(45,52,'user',1,NULL,NULL,1),(46,53,'user',1,NULL,NULL,1),(47,54,'user',1,NULL,NULL,1),(48,55,'user',1,NULL,NULL,1),(49,56,'user',1,NULL,NULL,1),(50,121,'user',3,NULL,NULL,1),(51,122,'user',1,NULL,NULL,1),(52,123,'user',1,NULL,NULL,1),(53,124,'user',1,NULL,NULL,1),(54,125,'user',1,NULL,NULL,1),(55,127,'user',1,NULL,NULL,1),(56,128,'user',1,NULL,NULL,1),(57,129,'user',1,NULL,NULL,1),(58,130,'user',1,NULL,NULL,1),(59,131,'user',1,NULL,NULL,1),(60,132,'user',1,NULL,NULL,1),(61,133,'user',1,NULL,NULL,1),(62,134,'user',1,NULL,NULL,1),(63,135,'user',1,NULL,NULL,1),(64,136,'user',1,NULL,NULL,1),(65,137,'user',1,NULL,NULL,1),(66,138,'user',1,NULL,NULL,1),(67,139,'user',1,NULL,NULL,1),(68,140,'user',1,NULL,NULL,1),(69,141,'user',1,NULL,NULL,1),(70,142,'user',1,NULL,NULL,1),(71,143,'user',1,NULL,NULL,1),(72,144,'user',1,NULL,NULL,1),(73,145,'user',1,NULL,NULL,1),(74,146,'user',1,NULL,NULL,1),(75,147,'user',1,NULL,NULL,1),(76,148,'user',1,NULL,NULL,1),(77,149,'user',1,NULL,NULL,1),(78,150,'user',1,NULL,NULL,1),(79,151,'user',1,NULL,NULL,1),(80,152,'user',1,NULL,NULL,1),(81,203,'user',1,NULL,NULL,1),(82,204,'user',1,NULL,NULL,1),(83,205,'user',1,NULL,NULL,1),(84,206,'user',1,NULL,NULL,1),(85,207,'user',1,NULL,NULL,1),(86,208,'user',1,NULL,NULL,1),(87,209,'user',1,NULL,NULL,1),(88,210,'user',1,NULL,NULL,1),(89,211,'user',1,NULL,NULL,1),(90,212,'user',1,NULL,NULL,1),(91,213,'user',1,NULL,NULL,1),(92,214,'user',1,NULL,NULL,1),(93,215,'user',1,NULL,NULL,1),(94,216,'user',1,NULL,NULL,1),(95,217,'user',1,NULL,NULL,1),(96,218,'user',1,NULL,NULL,1),(97,219,'user',1,NULL,NULL,1),(98,220,'user',1,NULL,NULL,1),(99,221,'user',1,NULL,NULL,1),(100,222,'user',1,NULL,NULL,1),(101,223,'user',1,NULL,NULL,1),(102,224,'user',1,NULL,NULL,1),(103,225,'user',1,NULL,NULL,1),(104,226,'user',1,NULL,NULL,1),(105,227,'user',1,NULL,NULL,1),(106,228,'user',1,NULL,NULL,1),(107,229,'user',1,NULL,NULL,1),(108,230,'user',1,NULL,NULL,1),(109,231,'user',1,NULL,NULL,1),(110,232,'user',12,'0',0,0),(111,233,'user',12,'0',0,0),(112,234,'user',12,'0',0,1),(113,235,'user',12,'0',0,1),(114,236,'user',4,'0',0,0),(115,237,'user',13,'0',0,0),(116,237,'user',16,'0',0,0),(117,237,'user',18,'0',0,0),(118,238,'user',12,'0',0,1),(119,238,'user',3,'0',0,1),(120,238,'user',10,'0',0,1),(121,239,'user',12,'0',0,0),(123,240,'user',12,'0',0,1),(125,242,'user',12,'0',0,0),(126,243,'user',12,'0',0,0),(128,245,'user',12,'0',0,0),(132,249,'user',12,'0',0,0),(133,250,'user',12,'0',0,0),(134,251,'user',12,'0',0,0),(135,252,'user',12,'0',0,0),(136,253,'user',12,'0',0,0),(137,254,'user',12,'0',0,0),(138,255,'user',12,'0',0,0),(139,256,'user',12,'0',0,0),(140,257,'user',12,'0',0,0),(146,263,'user',12,'0',0,0),(147,264,'user',12,'0',0,0),(148,265,'user',12,'0',0,0),(149,266,'user',12,'0',0,0),(150,267,'user',12,'0',0,0),(151,268,'user',12,'0',0,0),(152,269,'user',12,'0',0,0),(153,270,'user',12,'0',0,0),(154,271,'user',12,'0',0,0),(155,272,'user',12,'0',0,0),(156,273,'user',12,'0',0,0),(157,274,'user',12,'0',0,0),(158,275,'user',12,'0',0,0),(160,277,'user',12,'0',0,0),(161,278,'user',12,'0',0,0),(162,279,'user',12,'0',0,0),(164,281,'user',12,'0',0,0),(165,282,'user',12,'0',0,0),(166,283,'user',12,'0',0,0),(167,284,'user',12,'0',0,0),(168,285,'user',12,'0',0,0),(169,286,'user',12,'0',0,0),(170,287,'user',12,'0',0,0),(171,288,'user',12,'0',0,0),(177,294,'user',12,'0',0,0),(178,295,'user',12,'0',0,0),(179,296,'user',12,'0',0,0),(180,297,'user',12,'0',0,0),(181,298,'user',1,'0',0,0),(182,299,'user',2,'0',0,0),(183,300,'user',1,'0',0,0),(184,301,'user',2,'0',0,0),(185,302,'user',2,'0',0,0),(186,303,'user',2,'0',0,0),(187,304,'user',1,'0',0,0),(188,305,'user',2,'0',0,0),(189,306,'user',2,'0',0,0),(190,307,'user',1,'0',0,0),(191,308,'user',1,'0',0,0),(192,309,'user',1,'0',0,0),(193,310,'user',2,'0',0,0),(194,311,'user',2,'0',0,0),(195,312,'user',1,'0',0,0),(196,313,'user',2,'0',0,0),(197,314,'user',1,'0',0,0),(198,315,'user',2,'0',0,0),(199,316,'user',2,'0',0,0),(200,317,'user',2,'0',0,0),(201,318,'user',1,'0',0,0),(202,319,'user',2,'0',0,0),(203,320,'user',12,'0',0,0),(204,321,'user',12,'0',0,0),(205,322,'user',12,'0',0,0),(206,323,'user',12,'0',0,0),(207,324,'user',12,'0',0,0),(208,325,'user',12,'0',0,0),(209,326,'user',12,'0',0,0),(210,327,'user',12,'0',0,0); +/*!40000 ALTER TABLE `llx_actioncomm_resources` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent` +-- + +DROP TABLE IF EXISTS `llx_adherent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `civility` varchar(6) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `login` varchar(50) DEFAULT NULL, + `pass` varchar(50) DEFAULT NULL, + `pass_crypted` varchar(128) DEFAULT NULL, + `fk_adherent_type` int(11) NOT NULL, + `morphy` varchar(3) NOT NULL, + `societe` varchar(128) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `address` text, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `state_id` int(11) DEFAULT NULL, + `country` int(11) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `phone` varchar(30) DEFAULT NULL, + `phone_perso` varchar(30) DEFAULT NULL, + `phone_mobile` varchar(30) DEFAULT NULL, + `birth` date DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `public` smallint(6) NOT NULL DEFAULT '0', + `datefin` datetime DEFAULT NULL, + `note_private` text, + `note_public` text, + `datevalid` datetime DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_adherent_login` (`login`,`entity`), + UNIQUE KEY `uk_adherent_fk_soc` (`fk_soc`), + KEY `idx_adherent_fk_adherent_type` (`fk_adherent_type`), + CONSTRAINT `adherent_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_adherent_adherent_type` FOREIGN KEY (`fk_adherent_type`) REFERENCES `llx_adherent_type` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent` +-- + +LOCK TABLES `llx_adherent` WRITE; +/*!40000 ALTER TABLE `llx_adherent` DISABLE KEYS */; +INSERT INTO `llx_adherent` VALUES (1,1,NULL,NULL,'Smith','Vick','vsmith','vsx1n8tf',NULL,2,'phy',NULL,10,NULL,NULL,NULL,NULL,102,'vsmith@email.com',NULL,NULL,NULL,NULL,'1960-07-07',NULL,1,0,'2012-07-09 00:00:00',NULL,NULL,'2010-07-10 15:12:56','2010-07-08 23:50:00','2013-03-20 13:30:11',1,1,1,NULL,NULL,NULL),(2,1,NULL,NULL,'Curie','Pierre','pcurie','pcuriedolibarr',NULL,2,'phy',NULL,12,NULL,NULL,NULL,NULL,1,'pcurie@example.com','',NULL,NULL,NULL,'1972-07-08',NULL,1,1,'2017-07-17 00:00:00',NULL,NULL,'2010-07-10 15:03:32','2010-07-10 15:03:09','2015-10-05 19:57:57',1,12,1,NULL,NULL,NULL),(3,1,NULL,NULL,'john','doe','john','8bs6gty5',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,1,'johndoe@email.com',NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,NULL,'2011-07-18 21:28:00','2011-07-18 21:10:09','2015-10-03 09:28:46',1,1,1,NULL,NULL,NULL),(4,1,NULL,NULL,'smith','smith','Smith','s6hjp10f',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,11,'smith@email.com',NULL,NULL,NULL,NULL,NULL,NULL,1,0,NULL,NULL,NULL,'2011-07-18 21:27:52','2011-07-18 21:27:44','2015-10-03 09:40:27',1,1,1,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_adherent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_extrafields` +-- + +DROP TABLE IF EXISTS `llx_adherent_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `zzz` varchar(125) DEFAULT NULL, + `aaa` varchar(255) DEFAULT NULL, + `sssss` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_adherent_options` (`fk_object`), + KEY `idx_adherent_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=64 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_extrafields` +-- + +LOCK TABLES `llx_adherent_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_adherent_extrafields` DISABLE KEYS */; +INSERT INTO `llx_adherent_extrafields` VALUES (62,'2011-07-18 19:10:09',3,NULL,NULL,NULL,NULL),(63,'2011-07-18 19:27:44',4,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_adherent_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_type` +-- + +DROP TABLE IF EXISTS `llx_adherent_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `statut` smallint(6) NOT NULL DEFAULT '0', + `libelle` varchar(50) NOT NULL, + `subscription` varchar(3) NOT NULL DEFAULT '1', + `vote` varchar(3) NOT NULL DEFAULT 'yes', + `note` text, + `mail_valid` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_adherent_type_libelle` (`libelle`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_type` +-- + +LOCK TABLES `llx_adherent_type` WRITE; +/*!40000 ALTER TABLE `llx_adherent_type` DISABLE KEYS */; +INSERT INTO `llx_adherent_type` VALUES (1,1,'2010-07-08 21:41:55',1,'Board members','1','1','','
        '),(2,1,'2010-07-08 21:41:43',1,'Standard members','1','0','','
        '); +/*!40000 ALTER TABLE `llx_adherent_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_adherent_type_extrafields` +-- + +DROP TABLE IF EXISTS `llx_adherent_type_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_adherent_type_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_adherent_type_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_adherent_type_extrafields` +-- + +LOCK TABLES `llx_adherent_type_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_adherent_type_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_adherent_type_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_advtargetemailing` +-- + +DROP TABLE IF EXISTS `llx_advtargetemailing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_advtargetemailing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(200) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_mailing` int(11) NOT NULL, + `filtervalue` text, + `fk_user_author` int(11) NOT NULL, + `datec` datetime NOT NULL, + `fk_user_mod` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_advtargetemailing_name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_advtargetemailing` +-- + +LOCK TABLES `llx_advtargetemailing` WRITE; +/*!40000 ALTER TABLE `llx_advtargetemailing` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_advtargetemailing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank` +-- + +DROP TABLE IF EXISTS `llx_bank`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datev` date DEFAULT NULL, + `dateo` date DEFAULT NULL, + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `label` varchar(255) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_rappro` int(11) DEFAULT NULL, + `fk_type` varchar(6) DEFAULT NULL, + `num_releve` varchar(50) DEFAULT NULL, + `num_chq` varchar(50) DEFAULT NULL, + `rappro` tinyint(4) DEFAULT '0', + `note` text, + `fk_bordereau` int(11) DEFAULT '0', + `banque` varchar(255) DEFAULT NULL, + `emetteur` varchar(255) DEFAULT NULL, + `author` varchar(40) DEFAULT NULL, + `numero_compte` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_bank_datev` (`datev`), + KEY `idx_bank_dateo` (`dateo`), + KEY `idx_bank_fk_account` (`fk_account`), + KEY `idx_bank_rappro` (`rappro`), + KEY `idx_bank_num_releve` (`num_releve`) +) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank` +-- + +LOCK TABLES `llx_bank` WRITE; +/*!40000 ALTER TABLE `llx_bank` DISABLE KEYS */; +INSERT INTO `llx_bank` VALUES (1,'2010-07-08 23:56:14','2016-07-30 15:16:10','2016-07-08','2016-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(2,'2010-07-09 00:00:24','2016-07-30 15:16:10','2016-07-09','2016-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(3,'2010-07-10 13:33:42','2016-07-30 15:16:10','2016-07-10','2016-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(5,'2011-07-18 20:50:24','2016-07-30 15:16:10','2016-07-08','2016-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(6,'2011-07-18 20:50:47','2016-07-30 15:16:10','2016-07-08','2016-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(8,'2011-08-01 03:34:11','2016-07-30 15:21:31','2015-08-01','2015-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(12,'2011-08-05 23:11:37','2016-07-30 15:21:31','2015-08-05','2015-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(13,'2011-08-06 20:33:54','2016-07-30 15:21:31','2015-08-06','2015-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(14,'2011-08-08 02:53:40','2016-07-30 15:21:31','2015-08-08','2015-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(15,'2011-08-08 02:55:58','2016-07-30 15:21:31','2015-08-08','2015-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(16,'2012-12-09 15:28:44','2016-07-30 15:21:31','2015-12-09','2015-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(17,'2012-12-09 15:28:53','2016-07-30 15:21:31','2015-12-09','2015-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(18,'2012-12-09 17:35:55','2016-07-30 15:21:31','2015-12-09','2015-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(19,'2012-12-09 17:37:02','2016-07-30 15:21:31','2015-12-09','2015-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(20,'2012-12-09 18:35:07','2016-07-30 15:21:31','2015-12-09','2015-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(21,'2012-12-12 18:54:33','2016-07-30 15:21:31','2015-12-12','2015-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL),(22,'2013-03-06 16:48:16','2016-07-30 15:16:10','2016-03-06','2016-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(23,'2013-03-20 14:30:11','2016-07-30 15:16:10','2016-03-20','2016-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(24,'2014-03-02 19:57:58','2016-07-30 15:16:10','2016-07-09','2016-07-09',605.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'111',NULL,NULL),(26,'2014-03-02 20:01:39','2016-07-30 15:16:10','2016-03-19','2016-03-19',500.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(27,'2014-03-02 20:02:06','2016-07-30 15:16:10','2016-03-21','2016-03-21',400.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'ABC and Co',NULL,NULL),(28,'2014-03-03 19:22:32','2016-07-30 15:21:31','2015-10-03','2015-10-03',-400.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(29,'2014-03-03 19:23:16','2016-07-30 15:16:10','2016-03-10','2016-03-10',-300.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(30,'2016-01-22 18:56:34','2016-01-22 17:56:34','2016-01-22','2016-01-22',-900.00000000,'(SupplierInvoicePayment)',1,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(31,'2016-07-30 22:42:14','2016-07-30 14:42:14','2016-07-30','2016-07-30',0.00000000,'(Initial balance)',4,0,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(32,'2017-02-01 19:02:44','2017-02-01 15:02:44','2017-02-01','2017-02-01',-200.00000000,'(SupplierInvoicePayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(33,'2017-02-06 08:10:24','2017-02-06 04:12:05','2016-03-22','2016-03-22',150.00000000,'(CustomerInvoicePayment)',1,12,NULL,'CHQ',NULL,NULL,0,NULL,2,NULL,'Magic Food Store',NULL,NULL),(34,'2017-02-06 08:10:50','2017-02-06 04:10:50','2016-03-25','2016-03-25',140.00000000,'(CustomerInvoicePayment)',1,12,NULL,'PRE',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(35,'2017-02-12 23:18:33','2017-02-12 19:18:33','2017-02-12','2017-02-12',50.00000000,'Patient payment',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'aaa',NULL,NULL),(36,'2017-02-16 02:22:09','2017-02-15 22:22:09','2017-02-16','2017-02-16',-1.00000000,'(ExpenseReportPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL),(37,'2017-02-21 16:07:43','2017-02-21 12:07:43','2017-02-21','2017-02-21',50.00000000,'(WithdrawalPayment)',1,12,NULL,'PRE',NULL,'T170201',0,NULL,0,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_bank` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_account` +-- + +DROP TABLE IF EXISTS `llx_bank_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_account` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(12) NOT NULL, + `label` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `bank` varchar(60) DEFAULT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(11) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `country_iban` varchar(2) DEFAULT NULL, + `cle_iban` varchar(2) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `state_id` int(11) DEFAULT NULL, + `fk_pays` int(11) NOT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` text, + `courant` smallint(6) NOT NULL DEFAULT '0', + `clos` smallint(6) NOT NULL DEFAULT '0', + `rappro` smallint(6) DEFAULT '1', + `url` varchar(128) DEFAULT NULL, + `account_number` varchar(32) DEFAULT NULL, + `accountancy_journal` varchar(16) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `min_allowed` int(11) DEFAULT '0', + `min_desired` int(11) DEFAULT '0', + `comment` text, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_accountancy_journal` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bank_account_label` (`label`,`entity`), + KEY `idx_fk_accountancy_journal` (`fk_accountancy_journal`), + CONSTRAINT `fk_bank_account_accountancy_journal` FOREIGN KEY (`fk_accountancy_journal`) REFERENCES `llx_accounting_journal` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_account` +-- + +LOCK TABLES `llx_bank_account` WRITE; +/*!40000 ALTER TABLE `llx_bank_account` DISABLE KEYS */; +INSERT INTO `llx_bank_account` VALUES (1,'2010-07-08 23:56:14','2016-07-30 14:45:12','SWIBAC','Swiss bank account',1,'Switz Gold Bank','','','123456789','','','NL39RABO0314043352',NULL,NULL,'21 jum street',NULL,6,'Mac Golder','11 big road,\r\nZurich',1,0,1,NULL,'','','EUR',1500,1500,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'2010-07-09 00:00:24','2016-07-30 15:17:18','SWIBAC2','Swiss bank account old',1,'Switz Silver Bank','','','','','','NL07SNSB0908534915',NULL,NULL,'Road bankrupt\r\nZurich',NULL,6,'','',1,1,1,NULL,'','','EUR',200,400,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'2010-07-10 13:33:42','2017-08-27 13:29:05','ACCOUNTCASH','Account for cash',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,1,NULL,NULL,2,0,1,NULL,'','OD','EUR',0,0,'
        ',NULL,NULL,NULL,NULL,NULL,NULL,4),(4,'2016-07-30 18:42:14','2016-07-30 14:44:45','LUXBAC','Luxemburg Bank Account',1,'Lux Platinuium Bank','','','','','','NL46INGB0687674581',NULL,NULL,'',NULL,140,'','',1,0,1,NULL,'','','EUR',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_bank_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_account_extrafields` +-- + +DROP TABLE IF EXISTS `llx_bank_account_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_account_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_bank_account_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_account_extrafields` +-- + +LOCK TABLES `llx_bank_account_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_bank_account_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bank_account_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_categ` +-- + +DROP TABLE IF EXISTS `llx_bank_categ`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_categ` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_categ` +-- + +LOCK TABLES `llx_bank_categ` WRITE; +/*!40000 ALTER TABLE `llx_bank_categ` DISABLE KEYS */; +INSERT INTO `llx_bank_categ` VALUES (1,'Bank category one',1),(2,'Bank category two',1); +/*!40000 ALTER TABLE `llx_bank_categ` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_class` +-- + +DROP TABLE IF EXISTS `llx_bank_class`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_class` ( + `lineid` int(11) NOT NULL, + `fk_categ` int(11) NOT NULL, + UNIQUE KEY `uk_bank_class_lineid` (`lineid`,`fk_categ`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_class` +-- + +LOCK TABLES `llx_bank_class` WRITE; +/*!40000 ALTER TABLE `llx_bank_class` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_bank_class` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bank_url` +-- + +DROP TABLE IF EXISTS `llx_bank_url`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bank_url` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_bank` int(11) DEFAULT NULL, + `url_id` int(11) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `type` varchar(24) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bank_url` (`fk_bank`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bank_url` +-- + +LOCK TABLES `llx_bank_url` WRITE; +/*!40000 ALTER TABLE `llx_bank_url` DISABLE KEYS */; +INSERT INTO `llx_bank_url` VALUES (3,5,2,'/compta/paiement/card.php?id=','(paiement)','payment'),(4,5,2,'/comm/card.php?socid=','Belin SARL','company'),(5,6,3,'/compta/paiement/card.php?id=','(paiement)','payment'),(6,6,2,'/comm/card.php?socid=','Belin SARL','company'),(9,8,5,'/compta/paiement/card.php?id=','(paiement)','payment'),(10,8,7,'/comm/card.php?socid=','Generic customer','company'),(17,12,4,'/compta/payment_sc/card.php?id=','(paiement)','payment_sc'),(18,12,4,'/compta/charges.php?id=','Assurance Chomage (fff)','sc'),(19,13,6,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(20,13,7,'/dolibarrnew/comm/card.php?socid=','Generic customer','company'),(21,14,8,'/compta/paiement/card.php?id=','(paiement)','payment'),(22,14,2,'/comm/card.php?socid=','Belin SARL','company'),(23,15,9,'/compta/paiement/card.php?id=','(paiement)','payment'),(24,15,10,'/comm/card.php?socid=','Smith Vick','company'),(25,16,17,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(26,16,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(27,17,18,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(28,17,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(29,18,19,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(30,18,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(31,19,20,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(32,19,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(33,20,21,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(34,20,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(35,21,23,'/compta/paiement/card.php?id=','(paiement)','payment'),(36,21,1,'/comm/card.php?socid=','ABC and Co','company'),(37,22,24,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(38,22,12,'/dolibarrnew/comm/card.php?socid=','Dupont Alain','company'),(39,23,25,'/dolibarrnew/compta/paiement/card.php?id=','(paiement)','payment'),(40,23,10,'/dolibarrnew/comm/card.php?socid=','Smith Vick','company'),(41,24,26,'/compta/paiement/card.php?id=','(paiement)','payment'),(42,24,1,'/comm/card.php?socid=','ABC and Co','company'),(45,26,29,'/compta/paiement/card.php?id=','(paiement)','payment'),(46,26,1,'/comm/card.php?socid=','ABC and Co','company'),(47,27,30,'/compta/paiement/card.php?id=','(paiement)','payment'),(48,27,1,'/comm/card.php?socid=','ABC and Co','company'),(49,28,32,'/dolibarr_new/compta/paiement/card.php?id=','(paiement)','payment'),(50,28,1,'/dolibarr_new/comm/card.php?socid=','ABC and Co','company'),(51,29,33,'/dolibarr_new/compta/paiement/card.php?id=','(paiement)','payment'),(52,29,1,'/dolibarr_new/comm/card.php?socid=','ABC and Co','company'),(53,30,1,'/dolibarr_3.8/htdocs/fourn/paiement/card.php?id=','(paiement)','payment_supplier'),(54,30,1,'/dolibarr_3.8/htdocs/fourn/card.php?socid=','Indian SAS','company'),(55,32,2,'/dolibarr_5.0/htdocs/fourn/paiement/card.php?id=','(paiement)','payment_supplier'),(56,32,13,'/dolibarr_5.0/htdocs/fourn/card.php?socid=','Company Corp 2','company'),(57,33,34,'/dolibarr_5.0/htdocs/compta/paiement/card.php?id=','(paiement)','payment'),(58,33,19,'/dolibarr_5.0/htdocs/comm/card.php?socid=','Magic Food Store','company'),(59,34,35,'/dolibarr_5.0/htdocs/compta/paiement/card.php?id=','(paiement)','payment'),(60,34,19,'/dolibarr_5.0/htdocs/comm/card.php?socid=','Magic Food Store','company'),(61,35,2,'/dolibarr_5.0/htdocs/dolimed_5.0/cabinetmed/consultations.php?action=edit&socid=26&id=','Consultation','consultation'),(62,35,26,'','aaa','company'),(63,36,2,'/dolibarr_5.0/htdocs/expensereport/payment/card.php?rowid=','(paiement)','payment_expensereport'),(64,36,0,'/dolibarr_5.0/htdocs/user/card.php?id=','','user'),(65,37,36,'/dolibarr_5.0/htdocs/compta/paiement/card.php?id=','(paiement)','payment'),(66,37,1,'/dolibarr_5.0/htdocs/compta/prelevement/card.php?id=','T170201','withdraw'); +/*!40000 ALTER TABLE `llx_bank_url` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_blockedlog` +-- + +DROP TABLE IF EXISTS `llx_blockedlog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_blockedlog` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `action` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `amounts` double NOT NULL, + `signature` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `signature_line` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `element` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `fk_object` int(11) DEFAULT NULL, + `ref_object` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, + `date_object` datetime DEFAULT NULL, + `object_data` text COLLATE utf8_unicode_ci, + `fk_user` int(11) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `certified` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `signature` (`signature`), + KEY `fk_object_element` (`fk_object`,`element`), + KEY `entity` (`entity`), + KEY `fk_user` (`fk_user`), + KEY `entity_action` (`entity`,`action`), + KEY `entity_action_certified` (`entity`,`action`,`certified`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_blockedlog` +-- + +LOCK TABLES `llx_blockedlog` WRITE; +/*!40000 ALTER TABLE `llx_blockedlog` DISABLE KEYS */; +INSERT INTO `llx_blockedlog` VALUES (1,'2017-08-02 08:25:58','BILL_SENTBYMAIL',6,'e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(2,'2017-08-02 08:25:58','BILL_SENTBYMAIL',20,'9723d42f5ca91f8fe37ffd8797d96f3328ad0728c9359c8408caf643cb80aefb','7b60f68f0b62bd91bdc8a3365a5e0d0b0c073efdf2af6aeb43b1862900a26c48','facture',8771,'FA1707-8565','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:16:\"Magic Food Store\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:22:\"65 holdywood boulevard\";s:3:\"zip\";s:6:\"123456\";s:4:\"town\";s:7:\"BigTown\";s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";s:4:\"0101\";s:5:\"email\";s:18:\"myemail@domain.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:10:\"10/10/2010\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"0\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1487667100;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1357978985;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1301-0008\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"en_US\";s:3:\"ref\";s:2:\"19\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:18:\"magicfoodstore.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"19\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";s:18:\"patient@cabinetmed\";s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:7:\"Espagne\";s:10:\"country_id\";s:1:\"4\";s:12:\"country_code\";s:2:\"ES\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";s:11:\"sepamandate\";s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:16:\"Magic Food Store\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:20;s:9:\"total_tva\";d:1.7;s:9:\"total_ttc\";d:20;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(3,'2017-08-02 08:36:34','BILL_SENTBYMAIL',6,'e565ad988a79df11e2de93c402175358649483cf684573da75567aa37b740488','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(4,'2017-08-02 08:36:34','BILL_SENTBYMAIL',20,'ade186d3b74ddc471fd6964e5e76e19c3a737012e9bac1ed773c21cb5061c787','7b60f68f0b62bd91bdc8a3365a5e0d0b0c073efdf2af6aeb43b1862900a26c48','facture',8771,'FA1707-8565','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:16:\"Magic Food Store\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:22:\"65 holdywood boulevard\";s:3:\"zip\";s:6:\"123456\";s:4:\"town\";s:7:\"BigTown\";s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";s:4:\"0101\";s:5:\"email\";s:18:\"myemail@domain.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:10:\"10/10/2010\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"0\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1487667100;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1357978985;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1301-0008\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"en_US\";s:3:\"ref\";s:2:\"19\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:18:\"magicfoodstore.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"19\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";s:18:\"patient@cabinetmed\";s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:7:\"Espagne\";s:10:\"country_id\";s:1:\"4\";s:12:\"country_code\";s:2:\"ES\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";s:11:\"sepamandate\";s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:16:\"Magic Food Store\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:20;s:9:\"total_tva\";d:1.7;s:9:\"total_ttc\";d:20;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(5,'2017-08-02 08:36:56','BILL_SENTBYMAIL',6,'377af8dd352bf4762dc02def97c196ae017781013652ffc1865ab0fa0c6a2ad9','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(6,'2017-08-02 08:36:56','BILL_SENTBYMAIL',20,'89411e25f74aaa70f7effe5bc30d44d9870a5bc99665d6ac8f38bdde41c7666d','7b60f68f0b62bd91bdc8a3365a5e0d0b0c073efdf2af6aeb43b1862900a26c48','facture',8771,'FA1707-8565','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:16:\"Magic Food Store\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:22:\"65 holdywood boulevard\";s:3:\"zip\";s:6:\"123456\";s:4:\"town\";s:7:\"BigTown\";s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";s:4:\"0101\";s:5:\"email\";s:18:\"myemail@domain.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:10:\"10/10/2010\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"0\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1487667100;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1357978985;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1301-0008\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"en_US\";s:3:\"ref\";s:2:\"19\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:18:\"magicfoodstore.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"19\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";s:18:\"patient@cabinetmed\";s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:7:\"Espagne\";s:10:\"country_id\";s:1:\"4\";s:12:\"country_code\";s:2:\"ES\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";s:11:\"sepamandate\";s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:16:\"Magic Food Store\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:20;s:9:\"total_tva\";d:1.7;s:9:\"total_ttc\";d:20;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(7,'2017-08-02 08:39:42','BILL_SENTBYMAIL',6,'fdd50904cc6c35f02c1a8b4bbd62c84f207f0f4fa9b6583915a1a44631d64211','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(8,'2017-08-02 08:49:45','BILL_SENTBYMAIL',6,'12378effcd936967e889b46b3683a648abe623b917ff3541e64221506d3bb5d7','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(9,'2017-08-02 09:37:50','BILL_SENTBYMAIL',6,'1de2cbe8cb5fbd857db8d0655b457dd938b512ade4b9398821ab64fe91a3db99','e70f25fddabcd71f85798075f72399736cb171078141b58513bc87a3149a5ae5','facture',8772,'FA1707-8566','2017-07-13 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:8:\"NLTechno\";s:10:\"name_alias\";s:22:\"The OpenSource company\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:23:\"notanemail@nltechno.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";s:12:\"123456789012\";s:7:\"idprof1\";s:9:\"493861496\";s:7:\"idprof2\";s:14:\"49386149600039\";s:7:\"idprof3\";s:5:\"6209Z\";s:7:\"idprof4\";s:10:\"22-01-2007\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:11:\"FR123456789\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:5:\"10000\";s:9:\"typent_id\";s:1:\"4\";s:11:\"typent_code\";s:8:\"TE_SMALL\";s:8:\"effectif\";s:5:\"1 - 5\";s:11:\"effectif_id\";s:1:\"1\";s:20:\"forme_juridique_code\";s:2:\"54\";s:15:\"forme_juridique\";s:44:\"Société à responsabilité limitée (SARL)\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1452948260;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278760388;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"1\";s:11:\"code_client\";s:11:\"CU1212-0005\";s:16:\"code_fournisseur\";s:11:\"SU1601-0011\";s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";s:5:\"fr_FR\";s:3:\"ref\";s:2:\"10\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:24:\"logo_nltechno_94x100.png\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"10\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:8:\"NLTechno\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:5;s:9:\"total_tva\";d:1;s:9:\"total_ttc\";d:6;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(10,'2017-08-24 13:13:59','BILL_PAYED',10,'ec3ee6ad9ad246971e682ec0a6c2da6dc50edf649a82306d25094f4f6f152eca','ba692804ef75f1a9215c1d4a16a3238dcd6a9979a66b23d7cb7c33723cc6d2c9','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(11,'2017-08-24 13:13:59','PAYMENT_CUSTOMER_CREATE',10,'d85b7d157d2a9af2f558ba14361dcea164fce589176e5140e216ded42f6d975f','fc16a403f1d77c8cdbb8cdb138a84cd7e7ee5171a392a237e53fea3181e1b134','payment',41,'PAY1708-0008','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(12,'2017-08-24 13:13:59','PAYMENT_ADD_TO_BANK',10,'b487f2db2ccfa4a90d5a7274ba82d4407c57b45c9bf18b76872af8d6d4a1a6d9','141c462de832eaa27ad97bed061d2d4161baf472f50c7ed6afa59f7379a7688c','payment',41,'PAY1708-0008','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(13,'2017-08-24 13:14:03','BILL_UNPAYED',10,'aa00aa2d2ec2c29a14e6c6bf7a0534aefbb023e48b8ea4e8d9a6654c7225c1ff','9b4b628169f17771440fc3092ba6d374e6145f9a535c9f39209f23fa5298d097','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(14,'2017-08-24 13:16:29','PAYMENT_CUSTOMER_CREATE',10,'132b29a7eb271cf8e9c59d9b92686a33380111136328af1021c8b27acea9a7fb','fc16a403f1d77c8cdbb8cdb138a84cd7e7ee5171a392a237e53fea3181e1b134','payment',42,'PAY1708-0009','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(15,'2017-08-24 13:16:29','PAYMENT_ADD_TO_BANK',10,'b61a6ff4c376f958b4b790aa604c2aed3fdb83754d71eb66429e15058dacba31','141c462de832eaa27ad97bed061d2d4161baf472f50c7ed6afa59f7379a7688c','payment',42,'PAY1708-0009','2017-08-24 12:00:00','O:8:\"stdClass\":1:{s:7:\"amounts\";a:1:{i:160;s:2:\"10\";}}',12,1,0),(16,'2017-08-24 13:27:51','BILL_PAYED',10,'1bcfe1a00ec383d5b1b5e00b2523f11206c11875dedf1622f946eb3356ad997b','ba692804ef75f1a9215c1d4a16a3238dcd6a9979a66b23d7cb7c33723cc6d2c9','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(17,'2017-08-24 13:30:04','BILL_UNPAYED',10,'c9cff4c7b3d71fd69d366ee8d09141dd4c21a5bf1569e70b4c09a0f06763d4fd','9b4b628169f17771440fc3092ba6d374e6145f9a535c9f39209f23fa5298d097','facture',160,'FA1507-0015','2016-07-18 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";s:1:\"1\";s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:8.8900000000000006;s:9:\"total_tva\";d:1.1100000000000001;s:9:\"total_ttc\";d:10;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0),(18,'2017-08-24 13:34:07','BILL_VALIDATE',-12,'25a739b8fe033e38001139c4427fcc567f6e4317c87bdf48af895172031f781e','47a479de70f03b12bdf94015e848223a3b24fcc1edef6a491a35105da9db6d37','facture',8773,'(PROV8773)','2017-08-24 00:00:00','O:8:\"stdClass\":8:{s:10:\"thirdparty\";O:8:\"stdClass\":131:{s:7:\"element\";s:7:\"societe\";s:13:\"table_element\";s:7:\"societe\";s:10:\"fk_element\";s:6:\"fk_soc\";s:6:\"entity\";s:1:\"1\";s:3:\"nom\";s:12:\"Dupont Alain\";s:10:\"name_alias\";s:0:\"\";s:11:\"particulier\";N;s:7:\"address\";s:0:\"\";s:3:\"zip\";N;s:4:\"town\";N;s:6:\"status\";s:1:\"1\";s:8:\"state_id\";s:1:\"0\";s:10:\"state_code\";N;s:5:\"state\";N;s:16:\"departement_code\";N;s:11:\"departement\";N;s:4:\"pays\";N;s:5:\"phone\";N;s:3:\"fax\";N;s:5:\"email\";s:18:\"dalain@example.com\";s:5:\"skype\";N;s:3:\"url\";N;s:7:\"barcode\";N;s:7:\"idprof1\";s:0:\"\";s:7:\"idprof2\";s:0:\"\";s:7:\"idprof3\";s:0:\"\";s:7:\"idprof4\";s:0:\"\";s:7:\"idprof5\";s:0:\"\";s:7:\"idprof6\";s:0:\"\";s:11:\"prefix_comm\";N;s:9:\"tva_assuj\";s:1:\"1\";s:9:\"tva_intra\";s:0:\"\";s:15:\"localtax1_assuj\";N;s:15:\"localtax1_value\";s:5:\"0.000\";s:15:\"localtax2_assuj\";N;s:15:\"localtax2_value\";s:5:\"0.000\";s:8:\"managers\";N;s:7:\"capital\";s:1:\"0\";s:9:\"typent_id\";s:1:\"0\";s:11:\"typent_code\";s:10:\"TE_UNKNOWN\";s:8:\"effectif\";s:0:\"\";s:11:\"effectif_id\";N;s:20:\"forme_juridique_code\";N;s:15:\"forme_juridique\";s:0:\"\";s:14:\"remise_percent\";s:1:\"0\";s:26:\"mode_reglement_supplier_id\";N;s:26:\"cond_reglement_supplier_id\";N;s:16:\"fk_prospectlevel\";N;s:8:\"name_bis\";N;s:17:\"date_modification\";i:1453470116;s:17:\"user_modification\";N;s:13:\"date_creation\";i:1278850688;s:13:\"user_creation\";N;s:8:\"specimen\";N;s:6:\"client\";i:1;s:8:\"prospect\";i:0;s:11:\"fournisseur\";s:1:\"0\";s:11:\"code_client\";s:11:\"CU1601-0019\";s:16:\"code_fournisseur\";N;s:11:\"code_compta\";N;s:23:\"code_compta_fournisseur\";N;s:4:\"note\";N;s:12:\"note_private\";N;s:11:\"note_public\";N;s:9:\"stcomm_id\";s:1:\"0\";s:17:\"statut_commercial\";s:22:\"Jamais contacté\";s:11:\"price_level\";N;s:17:\"outstanding_limit\";N;s:13:\"commercial_id\";N;s:6:\"parent\";N;s:12:\"default_lang\";N;s:3:\"ref\";s:2:\"12\";s:7:\"ref_int\";N;s:7:\"ref_ext\";N;s:10:\"import_key\";N;s:15:\"webservices_url\";N;s:15:\"webservices_key\";N;s:4:\"logo\";s:15:\"pierrecurie.jpg\";s:10:\"logo_small\";N;s:9:\"logo_mini\";N;s:13:\"array_options\";a:5:{s:13:\"options_gouts\";N;s:14:\"options_height\";N;s:14:\"options_weight\";N;s:12:\"options_prof\";N;s:17:\"options_birthdate\";N;}s:12:\"fk_incoterms\";s:1:\"0\";s:18:\"location_incoterms\";N;s:17:\"libelle_incoterms\";N;s:16:\"fk_multicurrency\";N;s:18:\"multicurrency_code\";N;s:7:\"oldcopy\";N;s:2:\"id\";s:2:\"12\";s:5:\"error\";N;s:6:\"errors\";a:0:{}s:18:\"table_element_line\";N;s:16:\"linkedObjectsIds\";N;s:13:\"linkedObjects\";N;s:7:\"context\";a:0:{}s:6:\"canvas\";N;s:7:\"project\";N;s:10:\"fk_project\";N;s:6:\"projet\";N;s:7:\"contact\";N;s:10:\"contact_id\";N;s:10:\"thirdparty\";N;s:4:\"user\";N;s:6:\"origin\";N;s:9:\"origin_id\";N;s:12:\"ref_previous\";N;s:8:\"ref_next\";N;s:6:\"statut\";N;s:7:\"country\";s:6:\"France\";s:10:\"country_id\";s:1:\"1\";s:12:\"country_code\";s:2:\"FR\";s:12:\"barcode_type\";N;s:17:\"barcode_type_code\";N;s:18:\"barcode_type_label\";N;s:18:\"barcode_type_coder\";N;s:17:\"mode_reglement_id\";N;s:17:\"cond_reglement_id\";N;s:14:\"cond_reglement\";N;s:19:\"fk_delivery_address\";N;s:18:\"shipping_method_id\";N;s:8:\"modelpdf\";N;s:10:\"fk_account\";N;s:8:\"total_ht\";N;s:9:\"total_tva\";N;s:15:\"total_localtax1\";N;s:15:\"total_localtax2\";N;s:9:\"total_ttc\";N;s:5:\"lines\";N;s:4:\"name\";s:12:\"Dupont Alain\";s:8:\"lastname\";N;s:9:\"firstname\";N;s:11:\"civility_id\";N;}s:8:\"total_ht\";d:-10;s:9:\"total_tva\";d:-2;s:9:\"total_ttc\";d:-12;s:15:\"total_localtax1\";d:0;s:15:\"total_localtax2\";d:0;s:11:\"note_public\";d:0;s:12:\"note_private\";d:0;}',12,1,0); +/*!40000 ALTER TABLE `llx_blockedlog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_blockedlog_authority` +-- + +DROP TABLE IF EXISTS `llx_blockedlog_authority`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_blockedlog_authority` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `blockchain` longtext COLLATE utf8_unicode_ci NOT NULL, + `signature` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + KEY `signature` (`signature`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_blockedlog_authority` +-- + +LOCK TABLES `llx_blockedlog_authority` WRITE; +/*!40000 ALTER TABLE `llx_blockedlog_authority` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_blockedlog_authority` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bookmark` +-- + +DROP TABLE IF EXISTS `llx_bookmark`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bookmark` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `dateb` datetime DEFAULT NULL, + `url` varchar(255) NOT NULL, + `target` varchar(16) DEFAULT NULL, + `title` varchar(64) DEFAULT NULL, + `favicon` varchar(24) DEFAULT NULL, + `position` int(11) DEFAULT '0', + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bookmark_url` (`fk_user`,`url`), + UNIQUE KEY `uk_bookmark_title` (`fk_user`,`title`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bookmark` +-- + +LOCK TABLES `llx_bookmark` WRITE; +/*!40000 ALTER TABLE `llx_bookmark` DISABLE KEYS */; +INSERT INTO `llx_bookmark` VALUES (1,NULL,0,'2010-07-09 01:29:03','http://wiki.dolibarr.org','1','Online documentation','none',1,1),(2,NULL,0,'2010-07-09 01:30:15','http://www.dolibarr.org','1','Official portal','none',2,1),(3,NULL,0,'2010-07-09 01:30:53','http://www.dolistore.com','1','DoliStore','none',10,1),(4,NULL,0,'2010-07-09 01:31:35','http://asso.dolibarr.org/index.php/Main_Page','1','The foundation','none',0,1),(5,NULL,0,'2014-03-02 16:40:41','http://www.facebook.com/dolibarr','1','Facebook page','none',50,1),(6,NULL,0,'2014-03-02 16:41:12','http://www.twitter.com/dolibarr','1','Twitter channel','none',60,1),(7,NULL,0,'2014-03-02 16:42:08','http://plus.google.com/+DolibarrOrg','1','Google+ page','none',55,1); +/*!40000 ALTER TABLE `llx_bookmark` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_bordereau_cheque` +-- + +DROP TABLE IF EXISTS `llx_bordereau_cheque`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_bordereau_cheque` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime NOT NULL, + `date_bordereau` date DEFAULT NULL, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `amount` double(24,8) NOT NULL, + `nbcheque` smallint(6) NOT NULL, + `fk_bank_account` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `note` text, + `statut` smallint(6) NOT NULL DEFAULT '0', + `ref_ext` varchar(255) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_bordereau_cheque` (`ref`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_bordereau_cheque` +-- + +LOCK TABLES `llx_bordereau_cheque` WRITE; +/*!40000 ALTER TABLE `llx_bordereau_cheque` DISABLE KEYS */; +INSERT INTO `llx_bordereau_cheque` VALUES (2,'2017-02-06 08:12:05','2017-02-06','CHK1702-0001',1,150.00000000,1,1,12,NULL,1,'','2017-02-06 04:12:13'); +/*!40000 ALTER TABLE `llx_bordereau_cheque` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_boxes` +-- + +DROP TABLE IF EXISTS `llx_boxes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_boxes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `box_id` int(11) NOT NULL, + `position` smallint(6) NOT NULL, + `box_order` varchar(3) NOT NULL, + `fk_user` int(11) NOT NULL DEFAULT '0', + `maxline` int(11) DEFAULT NULL, + `params` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_boxes` (`entity`,`box_id`,`position`,`fk_user`), + KEY `idx_boxes_boxid` (`box_id`), + KEY `idx_boxes_fk_user` (`fk_user`), + CONSTRAINT `fk_boxes_box_id` FOREIGN KEY (`box_id`) REFERENCES `llx_boxes_def` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=1120 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_boxes` +-- + +LOCK TABLES `llx_boxes` WRITE; +/*!40000 ALTER TABLE `llx_boxes` DISABLE KEYS */; +INSERT INTO `llx_boxes` VALUES (253,2,323,0,'0',0,NULL,NULL),(304,2,324,0,'0',0,NULL,NULL),(305,2,325,0,'0',0,NULL,NULL),(306,2,326,0,'0',0,NULL,NULL),(307,2,327,0,'0',0,NULL,NULL),(308,2,328,0,'0',0,NULL,NULL),(309,2,329,0,'0',0,NULL,NULL),(310,2,330,0,'0',0,NULL,NULL),(311,2,331,0,'0',0,NULL,NULL),(312,2,332,0,'0',0,NULL,NULL),(313,2,333,0,'0',0,NULL,NULL),(314,1,347,0,'A01',0,NULL,NULL),(315,1,348,0,'B18',0,NULL,NULL),(316,1,349,0,'A19',0,NULL,NULL),(317,1,350,0,'B20',0,NULL,NULL),(344,1,374,0,'A21',0,NULL,NULL),(347,1,377,0,'B22',0,NULL,NULL),(348,1,378,0,'A23',0,NULL,NULL),(358,1,388,0,'A25',0,NULL,NULL),(359,1,389,0,'B26',0,NULL,NULL),(360,1,390,0,'A27',0,NULL,NULL),(362,1,392,0,'A29',0,NULL,NULL),(363,1,393,0,'B30',0,NULL,NULL),(366,1,396,0,'A17',0,NULL,NULL),(387,1,403,0,'B16',0,NULL,NULL),(392,1,409,0,'A15',0,NULL,NULL),(393,1,410,0,'B02',0,NULL,NULL),(394,1,411,0,'A03',0,NULL,NULL),(395,1,412,0,'B04',0,NULL,NULL),(396,1,413,0,'A05',0,NULL,NULL),(397,1,414,0,'B06',0,NULL,NULL),(398,1,415,0,'A07',0,NULL,NULL),(399,1,416,0,'B08',0,NULL,NULL),(400,1,417,0,'A09',0,NULL,NULL),(401,1,418,0,'B10',0,NULL,NULL),(501,1,419,0,'A11',0,NULL,NULL),(1019,1,392,0,'A01',2,NULL,NULL),(1021,1,412,0,'A03',2,NULL,NULL),(1022,1,347,0,'A04',2,NULL,NULL),(1023,1,393,0,'A05',2,NULL,NULL),(1025,1,389,0,'A07',2,NULL,NULL),(1026,1,416,0,'A08',2,NULL,NULL),(1027,1,396,0,'B01',2,NULL,NULL),(1028,1,377,0,'B02',2,NULL,NULL),(1031,1,419,0,'B05',2,NULL,NULL),(1036,1,424,0,'0',0,NULL,NULL),(1037,1,425,0,'0',0,NULL,NULL),(1038,1,426,0,'0',0,NULL,NULL),(1039,1,427,0,'0',0,NULL,NULL),(1115,1,412,0,'A01',12,NULL,NULL),(1116,1,392,0,'A02',12,NULL,NULL),(1117,1,377,0,'A03',12,NULL,NULL),(1118,1,347,0,'A04',12,NULL,NULL),(1119,1,396,0,'B01',12,NULL,NULL); +/*!40000 ALTER TABLE `llx_boxes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_boxes_def` +-- + +DROP TABLE IF EXISTS `llx_boxes_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_boxes_def` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `file` varchar(200) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `note` varchar(130) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_boxes_def` (`file`,`entity`,`note`) +) ENGINE=InnoDB AUTO_INCREMENT=430 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_boxes_def` +-- + +LOCK TABLES `llx_boxes_def` WRITE; +/*!40000 ALTER TABLE `llx_boxes_def` DISABLE KEYS */; +INSERT INTO `llx_boxes_def` VALUES (188,'box_services_vendus.php',1,'2011-08-05 20:40:27',NULL),(323,'box_actions.php',2,'2013-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2013-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2013-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2013-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2013-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2013-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2013-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2013-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2013-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2013-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2013-03-13 20:33:09',NULL),(346,'box_googlemaps@google',1,'2013-11-07 00:01:39',NULL),(347,'box_clients.php',1,'2015-11-15 22:05:57',NULL),(348,'box_prospect.php',1,'2015-11-15 22:05:57',NULL),(349,'box_contacts.php',1,'2015-11-15 22:05:57',NULL),(350,'box_activity.php',1,'2015-11-15 22:05:57','(WarningUsingThisBoxSlowDown)'),(374,'box_services_contracts.php',1,'2015-11-15 22:38:37',NULL),(377,'box_project.php',1,'2015-11-15 22:38:44',NULL),(378,'box_task.php',1,'2015-11-15 22:38:44',NULL),(388,'box_contracts.php',1,'2015-11-15 22:39:52',NULL),(389,'box_services_expired.php',1,'2015-11-15 22:39:52',NULL),(390,'box_ficheinter.php',1,'2015-11-15 22:39:56',NULL),(392,'box_graph_propales_permonth.php',1,'2015-11-15 22:41:47',NULL),(393,'box_propales.php',1,'2015-11-15 22:41:47',NULL),(396,'box_graph_product_distribution.php',1,'2015-11-15 22:41:47',NULL),(403,'box_goodcustomers.php',1,'2016-07-30 11:13:20','(WarningUsingThisBoxSlowDown)'),(404,'box_external_rss.php',1,'2016-07-30 11:15:25','1 (Dolibarr.org News)'),(409,'box_produits.php',1,'2016-07-30 13:38:11',NULL),(410,'box_produits_alerte_stock.php',1,'2016-07-30 13:38:11',NULL),(411,'box_commandes.php',1,'2016-07-30 13:38:11',NULL),(412,'box_graph_orders_permonth.php',1,'2016-07-30 13:38:11',NULL),(413,'box_graph_invoices_supplier_permonth.php',1,'2016-07-30 13:38:11',NULL),(414,'box_graph_orders_supplier_permonth.php',1,'2016-07-30 13:38:11',NULL),(415,'box_fournisseurs.php',1,'2016-07-30 13:38:11',NULL),(416,'box_factures_fourn_imp.php',1,'2016-07-30 13:38:11',NULL),(417,'box_factures_fourn.php',1,'2016-07-30 13:38:11',NULL),(418,'box_supplier_orders.php',1,'2016-07-30 13:38:11',NULL),(419,'box_actions.php',1,'2016-07-30 15:42:32',NULL),(424,'box_factures_imp.php',1,'2017-02-07 18:56:12',NULL),(425,'box_factures.php',1,'2017-02-07 18:56:12',NULL),(426,'box_graph_invoices_permonth.php',1,'2017-02-07 18:56:12',NULL),(427,'box_comptes.php',1,'2017-02-07 18:56:12',NULL),(429,'box_lastlogin.php',1,'2017-08-27 13:29:14',NULL); +/*!40000 ALTER TABLE `llx_boxes_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_budget` +-- + +DROP TABLE IF EXISTS `llx_budget`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_budget` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `label` varchar(255) NOT NULL, + `status` int(11) DEFAULT NULL, + `note` text, + `date_start` date DEFAULT NULL, + `date_end` date DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `import_key` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_budget` +-- + +LOCK TABLES `llx_budget` WRITE; +/*!40000 ALTER TABLE `llx_budget` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_budget` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_budget_lines` +-- + +DROP TABLE IF EXISTS `llx_budget_lines`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_budget_lines` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_budget` int(11) NOT NULL, + `fk_project_ids` varchar(255) NOT NULL, + `amount` double(24,8) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `import_key` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_budget_lines` (`fk_budget`,`fk_project_ids`), + CONSTRAINT `fk_budget_lines_budget` FOREIGN KEY (`fk_budget`) REFERENCES `llx_budget` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_budget_lines` +-- + +LOCK TABLES `llx_budget_lines` WRITE; +/*!40000 ALTER TABLE `llx_budget_lines` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_budget_lines` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_accounting_category` +-- + +DROP TABLE IF EXISTS `llx_c_accounting_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_accounting_category` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(255) NOT NULL, + `range_account` varchar(255) NOT NULL, + `sens` tinyint(4) NOT NULL DEFAULT '0', + `category_type` tinyint(4) NOT NULL DEFAULT '0', + `formula` varchar(255) NOT NULL, + `position` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT NULL, + `active` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_accounting_category` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_accounting_category` +-- + +LOCK TABLES `llx_c_accounting_category` WRITE; +/*!40000 ALTER TABLE `llx_c_accounting_category` DISABLE KEYS */; +INSERT INTO `llx_c_accounting_category` VALUES (1,'VTE','Ventes de marchandises','707xxx',0,0,'',10,1,1),(2,'MAR','Coût d achats marchandises vendues','603xxx | 607xxx | 609xxx',0,0,'',20,1,1),(3,'MARGE','Marge commerciale','',0,1,'1 + 2',30,1,1),(4,'123','ddd','603xxx | 607xxx | 609xxx',0,0,'0',4,14,1); +/*!40000 ALTER TABLE `llx_c_accounting_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_action_trigger` +-- + +DROP TABLE IF EXISTS `llx_c_action_trigger`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_action_trigger` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(32) NOT NULL, + `label` varchar(128) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `elementtype` varchar(16) NOT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_action_trigger_code` (`code`), + KEY `idx_action_trigger_rang` (`rang`) +) ENGINE=InnoDB AUTO_INCREMENT=195 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_action_trigger` +-- + +LOCK TABLES `llx_c_action_trigger` WRITE; +/*!40000 ALTER TABLE `llx_c_action_trigger` DISABLE KEYS */; +INSERT INTO `llx_c_action_trigger` VALUES (131,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1),(132,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1),(133,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2),(134,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3),(135,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4),(136,'ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5),(137,'ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5),(138,'ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5),(139,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5),(140,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6),(141,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7),(142,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8),(143,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9),(144,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10),(145,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(146,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12),(147,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13),(148,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14),(149,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15),(150,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16),(151,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17),(152,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17),(153,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18),(154,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20),(155,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21),(156,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22),(157,'MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23),(158,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24),(159,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24),(160,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25),(161,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19),(162,'FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(163,'FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(164,'FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19),(165,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19),(166,'PROJECT_CREATE','Project creation','Executed when a project is created','project',140),(167,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2),(168,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2),(169,'PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2),(170,'TASK_CREATE','Task created','Executed when a project task is created','project',35),(171,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36),(172,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37),(173,'BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15),(174,'PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141),(175,'PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142),(176,'ORDER_SUPPLIER_CREATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(177,'ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',12),(178,'ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',12),(179,'ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14),(180,'PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30),(181,'PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30),(182,'PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30),(183,'EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201),(185,'EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expense_report',202),(186,'EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expense_report',203),(187,'EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expense_report',204),(192,'HOLIDAY_CREATE','Leave request created','Executed when a leave request is created','holiday',221),(193,'HOLIDAY_VALIDATE','Leave request validated','Executed when a leave request is validated','holiday',222),(194,'HOLIDAY_APPROVE','Leave request approved','Executed when a leave request is approved','holiday',223); +/*!40000 ALTER TABLE `llx_c_action_trigger` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_actioncomm` +-- + +DROP TABLE IF EXISTS `llx_c_actioncomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_actioncomm` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `type` varchar(50) NOT NULL DEFAULT 'system', + `libelle` varchar(48) NOT NULL, + `module` varchar(16) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `todo` tinyint(4) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + `color` varchar(9) DEFAULT NULL, + `picto` varchar(48) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_actioncomm` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_actioncomm` +-- + +LOCK TABLES `llx_c_actioncomm` WRITE; +/*!40000 ALTER TABLE `llx_c_actioncomm` DISABLE KEYS */; +INSERT INTO `llx_c_actioncomm` VALUES (1,'AC_TEL','system','Phone call',NULL,1,NULL,2,NULL,NULL),(2,'AC_FAX','system','Send Fax',NULL,1,NULL,3,NULL,NULL),(4,'AC_EMAIL','system','Send Email',NULL,1,NULL,4,NULL,NULL),(5,'AC_RDV','system','Rendez-vous',NULL,1,NULL,1,NULL,NULL),(11,'AC_INT','system','Intervention on site',NULL,1,NULL,4,NULL,NULL),(40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL,1,NULL,20,NULL,NULL),(50,'AC_OTH','system','Other (manually inserted events)',NULL,1,NULL,5,NULL,NULL),(100700,'AC_CABMED','module','Send document by email','cabinetmed',0,NULL,100,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_actioncomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_availability` +-- + +DROP TABLE IF EXISTS `llx_c_availability`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_availability` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_availability` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_availability` +-- + +LOCK TABLES `llx_c_availability` WRITE; +/*!40000 ALTER TABLE `llx_c_availability` DISABLE KEYS */; +INSERT INTO `llx_c_availability` VALUES (1,'AV_NOW','Immediate',1),(2,'AV_1W','1 week',1),(3,'AV_2W','2 weeks',1),(4,'AV_3W','3 weeks',1); +/*!40000 ALTER TABLE `llx_c_availability` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_barcode_type` +-- + +DROP TABLE IF EXISTS `llx_c_barcode_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_barcode_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `libelle` varchar(50) NOT NULL, + `coder` varchar(16) NOT NULL, + `example` varchar(16) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_barcode_type` (`code`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_barcode_type` +-- + +LOCK TABLES `llx_c_barcode_type` WRITE; +/*!40000 ALTER TABLE `llx_c_barcode_type` DISABLE KEYS */; +INSERT INTO `llx_c_barcode_type` VALUES (1,'EAN8',1,'EAN8','0','1234567'),(2,'EAN13',1,'EAN13','phpbarcode','123456789012'),(3,'UPC',1,'UPC','0','123456789012'),(4,'ISBN',1,'ISBN','0','123456789'),(5,'C39',1,'Code 39','0','1234567890'),(6,'C128',1,'Code 128','tcpdfbarcode','ABCD1234567890'),(13,'DATAMATRIX',1,'Datamatrix','0','1234567xyz'),(14,'QRCODE',1,'Qr Code','0','www.dolibarr.org'); +/*!40000 ALTER TABLE `llx_c_barcode_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_chargesociales` +-- + +DROP TABLE IF EXISTS `llx_c_chargesociales`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_chargesociales` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `libelle` varchar(80) DEFAULT NULL, + `deductible` smallint(6) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + `code` varchar(12) NOT NULL, + `fk_pays` int(11) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `accountancy_code` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4110 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_chargesociales` +-- + +LOCK TABLES `llx_c_chargesociales` WRITE; +/*!40000 ALTER TABLE `llx_c_chargesociales` DISABLE KEYS */; +INSERT INTO `llx_c_chargesociales` VALUES (1,'Allocations familiales',1,1,'TAXFAM',1,NULL,NULL),(2,'CSG Deductible',1,1,'TAXCSGD',1,NULL,NULL),(3,'CSG/CRDS NON Deductible',0,1,'TAXCSGND',1,NULL,NULL),(10,'Taxe apprentissage',0,1,'TAXAPP',1,NULL,NULL),(11,'Taxe professionnelle',0,1,'TAXPRO',1,NULL,NULL),(12,'Cotisation foncière des entreprises',0,1,'TAXCFE',1,NULL,NULL),(13,'Cotisation sur la valeur ajoutée des entreprises',0,1,'TAXCVAE',1,NULL,NULL),(20,'Impots locaux/fonciers',0,1,'TAXFON',1,NULL,NULL),(25,'Impots revenus',0,1,'TAXREV',1,NULL,NULL),(30,'Assurance Sante',0,1,'TAXSECU',1,NULL,NULL),(40,'Mutuelle',0,1,'TAXMUT',1,NULL,NULL),(50,'Assurance vieillesse',0,1,'TAXRET',1,NULL,NULL),(60,'Assurance Chomage',0,1,'TAXCHOM',1,NULL,NULL),(201,'ONSS',1,1,'TAXBEONSS',2,NULL,NULL),(210,'Precompte professionnel',1,1,'TAXBEPREPRO',2,NULL,NULL),(220,'Prime d\'existence',1,1,'TAXBEPRIEXI',2,NULL,NULL),(230,'Precompte immobilier',1,1,'TAXBEPREIMMO',2,NULL,NULL),(4101,'Krankenversicherung',1,1,'TAXATKV',41,NULL,NULL),(4102,'Unfallversicherung',1,1,'TAXATUV',41,NULL,NULL),(4103,'Pensionsversicherung',1,1,'TAXATPV',41,NULL,NULL),(4104,'Arbeitslosenversicherung',1,1,'TAXATAV',41,NULL,NULL),(4105,'Insolvenzentgeltsicherungsfond',1,1,'TAXATIESG',41,NULL,NULL),(4106,'Wohnbauförderung',1,1,'TAXATWF',41,NULL,NULL),(4107,'Arbeiterkammerumlage',1,1,'TAXATAK',41,NULL,NULL),(4108,'Mitarbeitervorsorgekasse',1,1,'TAXATMVK',41,NULL,NULL),(4109,'Familienlastenausgleichsfond',1,1,'TAXATFLAF',41,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_chargesociales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_civility` +-- + +DROP TABLE IF EXISTS `llx_c_civility`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_civility` ( + `rowid` int(11) NOT NULL, + `code` varchar(6) NOT NULL, + `label` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_civility` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_civility` +-- + +LOCK TABLES `llx_c_civility` WRITE; +/*!40000 ALTER TABLE `llx_c_civility` DISABLE KEYS */; +INSERT INTO `llx_c_civility` VALUES (1,'MME','Madame',1,NULL),(3,'MR','Monsieur',1,NULL),(5,'MLE','Mademoiselle',1,NULL),(7,'MTRE','Maître',1,NULL),(8,'DR','Docteur',1,NULL); +/*!40000 ALTER TABLE `llx_c_civility` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_country` +-- + +DROP TABLE IF EXISTS `llx_c_country`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_country` ( + `rowid` int(11) NOT NULL, + `code` varchar(2) NOT NULL, + `code_iso` varchar(3) DEFAULT NULL, + `label` varchar(50) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `favorite` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_c_country_code` (`code`), + UNIQUE KEY `idx_c_country_label` (`label`), + UNIQUE KEY `idx_c_country_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_country` +-- + +LOCK TABLES `llx_c_country` WRITE; +/*!40000 ALTER TABLE `llx_c_country` DISABLE KEYS */; +INSERT INTO `llx_c_country` VALUES (0,'',NULL,'-',1,1),(1,'FR','FRA','France',1,0),(2,'BE','BEL','Belgium',1,0),(3,'IT','ITA','Italy',1,0),(4,'ES','ESP','Spain',1,0),(5,'DE','DEU','Germany',1,0),(6,'CH','CHE','Switzerland',1,0),(7,'GB','GBR','United Kingdom',1,0),(8,'IE','IRL','Irland',1,0),(9,'CN','CHN','China',1,0),(10,'TN','TUN','Tunisia',1,0),(11,'US','USA','United States',1,0),(12,'MA','MAR','Maroc',1,0),(13,'DZ','DZA','Algeria',1,0),(14,'CA','CAN','Canada',1,0),(15,'TG','TGO','Togo',1,0),(16,'GA','GAB','Gabon',1,0),(17,'NL','NLD','Nerderland',1,0),(18,'HU','HUN','Hongrie',1,0),(19,'RU','RUS','Russia',1,0),(20,'SE','SWE','Sweden',1,0),(21,'CI','CIV','Côte d\'Ivoire',1,0),(22,'SN','SEN','Senegal',1,0),(23,'AR','ARG','Argentine',1,0),(24,'CM','CMR','Cameroun',1,0),(25,'PT','PRT','Portugal',1,0),(26,'SA','SAU','Saudi Arabia',1,0),(27,'MC','MCO','Monaco',1,0),(28,'AU','AUS','Australia',1,0),(29,'SG','SGP','Singapour',1,0),(30,'AF','AFG','Afghanistan',1,0),(31,'AX','ALA','Iles Aland',1,0),(32,'AL','ALB','Albanie',1,0),(33,'AS','ASM','Samoa américaines',1,0),(34,'AD','AND','Andorre',1,0),(35,'AO','AGO','Angola',1,0),(36,'AI','AIA','Anguilla',1,0),(37,'AQ','ATA','Antarctique',1,0),(38,'AG','ATG','Antigua-et-Barbuda',1,0),(39,'AM','ARM','Arménie',1,0),(40,'AW','ABW','Aruba',1,0),(41,'AT','AUT','Autriche',1,0),(42,'AZ','AZE','Azerbaïdjan',1,0),(43,'BS','BHS','Bahamas',1,0),(44,'BH','BHR','Bahreïn',1,0),(45,'BD','BGD','Bangladesh',1,0),(46,'BB','BRB','Barbade',1,0),(47,'BY','BLR','Biélorussie',1,0),(48,'BZ','BLZ','Belize',1,0),(49,'BJ','BEN','Bénin',1,0),(50,'BM','BMU','Bermudes',1,0),(51,'BT','BTN','Bhoutan',1,0),(52,'BO','BOL','Bolivie',1,0),(53,'BA','BIH','Bosnie-Herzégovine',1,0),(54,'BW','BWA','Botswana',1,0),(55,'BV','BVT','Ile Bouvet',1,0),(56,'BR','BRA','Brazil',1,0),(57,'IO','IOT','Territoire britannique de l\'Océan Indien',1,0),(58,'BN','BRN','Brunei',1,0),(59,'BG','BGR','Bulgarie',1,0),(60,'BF','BFA','Burkina Faso',1,0),(61,'BI','BDI','Burundi',1,0),(62,'KH','KHM','Cambodge',1,0),(63,'CV','CPV','Cap-Vert',1,0),(64,'KY','CYM','Iles Cayman',1,0),(65,'CF','CAF','République centrafricaine',1,0),(66,'TD','TCD','Tchad',1,0),(67,'CL','CHL','Chili',1,0),(68,'CX','CXR','Ile Christmas',1,0),(69,'CC','CCK','Iles des Cocos (Keeling)',1,0),(70,'CO','COL','Colombie',1,0),(71,'KM','COM','Comores',1,0),(72,'CG','COG','Congo',1,0),(73,'CD','COD','République démocratique du Congo',1,0),(74,'CK','COK','Iles Cook',1,0),(75,'CR','CRI','Costa Rica',1,0),(76,'HR','HRV','Croatie',1,0),(77,'CU','CUB','Cuba',1,0),(78,'CY','CYP','Chypre',1,0),(79,'CZ','CZE','République Tchèque',1,0),(80,'DK','DNK','Danemark',1,0),(81,'DJ','DJI','Djibouti',1,0),(82,'DM','DMA','Dominique',1,0),(83,'DO','DOM','République Dominicaine',1,0),(84,'EC','ECU','Equateur',1,0),(85,'EG','EGY','Egypte',1,0),(86,'SV','SLV','Salvador',1,0),(87,'GQ','GNQ','Guinée Equatoriale',1,0),(88,'ER','ERI','Erythrée',1,0),(89,'EE','EST','Estonia',1,0),(90,'ET','ETH','Ethiopie',1,0),(91,'FK','FLK','Iles Falkland',1,0),(92,'FO','FRO','Iles Féroé',1,0),(93,'FJ','FJI','Iles Fidji',1,0),(94,'FI','FIN','Finlande',1,0),(95,'GF','GUF','Guyane française',1,0),(96,'PF','PYF','Polynésie française',1,0),(97,'TF','ATF','Terres australes françaises',1,0),(98,'GM','GMB','Gambie',1,0),(99,'GE','GEO','Georgia',1,0),(100,'GH','GHA','Ghana',1,0),(101,'GI','GIB','Gibraltar',1,0),(102,'GR','GRC','Greece',1,0),(103,'GL','GRL','Groenland',1,0),(104,'GD','GRD','Grenade',1,0),(106,'GU','GUM','Guam',1,0),(107,'GT','GTM','Guatemala',1,0),(108,'GN','GIN','Guinea',1,0),(109,'GW','GNB','Guinea-Bissao',1,0),(111,'HT','HTI','Haiti',1,0),(112,'HM','HMD','Iles Heard et McDonald',1,0),(113,'VA','VAT','Saint-Siège (Vatican)',1,0),(114,'HN','HND','Honduras',1,0),(115,'HK','HKG','Hong Kong',1,0),(116,'IS','ISL','Islande',1,0),(117,'IN','IND','India',1,0),(118,'ID','IDN','Indonésie',1,0),(119,'IR','IRN','Iran',1,0),(120,'IQ','IRQ','Iraq',1,0),(121,'IL','ISR','Israel',1,0),(122,'JM','JAM','Jamaïque',1,0),(123,'JP','JPN','Japon',1,0),(124,'JO','JOR','Jordanie',1,0),(125,'KZ','KAZ','Kazakhstan',1,0),(126,'KE','KEN','Kenya',1,0),(127,'KI','KIR','Kiribati',1,0),(128,'KP','PRK','North Corea',1,0),(129,'KR','KOR','South Corea',1,0),(130,'KW','KWT','Koweït',1,0),(131,'KG','KGZ','Kirghizistan',1,0),(132,'LA','LAO','Laos',1,0),(133,'LV','LVA','Lettonie',1,0),(134,'LB','LBN','Liban',1,0),(135,'LS','LSO','Lesotho',1,0),(136,'LR','LBR','Liberia',1,0),(137,'LY','LBY','Libye',1,0),(138,'LI','LIE','Liechtenstein',1,0),(139,'LT','LTU','Lituanie',1,0),(140,'LU','LUX','Luxembourg',1,0),(141,'MO','MAC','Macao',1,0),(142,'MK','MKD','ex-République yougoslave de Macédoine',1,0),(143,'MG','MDG','Madagascar',1,0),(144,'MW','MWI','Malawi',1,0),(145,'MY','MYS','Malaisie',1,0),(146,'MV','MDV','Maldives',1,0),(147,'ML','MLI','Mali',1,0),(148,'MT','MLT','Malte',1,0),(149,'MH','MHL','Iles Marshall',1,0),(151,'MR','MRT','Mauritanie',1,0),(152,'MU','MUS','Maurice',1,0),(153,'YT','MYT','Mayotte',1,0),(154,'MX','MEX','Mexique',1,0),(155,'FM','FSM','Micronésie',1,0),(156,'MD','MDA','Moldavie',1,0),(157,'MN','MNG','Mongolie',1,0),(158,'MS','MSR','Monserrat',1,0),(159,'MZ','MOZ','Mozambique',1,0),(160,'MM','MMR','Birmanie (Myanmar)',1,0),(161,'NA','NAM','Namibie',1,0),(162,'NR','NRU','Nauru',1,0),(163,'NP','NPL','Népal',1,0),(164,'AN',NULL,'Antilles néerlandaises',1,0),(165,'NC','NCL','Nouvelle-Calédonie',1,0),(166,'NZ','NZL','Nouvelle-Zélande',1,0),(167,'NI','NIC','Nicaragua',1,0),(168,'NE','NER','Niger',1,0),(169,'NG','NGA','Nigeria',1,0),(170,'NU','NIU','Nioué',1,0),(171,'NF','NFK','Ile Norfolk',1,0),(172,'MP','MNP','Mariannes du Nord',1,0),(173,'NO','NOR','Norvège',1,0),(174,'OM','OMN','Oman',1,0),(175,'PK','PAK','Pakistan',1,0),(176,'PW','PLW','Palaos',1,0),(177,'PS','PSE','Territoire Palestinien Occupé',1,0),(178,'PA','PAN','Panama',1,0),(179,'PG','PNG','Papouasie-Nouvelle-Guinée',1,0),(180,'PY','PRY','Paraguay',1,0),(181,'PE','PER','Peru',1,0),(182,'PH','PHL','Philippines',1,0),(183,'PN','PCN','Iles Pitcairn',1,0),(184,'PL','POL','Pologne',1,0),(185,'PR','PRI','Porto Rico',1,0),(186,'QA','QAT','Qatar',1,0),(188,'RO','ROU','Roumanie',1,0),(189,'RW','RWA','Rwanda',1,0),(190,'SH','SHN','Sainte-Hélène',1,0),(191,'KN','KNA','Saint-Christophe-et-Niévès',1,0),(192,'LC','LCA','Sainte-Lucie',1,0),(193,'PM','SPM','Saint-Pierre-et-Miquelon',1,0),(194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1,0),(195,'WS','WSM','Samoa',1,0),(196,'SM','SMR','Saint-Marin',1,0),(197,'ST','STP','Sao Tomé-et-Principe',1,0),(198,'RS','SRB','Serbie',1,0),(199,'SC','SYC','Seychelles',1,0),(200,'SL','SLE','Sierra Leone',1,0),(201,'SK','SVK','Slovaquie',1,0),(202,'SI','SVN','Slovénie',1,0),(203,'SB','SLB','Iles Salomon',1,0),(204,'SO','SOM','Somalie',1,0),(205,'ZA','ZAF','Afrique du Sud',1,0),(206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1,0),(207,'LK','LKA','Sri Lanka',1,0),(208,'SD','SDN','Soudan',1,0),(209,'SR','SUR','Suriname',1,0),(210,'SJ','SJM','Iles Svalbard et Jan Mayen',1,0),(211,'SZ','SWZ','Swaziland',1,0),(212,'SY','SYR','Syrie',1,0),(213,'TW','TWN','Taïwan',1,0),(214,'TJ','TJK','Tadjikistan',1,0),(215,'TZ','TZA','Tanzanie',1,0),(216,'TH','THA','Thaïlande',1,0),(217,'TL','TLS','Timor Oriental',1,0),(218,'TK','TKL','Tokélaou',1,0),(219,'TO','TON','Tonga',1,0),(220,'TT','TTO','Trinité-et-Tobago',1,0),(221,'TR','TUR','Turquie',1,0),(222,'TM','TKM','Turkménistan',1,0),(223,'TC','TCA','Iles Turks-et-Caicos',1,0),(224,'TV','TUV','Tuvalu',1,0),(225,'UG','UGA','Ouganda',1,0),(226,'UA','UKR','Ukraine',1,0),(227,'xx','ARE','Émirats arabes unishh',1,0),(228,'UM','UMI','Iles mineures éloignées des États-Unis',1,0),(229,'UY','URY','Uruguay',1,0),(230,'UZ','UZB','Ouzbékistan',1,0),(231,'VU','VUT','Vanuatu',1,0),(232,'VE','VEN','Vénézuela',1,0),(233,'VN','VNM','Viêt Nam',1,0),(234,'VG','VGB','Iles Vierges britanniques',1,0),(235,'VI','VIR','Iles Vierges américaines',1,0),(236,'WF','WLF','Wallis-et-Futuna',1,0),(237,'EH','ESH','Sahara occidental',1,0),(238,'YE','YEM','Yémen',1,0),(239,'ZM','ZMB','Zambie',1,0),(240,'ZW','ZWE','Zimbabwe',1,0),(241,'GG','GGY','Guernesey',1,0),(242,'IM','IMN','Ile de Man',1,0),(243,'JE','JEY','Jersey',1,0),(244,'ME','MNE','Monténégro',1,0),(245,'BL','BLM','Saint-Barthélemy',1,0),(246,'MF','MAF','Saint-Martin',1,0),(247,'hh',NULL,'hhh',1,0); +/*!40000 ALTER TABLE `llx_c_country` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_currencies` +-- + +DROP TABLE IF EXISTS `llx_c_currencies`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_currencies` ( + `code_iso` varchar(3) NOT NULL, + `label` varchar(64) NOT NULL, + `unicode` varchar(32) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`code_iso`), + UNIQUE KEY `uk_c_currencies_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_currencies` +-- + +LOCK TABLES `llx_c_currencies` WRITE; +/*!40000 ALTER TABLE `llx_c_currencies` DISABLE KEYS */; +INSERT INTO `llx_c_currencies` VALUES ('AED','United Arab Emirates Dirham',NULL,1),('AFN','Afghanistan Afghani','[1547]',1),('ALL','Albania Leklll','[76,101,107]',1),('ANG','Netherlands Antilles Guilder','[402]',1),('ARP','Pesos argentins',NULL,0),('ARS','Argentino Peso','[36]',1),('ATS','Shiliing autrichiens',NULL,0),('AUD','Australia Dollar','[36]',1),('AWG','Aruba Guilder','[402]',1),('AZN','Azerbaijan New Manat','[1084,1072,1085]',1),('BAM','Bosnia and Herzegovina Convertible Marka','[75,77]',1),('BBD','Barbados Dollar','[36]',1),('BEF','Francs belges',NULL,0),('BGN','Bulgaria Lev','[1083,1074]',1),('BMD','Bermuda Dollar','[36]',1),('BND','Brunei Darussalam Dollar','[36]',1),('BOB','Bolivia Boliviano','[36,98]',1),('BRL','Brazil Real','[82,36]',1),('BSD','Bahamas Dollar','[36]',1),('BWP','Botswana Pula','[80]',1),('BYR','Belarus Ruble','[112,46]',1),('BZD','Belize Dollar','[66,90,36]',1),('CAD','Canada Dollar','[36]',1),('CHF','Switzerland Franc','[67,72,70]',1),('CLP','Chile Peso','[36]',1),('CNY','China Yuan Renminbi','[165]',1),('COP','Colombia Peso','[36]',1),('CRC','Costa Rica Colon','[8353]',1),('CUP','Cuba Peso','[8369]',1),('CZK','Czech Republic Koruna','[75,269]',1),('DEM','Deutsch mark',NULL,0),('DKK','Denmark Krone','[107,114]',1),('DOP','Dominican Republic Peso','[82,68,36]',1),('DZD','Algeria Dinar',NULL,1),('EEK','Estonia Kroon','[107,114]',1),('EGP','Egypt Pound','[163]',1),('ESP','Pesete',NULL,0),('EUR','Euro Member Countries','[8364]',1),('FIM','Mark finlandais',NULL,0),('FJD','Fiji Dollar','[36]',1),('FKP','Falkland Islands (Malvinas) Pound','[163]',1),('FRF','Francs francais',NULL,0),('GBP','United Kingdom Pound','[163]',1),('GGP','Guernsey Pound','[163]',1),('GHC','Ghana Cedis','[162]',1),('GIP','Gibraltar Pound','[163]',1),('GRD','Drachme (grece)',NULL,0),('GTQ','Guatemala Quetzal','[81]',1),('GYD','Guyana Dollar','[36]',1),('hhh','ddd','[]',1),('HKD','Hong Kong Dollar','[36]',1),('HNL','Honduras Lempira','[76]',1),('HRK','Croatia Kuna','[107,110]',1),('HUF','Hungary Forint','[70,116]',1),('IDR','Indonesia Rupiah','[82,112]',1),('IEP','Livres irlandaises',NULL,0),('ILS','Israel Shekel','[8362]',1),('IMP','Isle of Man Pound','[163]',1),('INR','India Rupee',NULL,1),('IRR','Iran Rial','[65020]',1),('ISK','Iceland Krona','[107,114]',1),('ITL','Lires',NULL,0),('JEP','Jersey Pound','[163]',1),('JMD','Jamaica Dollar','[74,36]',1),('JPY','Japan Yen','[165]',1),('KES','Kenya Shilling',NULL,1),('KGS','Kyrgyzstan Som','[1083,1074]',1),('KHR','Cambodia Riel','[6107]',1),('KPW','Korea (North) Won','[8361]',1),('KRW','Korea (South) Won','[8361]',1),('KYD','Cayman Islands Dollar','[36]',1),('KZT','Kazakhstan Tenge','[1083,1074]',1),('LAK','Laos Kip','[8365]',1),('LBP','Lebanon Pound','[163]',1),('LKR','Sri Lanka Rupee','[8360]',1),('LRD','Liberia Dollar','[36]',1),('LTL','Lithuania Litas','[76,116]',1),('LUF','Francs luxembourgeois',NULL,0),('LVL','Latvia Lat','[76,115]',1),('MAD','Morocco Dirham',NULL,1),('MKD','Macedonia Denar','[1076,1077,1085]',1),('MNT','Mongolia Tughrik','[8366]',1),('MRO','Mauritania Ouguiya',NULL,1),('MUR','Mauritius Rupee','[8360]',1),('MXN','Mexico Peso','[36]',1),('MXP','Pesos Mexicans',NULL,0),('MYR','Malaysia Ringgit','[82,77]',1),('MZN','Mozambique Metical','[77,84]',1),('NAD','Namibia Dollar','[36]',1),('NGN','Nigeria Naira','[8358]',1),('NIO','Nicaragua Cordoba','[67,36]',1),('NLG','Florins',NULL,0),('NOK','Norway Krone','[107,114]',1),('NPR','Nepal Rupee','[8360]',1),('NZD','New Zealand Dollar','[36]',1),('OMR','Oman Rial','[65020]',1),('PAB','Panama Balboa','[66,47,46]',1),('PEN','Peru Nuevo Sol','[83,47,46]',1),('PHP','Philippines Peso','[8369]',1),('PKR','Pakistan Rupee','[8360]',1),('PLN','Poland Zloty','[122,322]',1),('PTE','Escudos',NULL,0),('PYG','Paraguay Guarani','[71,115]',1),('QAR','Qatar Riyal','[65020]',1),('RON','Romania New Leu','[108,101,105]',1),('RSD','Serbia Dinar','[1044,1080,1085,46]',1),('RUB','Russia Ruble','[1088,1091,1073]',1),('SAR','Saudi Arabia Riyal','[65020]',1),('SBD','Solomon Islands Dollar','[36]',1),('SCR','Seychelles Rupee','[8360]',1),('SEK','Sweden Krona','[107,114]',1),('SGD','Singapore Dollar','[36]',1),('SHP','Saint Helena Pound','[163]',1),('SKK','Couronnes slovaques',NULL,0),('SOS','Somalia Shilling','[83]',1),('SRD','Suriname Dollar','[36]',1),('SUR','Rouble',NULL,0),('SVC','El Salvador Colon','[36]',1),('SYP','Syria Pound','[163]',1),('THB','Thailand Baht','[3647]',1),('TND','Tunisia Dinar',NULL,1),('TRL','Turkey Lira','[84,76]',1),('TRY','Turkey Lira','[8356]',1),('TTD','Trinidad and Tobago Dollar','[84,84,36]',1),('TVD','Tuvalu Dollar','[36]',1),('TWD','Taiwan New Dollar','[78,84,36]',1),('UAH','Ukraine Hryvna','[8372]',1),('USD','United States Dollar','[36]',1),('UYU','Uruguay Peso','[36,85]',1),('UZS','Uzbekistan Som','[1083,1074]',1),('VEF','Venezuela Bolivar Fuerte','[66,115]',1),('VND','Viet Nam Dong','[8363]',1),('XAF','Communaute Financiere Africaine (BEAC) CFA Franc',NULL,1),('XCD','East Caribbean Dollar','[36]',1),('XEU','Ecus',NULL,0),('XOF','Communaute Financiere Africaine (BCEAO) Franc',NULL,1),('XPF','Franc pacifique (XPF)',NULL,1),('YER','Yemen Rial','[65020]',1),('ZAR','South Africa Rand','[82]',1),('ZWD','Zimbabwe Dollar','[90,36]',1); +/*!40000 ALTER TABLE `llx_c_currencies` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_departements` +-- + +DROP TABLE IF EXISTS `llx_c_departements`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_departements` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code_departement` varchar(6) NOT NULL, + `fk_region` int(11) DEFAULT NULL, + `cheflieu` varchar(50) DEFAULT NULL, + `tncc` int(11) DEFAULT NULL, + `ncc` varchar(50) DEFAULT NULL, + `nom` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_departements` (`code_departement`,`fk_region`), + KEY `idx_departements_fk_region` (`fk_region`), + CONSTRAINT `fk_departements_code_region` FOREIGN KEY (`fk_region`) REFERENCES `llx_c_regions` (`code_region`), + CONSTRAINT `fk_departements_fk_region` FOREIGN KEY (`fk_region`) REFERENCES `llx_c_regions` (`code_region`) +) ENGINE=InnoDB AUTO_INCREMENT=2066 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_departements` +-- + +LOCK TABLES `llx_c_departements` WRITE; +/*!40000 ALTER TABLE `llx_c_departements` DISABLE KEYS */; +INSERT INTO `llx_c_departements` VALUES (1,'0',0,'0',0,'-','-',1),(2,'01',82,'01053',5,'AIN','Ain',1),(3,'02',22,'02408',5,'AISNE','Aisne',1),(4,'03',83,'03190',5,'ALLIER','Allier',1),(5,'04',93,'04070',4,'ALPES-DE-HAUTE-PROVENCE','Alpes-de-Haute-Provence',1),(6,'05',93,'05061',4,'HAUTES-ALPES','Hautes-Alpes',1),(7,'06',93,'06088',4,'ALPES-MARITIMES','Alpes-Maritimes',1),(8,'07',82,'07186',5,'ARDECHE','Ardèche',1),(9,'08',21,'08105',4,'ARDENNES','Ardennes',1),(10,'09',73,'09122',5,'ARIEGE','Ariège',1),(11,'10',21,'10387',5,'AUBE','Aube',1),(12,'11',91,'11069',5,'AUDE','Aude',1),(13,'12',73,'12202',5,'AVEYRON','Aveyron',1),(14,'13',93,'13055',4,'BOUCHES-DU-RHONE','Bouches-du-Rhône',1),(15,'14',25,'14118',2,'CALVADOS','Calvados',1),(16,'15',83,'15014',2,'CANTAL','Cantal',1),(17,'16',54,'16015',3,'CHARENTE','Charente',1),(18,'17',54,'17300',3,'CHARENTE-MARITIME','Charente-Maritime',1),(19,'18',24,'18033',2,'CHER','Cher',1),(20,'19',74,'19272',3,'CORREZE','Corrèze',1),(21,'2A',94,'2A004',3,'CORSE-DU-SUD','Corse-du-Sud',1),(22,'2B',94,'2B033',3,'HAUTE-CORSE','Haute-Corse',1),(23,'21',26,'21231',3,'COTE-D\'OR','Côte-d\'Or',1),(24,'22',53,'22278',4,'COTES-D\'ARMOR','Côtes-d\'Armor',1),(25,'23',74,'23096',3,'CREUSE','Creuse',1),(26,'24',72,'24322',3,'DORDOGNE','Dordogne',1),(27,'25',43,'25056',2,'DOUBS','Doubs',1),(28,'26',82,'26362',3,'DROME','Drôme',1),(29,'27',23,'27229',5,'EURE','Eure',1),(30,'28',24,'28085',1,'EURE-ET-LOIR','Eure-et-Loir',1),(31,'29',53,'29232',2,'FINISTERE','Finistère',1),(32,'30',91,'30189',2,'GARD','Gard',1),(33,'31',73,'31555',3,'HAUTE-GARONNE','Haute-Garonne',1),(34,'32',73,'32013',2,'GERS','Gers',1),(35,'33',72,'33063',3,'GIRONDE','Gironde',1),(36,'34',91,'34172',5,'HERAULT','Hérault',1),(37,'35',53,'35238',1,'ILLE-ET-VILAINE','Ille-et-Vilaine',1),(38,'36',24,'36044',5,'INDRE','Indre',1),(39,'37',24,'37261',1,'INDRE-ET-LOIRE','Indre-et-Loire',1),(40,'38',82,'38185',5,'ISERE','Isère',1),(41,'39',43,'39300',2,'JURA','Jura',1),(42,'40',72,'40192',4,'LANDES','Landes',1),(43,'41',24,'41018',0,'LOIR-ET-CHER','Loir-et-Cher',1),(44,'42',82,'42218',3,'LOIRE','Loire',1),(45,'43',83,'43157',3,'HAUTE-LOIRE','Haute-Loire',1),(46,'44',52,'44109',3,'LOIRE-ATLANTIQUE','Loire-Atlantique',1),(47,'45',24,'45234',2,'LOIRET','Loiret',1),(48,'46',73,'46042',2,'LOT','Lot',1),(49,'47',72,'47001',0,'LOT-ET-GARONNE','Lot-et-Garonne',1),(50,'48',91,'48095',3,'LOZERE','Lozère',1),(51,'49',52,'49007',0,'MAINE-ET-LOIRE','Maine-et-Loire',1),(52,'50',25,'50502',3,'MANCHE','Manche',1),(53,'51',21,'51108',3,'MARNE','Marne',1),(54,'52',21,'52121',3,'HAUTE-MARNE','Haute-Marne',1),(55,'53',52,'53130',3,'MAYENNE','Mayenne',1),(56,'54',41,'54395',0,'MEURTHE-ET-MOSELLE','Meurthe-et-Moselle',1),(57,'55',41,'55029',3,'MEUSE','Meuse',1),(58,'56',53,'56260',2,'MORBIHAN','Morbihan',1),(59,'57',41,'57463',3,'MOSELLE','Moselle',1),(60,'58',26,'58194',3,'NIEVRE','Nièvre',1),(61,'59',31,'59350',2,'NORD','Nord',1),(62,'60',22,'60057',5,'OISE','Oise',1),(63,'61',25,'61001',5,'ORNE','Orne',1),(64,'62',31,'62041',2,'PAS-DE-CALAIS','Pas-de-Calais',1),(65,'63',83,'63113',2,'PUY-DE-DOME','Puy-de-Dôme',1),(66,'64',72,'64445',4,'PYRENEES-ATLANTIQUES','Pyrénées-Atlantiques',1),(67,'65',73,'65440',4,'HAUTES-PYRENEES','Hautes-Pyrénées',1),(68,'66',91,'66136',4,'PYRENEES-ORIENTALES','Pyrénées-Orientales',1),(69,'67',42,'67482',2,'BAS-RHIN','Bas-Rhin',1),(70,'68',42,'68066',2,'HAUT-RHIN','Haut-Rhin',1),(71,'69',82,'69123',2,'RHONE','Rhône',1),(72,'70',43,'70550',3,'HAUTE-SAONE','Haute-Saône',1),(73,'71',26,'71270',0,'SAONE-ET-LOIRE','Saône-et-Loire',1),(74,'72',52,'72181',3,'SARTHE','Sarthe',1),(75,'73',82,'73065',3,'SAVOIE','Savoie',1),(76,'74',82,'74010',3,'HAUTE-SAVOIE','Haute-Savoie',1),(77,'75',11,'75056',0,'PARIS','Paris',1),(78,'76',23,'76540',3,'SEINE-MARITIME','Seine-Maritime',1),(79,'77',11,'77288',0,'SEINE-ET-MARNE','Seine-et-Marne',1),(80,'78',11,'78646',4,'YVELINES','Yvelines',1),(81,'79',54,'79191',4,'DEUX-SEVRES','Deux-Sèvres',1),(82,'80',22,'80021',3,'SOMME','Somme',1),(83,'81',73,'81004',2,'TARN','Tarn',1),(84,'82',73,'82121',0,'TARN-ET-GARONNE','Tarn-et-Garonne',1),(85,'83',93,'83137',2,'VAR','Var',1),(86,'84',93,'84007',0,'VAUCLUSE','Vaucluse',1),(87,'85',52,'85191',3,'VENDEE','Vendée',1),(88,'86',54,'86194',3,'VIENNE','Vienne',1),(89,'87',74,'87085',3,'HAUTE-VIENNE','Haute-Vienne',1),(90,'88',41,'88160',4,'VOSGES','Vosges',1),(91,'89',26,'89024',5,'YONNE','Yonne',1),(92,'90',43,'90010',0,'TERRITOIRE DE BELFORT','Territoire de Belfort',1),(93,'91',11,'91228',5,'ESSONNE','Essonne',1),(94,'92',11,'92050',4,'HAUTS-DE-SEINE','Hauts-de-Seine',1),(95,'93',11,'93008',3,'SEINE-SAINT-DENIS','Seine-Saint-Denis',1),(96,'94',11,'94028',2,'VAL-DE-MARNE','Val-de-Marne',1),(97,'95',11,'95500',2,'VAL-D\'OISE','Val-d\'Oise',1),(98,'971',1,'97105',3,'GUADELOUPE','Guadeloupe',1),(99,'972',2,'97209',3,'MARTINIQUE','Martinique',1),(100,'973',3,'97302',3,'GUYANE','Guyane',1),(101,'974',4,'97411',3,'REUNION','Réunion',1),(102,'01',201,'',1,'ANVERS','Anvers',1),(103,'02',203,'',3,'BRUXELLES-CAPITALE','Bruxelles-Capitale',1),(104,'03',202,'',2,'BRABANT-WALLON','Brabant-Wallon',1),(105,'04',201,'',1,'BRABANT-FLAMAND','Brabant-Flamand',1),(106,'05',201,'',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale',1),(107,'06',201,'',1,'FLANDRE-ORIENTALE','Flandre-Orientale',1),(108,'07',202,'',2,'HAINAUT','Hainaut',1),(109,'08',201,'',2,'LIEGE','Liège',1),(110,'09',202,'',1,'LIMBOURG','Limbourg',1),(111,'10',202,'',2,'LUXEMBOURG','Luxembourg',1),(112,'11',201,'',2,'NAMUR','Namur',1),(113,'NSW',2801,'',1,'','New South Wales',1),(114,'VIC',2801,'',1,'','Victoria',1),(115,'QLD',2801,'',1,'','Queensland',1),(116,'SA',2801,'',1,'','South Australia',1),(117,'ACT',2801,'',1,'','Australia Capital Territory',1),(118,'TAS',2801,'',1,'','Tasmania',1),(119,'WA',2801,'',1,'','Western Australia',1),(120,'NT',2801,'',1,'','Northern Territory',1),(121,'VI',419,'',19,'ALAVA','Álava',1),(122,'AB',404,'',4,'ALBACETE','Albacete',1),(123,'A',411,'',11,'ALICANTE','Alicante',1),(124,'AL',401,'',1,'ALMERIA','Almería',1),(125,'AV',403,'',3,'AVILA','Avila',1),(126,'BA',412,'',12,'BADAJOZ','Badajoz',1),(127,'PM',414,'',14,'ISLAS BALEARES','Islas Baleares',1),(128,'B',406,'',6,'BARCELONA','Barcelona',1),(129,'BU',403,'',8,'BURGOS','Burgos',1),(130,'CC',412,'',12,'CACERES','Cáceres',1),(131,'CA',401,'',1,'CADIz','Cádiz',1),(132,'CS',411,'',11,'CASTELLON','Castellón',1),(133,'CR',404,'',4,'CIUDAD REAL','Ciudad Real',1),(134,'CO',401,'',1,'CORDOBA','Córdoba',1),(135,'C',413,'',13,'LA CORUÑA','La Coruña',1),(136,'CU',404,'',4,'CUENCA','Cuenca',1),(137,'GI',406,'',6,'GERONA','Gerona',1),(138,'GR',401,'',1,'GRANADA','Granada',1),(139,'GU',404,'',4,'GUADALAJARA','Guadalajara',1),(140,'SS',419,'',19,'GUIPUZCOA','Guipúzcoa',1),(141,'H',401,'',1,'HUELVA','Huelva',1),(142,'HU',402,'',2,'HUESCA','Huesca',1),(143,'J',401,'',1,'JAEN','Jaén',1),(144,'LE',403,'',3,'LEON','León',1),(145,'L',406,'',6,'LERIDA','Lérida',1),(146,'LO',415,'',15,'LA RIOJA','La Rioja',1),(147,'LU',413,'',13,'LUGO','Lugo',1),(148,'M',416,'',16,'MADRID','Madrid',1),(149,'MA',401,'',1,'MALAGA','Málaga',1),(150,'MU',417,'',17,'MURCIA','Murcia',1),(151,'NA',408,'',8,'NAVARRA','Navarra',1),(152,'OR',413,'',13,'ORENSE','Orense',1),(153,'O',418,'',18,'ASTURIAS','Asturias',1),(154,'P',403,'',3,'PALENCIA','Palencia',1),(155,'GC',405,'',5,'LAS PALMAS','Las Palmas',1),(156,'PO',413,'',13,'PONTEVEDRA','Pontevedra',1),(157,'SA',403,'',3,'SALAMANCA','Salamanca',1),(158,'TF',405,'',5,'STA. CRUZ DE TENERIFE','Sta. Cruz de Tenerife',1),(159,'S',410,'',10,'CANTABRIA','Cantabria',1),(160,'SG',403,'',3,'SEGOVIA','Segovia',1),(161,'SE',401,'',1,'SEVILLA','Sevilla',1),(162,'SO',403,'',3,'SORIA','Soria',1),(163,'T',406,'',6,'TARRAGONA','Tarragona',1),(164,'TE',402,'',2,'TERUEL','Teruel',1),(165,'TO',404,'',5,'TOLEDO','Toledo',1),(166,'V',411,'',11,'VALENCIA','Valencia',1),(167,'VA',403,'',3,'VALLADOLID','Valladolid',1),(168,'BI',419,'',19,'VIZCAYA','Vizcaya',1),(169,'ZA',403,'',3,'ZAMORA','Zamora',1),(170,'Z',402,'',1,'ZARAGOZA','Zaragoza',1),(171,'CE',407,'',7,'CEUTA','Ceuta',1),(172,'ML',409,'',9,'MELILLA','Melilla',1),(174,'AG',601,NULL,NULL,'ARGOVIE','Argovie',1),(175,'AI',601,NULL,NULL,'APPENZELL RHODES INTERIEURES','Appenzell Rhodes intérieures',1),(176,'AR',601,NULL,NULL,'APPENZELL RHODES EXTERIEURES','Appenzell Rhodes extérieures',1),(177,'BE',601,NULL,NULL,'BERNE','Berne',1),(178,'BL',601,NULL,NULL,'BALE CAMPAGNE','Bâle Campagne',1),(179,'BS',601,NULL,NULL,'BALE VILLE','Bâle Ville',1),(180,'FR',601,NULL,NULL,'FRIBOURG','Fribourg',1),(181,'GE',601,NULL,NULL,'GENEVE','Genève',1),(182,'GL',601,NULL,NULL,'GLARIS','Glaris',1),(183,'GR',601,NULL,NULL,'GRISONS','Grisons',1),(184,'JU',601,NULL,NULL,'JURA','Jura',1),(185,'LU',601,NULL,NULL,'LUCERNE','Lucerne',1),(186,'NE',601,NULL,NULL,'NEUCHATEL','Neuchâtel',1),(187,'NW',601,NULL,NULL,'NIDWALD','Nidwald',1),(188,'OW',601,NULL,NULL,'OBWALD','Obwald',1),(189,'SG',601,NULL,NULL,'SAINT-GALL','Saint-Gall',1),(190,'SH',601,NULL,NULL,'SCHAFFHOUSE','Schaffhouse',1),(191,'SO',601,NULL,NULL,'SOLEURE','Soleure',1),(192,'SZ',601,NULL,NULL,'SCHWYZ','Schwyz',1),(193,'TG',601,NULL,NULL,'THURGOVIE','Thurgovie',1),(194,'TI',601,NULL,NULL,'TESSIN','Tessin',1),(195,'UR',601,NULL,NULL,'URI','Uri',1),(196,'VD',601,NULL,NULL,'VAUD','Vaud',1),(197,'VS',601,NULL,NULL,'VALAIS','Valais',1),(198,'ZG',601,NULL,NULL,'ZUG','Zug',1),(199,'ZH',601,NULL,NULL,'ZURICH','Zürich',1),(200,'AL',1101,'',0,'ALABAMA','Alabama',1),(201,'AK',1101,'',0,'ALASKA','Alaska',1),(202,'AZ',1101,'',0,'ARIZONA','Arizona',1),(203,'AR',1101,'',0,'ARKANSAS','Arkansas',1),(204,'CA',1101,'',0,'CALIFORNIA','California',1),(205,'CO',1101,'',0,'COLORADO','Colorado',1),(206,'CT',1101,'',0,'CONNECTICUT','Connecticut',1),(207,'DE',1101,'',0,'DELAWARE','Delaware',1),(208,'FL',1101,'',0,'FLORIDA','Florida',1),(209,'GA',1101,'',0,'GEORGIA','Georgia',1),(210,'HI',1101,'',0,'HAWAII','Hawaii',1),(211,'ID',1101,'',0,'IDAHO','Idaho',1),(212,'IL',1101,'',0,'ILLINOIS','Illinois',1),(213,'IN',1101,'',0,'INDIANA','Indiana',1),(214,'IA',1101,'',0,'IOWA','Iowa',1),(215,'KS',1101,'',0,'KANSAS','Kansas',1),(216,'KY',1101,'',0,'KENTUCKY','Kentucky',1),(217,'LA',1101,'',0,'LOUISIANA','Louisiana',1),(218,'ME',1101,'',0,'MAINE','Maine',1),(219,'MD',1101,'',0,'MARYLAND','Maryland',1),(220,'MA',1101,'',0,'MASSACHUSSETTS','Massachusetts',1),(221,'MI',1101,'',0,'MICHIGAN','Michigan',1),(222,'MN',1101,'',0,'MINNESOTA','Minnesota',1),(223,'MS',1101,'',0,'MISSISSIPPI','Mississippi',1),(224,'MO',1101,'',0,'MISSOURI','Missouri',1),(225,'MT',1101,'',0,'MONTANA','Montana',1),(226,'NE',1101,'',0,'NEBRASKA','Nebraska',1),(227,'NV',1101,'',0,'NEVADA','Nevada',1),(228,'NH',1101,'',0,'NEW HAMPSHIRE','New Hampshire',1),(229,'NJ',1101,'',0,'NEW JERSEY','New Jersey',1),(230,'NM',1101,'',0,'NEW MEXICO','New Mexico',1),(231,'NY',1101,'',0,'NEW YORK','New York',1),(232,'NC',1101,'',0,'NORTH CAROLINA','North Carolina',1),(233,'ND',1101,'',0,'NORTH DAKOTA','North Dakota',1),(234,'OH',1101,'',0,'OHIO','Ohio',1),(235,'OK',1101,'',0,'OKLAHOMA','Oklahoma',1),(236,'OR',1101,'',0,'OREGON','Oregon',1),(237,'PA',1101,'',0,'PENNSYLVANIA','Pennsylvania',1),(238,'RI',1101,'',0,'RHODE ISLAND','Rhode Island',1),(239,'SC',1101,'',0,'SOUTH CAROLINA','South Carolina',1),(240,'SD',1101,'',0,'SOUTH DAKOTA','South Dakota',1),(241,'TN',1101,'',0,'TENNESSEE','Tennessee',1),(242,'TX',1101,'',0,'TEXAS','Texas',1),(243,'UT',1101,'',0,'UTAH','Utah',1),(244,'VT',1101,'',0,'VERMONT','Vermont',1),(245,'VA',1101,'',0,'VIRGINIA','Virginia',1),(246,'WA',1101,'',0,'WASHINGTON','Washington',1),(247,'WV',1101,'',0,'WEST VIRGINIA','West Virginia',1),(248,'WI',1101,'',0,'WISCONSIN','Wisconsin',1),(249,'WY',1101,'',0,'WYOMING','Wyoming',1),(250,'SS',8601,NULL,NULL,NULL,'San Salvador',1),(251,'SA',8603,NULL,NULL,NULL,'Santa Ana',1),(252,'AH',8603,NULL,NULL,NULL,'Ahuachapan',1),(253,'SO',8603,NULL,NULL,NULL,'Sonsonate',1),(254,'US',8602,NULL,NULL,NULL,'Usulutan',1),(255,'SM',8602,NULL,NULL,NULL,'San Miguel',1),(256,'MO',8602,NULL,NULL,NULL,'Morazan',1),(257,'LU',8602,NULL,NULL,NULL,'La Union',1),(258,'LL',8601,NULL,NULL,NULL,'La Libertad',1),(259,'CH',8601,NULL,NULL,NULL,'Chalatenango',1),(260,'CA',8601,NULL,NULL,NULL,'Cabañas',1),(261,'LP',8601,NULL,NULL,NULL,'La Paz',1),(262,'SV',8601,NULL,NULL,NULL,'San Vicente',1),(263,'CU',8601,NULL,NULL,NULL,'Cuscatlan',1),(264,'2301',2301,'',0,'CATAMARCA','Catamarca',1),(265,'2302',2301,'',0,'JUJUY','Jujuy',1),(266,'2303',2301,'',0,'TUCAMAN','Tucamán',1),(267,'2304',2301,'',0,'SANTIAGO DEL ESTERO','Santiago del Estero',1),(268,'2305',2301,'',0,'SALTA','Salta',1),(269,'2306',2302,'',0,'CHACO','Chaco',1),(270,'2307',2302,'',0,'CORRIENTES','Corrientes',1),(271,'2308',2302,'',0,'ENTRE RIOS','Entre Ríos',1),(272,'2309',2302,'',0,'FORMOSA','Formosa',1),(273,'2310',2302,'',0,'SANTA FE','Santa Fe',1),(274,'2311',2303,'',0,'LA RIOJA','La Rioja',1),(275,'2312',2303,'',0,'MENDOZA','Mendoza',1),(276,'2313',2303,'',0,'SAN JUAN','San Juan',1),(277,'2314',2303,'',0,'SAN LUIS','San Luis',1),(278,'2315',2304,'',0,'CORDOBA','Córdoba',1),(279,'2316',2304,'',0,'BUENOS AIRES','Buenos Aires',1),(280,'2317',2304,'',0,'CABA','Caba',1),(281,'2318',2305,'',0,'LA PAMPA','La Pampa',1),(282,'2319',2305,'',0,'NEUQUEN','Neuquén',1),(283,'2320',2305,'',0,'RIO NEGRO','Río Negro',1),(284,'2321',2305,'',0,'CHUBUT','Chubut',1),(285,'2322',2305,'',0,'SANTA CRUZ','Santa Cruz',1),(286,'2323',2305,'',0,'TIERRA DEL FUEGO','Tierra del Fuego',1),(287,'2324',2305,'',0,'ISLAS MALVINAS','Islas Malvinas',1),(288,'2325',2305,'',0,'ANTARTIDA','Antártida',1),(289,'AN',11701,NULL,0,'AN','Andaman & Nicobar',1),(290,'AP',11701,NULL,0,'AP','Andhra Pradesh',1),(291,'AR',11701,NULL,0,'AR','Arunachal Pradesh',1),(292,'AS',11701,NULL,0,'AS','Assam',1),(293,'BR',11701,NULL,0,'BR','Bihar',1),(294,'CG',11701,NULL,0,'CG','Chattisgarh',1),(295,'CH',11701,NULL,0,'CH','Chandigarh',1),(296,'DD',11701,NULL,0,'DD','Daman & Diu',1),(297,'DL',11701,NULL,0,'DL','Delhi',1),(298,'DN',11701,NULL,0,'DN','Dadra and Nagar Haveli',1),(299,'GA',11701,NULL,0,'GA','Goa',1),(300,'GJ',11701,NULL,0,'GJ','Gujarat',1),(301,'HP',11701,NULL,0,'HP','Himachal Pradesh',1),(302,'HR',11701,NULL,0,'HR','Haryana',1),(303,'JH',11701,NULL,0,'JH','Jharkhand',1),(304,'JK',11701,NULL,0,'JK','Jammu & Kashmir',1),(305,'KA',11701,NULL,0,'KA','Karnataka',1),(306,'KL',11701,NULL,0,'KL','Kerala',1),(307,'LD',11701,NULL,0,'LD','Lakshadweep',1),(308,'MH',11701,NULL,0,'MH','Maharashtra',1),(309,'ML',11701,NULL,0,'ML','Meghalaya',1),(310,'MN',11701,NULL,0,'MN','Manipur',1),(311,'MP',11701,NULL,0,'MP','Madhya Pradesh',1),(312,'MZ',11701,NULL,0,'MZ','Mizoram',1),(313,'NL',11701,NULL,0,'NL','Nagaland',1),(314,'OR',11701,NULL,0,'OR','Orissa',1),(315,'PB',11701,NULL,0,'PB','Punjab',1),(316,'PY',11701,NULL,0,'PY','Puducherry',1),(317,'RJ',11701,NULL,0,'RJ','Rajasthan',1),(318,'SK',11701,NULL,0,'SK','Sikkim',1),(319,'TN',11701,NULL,0,'TN','Tamil Nadu',1),(320,'TR',11701,NULL,0,'TR','Tripura',1),(321,'UL',11701,NULL,0,'UL','Uttarakhand',1),(322,'UP',11701,NULL,0,'UP','Uttar Pradesh',1),(323,'WB',11701,NULL,0,'WB','West Bengal',1),(374,'151',6715,'',0,'151','Arica',1),(375,'152',6715,'',0,'152','Parinacota',1),(376,'011',6701,'',0,'011','Iquique',1),(377,'014',6701,'',0,'014','Tamarugal',1),(378,'021',6702,'',0,'021','Antofagasa',1),(379,'022',6702,'',0,'022','El Loa',1),(380,'023',6702,'',0,'023','Tocopilla',1),(381,'031',6703,'',0,'031','Copiapó',1),(382,'032',6703,'',0,'032','Chañaral',1),(383,'033',6703,'',0,'033','Huasco',1),(384,'041',6704,'',0,'041','Elqui',1),(385,'042',6704,'',0,'042','Choapa',1),(386,'043',6704,'',0,'043','Limarí',1),(387,'051',6705,'',0,'051','Valparaíso',1),(388,'052',6705,'',0,'052','Isla de Pascua',1),(389,'053',6705,'',0,'053','Los Andes',1),(390,'054',6705,'',0,'054','Petorca',1),(391,'055',6705,'',0,'055','Quillota',1),(392,'056',6705,'',0,'056','San Antonio',1),(393,'057',6705,'',0,'057','San Felipe de Aconcagua',1),(394,'058',6705,'',0,'058','Marga Marga',1),(395,'061',6706,'',0,'061','Cachapoal',1),(396,'062',6706,'',0,'062','Cardenal Caro',1),(397,'063',6706,'',0,'063','Colchagua',1),(398,'071',6707,'',0,'071','Talca',1),(399,'072',6707,'',0,'072','Cauquenes',1),(400,'073',6707,'',0,'073','Curicó',1),(401,'074',6707,'',0,'074','Linares',1),(402,'081',6708,'',0,'081','Concepción',1),(403,'082',6708,'',0,'082','Arauco',1),(404,'083',6708,'',0,'083','Biobío',1),(405,'084',6708,'',0,'084','Ñuble',1),(406,'091',6709,'',0,'091','Cautín',1),(407,'092',6709,'',0,'092','Malleco',1),(408,'141',6714,'',0,'141','Valdivia',1),(409,'142',6714,'',0,'142','Ranco',1),(410,'101',6710,'',0,'101','Llanquihue',1),(411,'102',6710,'',0,'102','Chiloé',1),(412,'103',6710,'',0,'103','Osorno',1),(413,'104',6710,'',0,'104','Palena',1),(414,'111',6711,'',0,'111','Coihaique',1),(415,'112',6711,'',0,'112','Aisén',1),(416,'113',6711,'',0,'113','Capitán Prat',1),(417,'114',6711,'',0,'114','General Carrera',1),(418,'121',6712,'',0,'121','Magallanes',1),(419,'122',6712,'',0,'122','Antártica Chilena',1),(420,'123',6712,'',0,'123','Tierra del Fuego',1),(421,'124',6712,'',0,'124','Última Esperanza',1),(422,'131',6713,'',0,'131','Santiago',1),(423,'132',6713,'',0,'132','Cordillera',1),(424,'133',6713,'',0,'133','Chacabuco',1),(425,'134',6713,'',0,'134','Maipo',1),(426,'135',6713,'',0,'135','Melipilla',1),(427,'136',6713,'',0,'136','Talagante',1),(428,'DIF',15401,'',0,'DIF','Distrito Federal',1),(429,'AGS',15401,'',0,'AGS','Aguascalientes',1),(430,'BCN',15401,'',0,'BCN','Baja California Norte',1),(431,'BCS',15401,'',0,'BCS','Baja California Sur',1),(432,'CAM',15401,'',0,'CAM','Campeche',1),(433,'CHP',15401,'',0,'CHP','Chiapas',1),(434,'CHI',15401,'',0,'CHI','Chihuahua',1),(435,'COA',15401,'',0,'COA','Coahuila',1),(436,'COL',15401,'',0,'COL','Colima',1),(437,'DUR',15401,'',0,'DUR','Durango',1),(438,'GTO',15401,'',0,'GTO','Guanajuato',1),(439,'GRO',15401,'',0,'GRO','Guerrero',1),(440,'HGO',15401,'',0,'HGO','Hidalgo',1),(441,'JAL',15401,'',0,'JAL','Jalisco',1),(442,'MEX',15401,'',0,'MEX','México',1),(443,'MIC',15401,'',0,'MIC','Michoacán de Ocampo',1),(444,'MOR',15401,'',0,'MOR','Morelos',1),(445,'NAY',15401,'',0,'NAY','Nayarit',1),(446,'NLE',15401,'',0,'NLE','Nuevo León',1),(447,'OAX',15401,'',0,'OAX','Oaxaca',1),(448,'PUE',15401,'',0,'PUE','Puebla',1),(449,'QRO',15401,'',0,'QRO','Querétaro',1),(451,'ROO',15401,'',0,'ROO','Quintana Roo',1),(452,'SLP',15401,'',0,'SLP','San Luis Potosí',1),(453,'SIN',15401,'',0,'SIN','Sinaloa',1),(454,'SON',15401,'',0,'SON','Sonora',1),(455,'TAB',15401,'',0,'TAB','Tabasco',1),(456,'TAM',15401,'',0,'TAM','Tamaulipas',1),(457,'TLX',15401,'',0,'TLX','Tlaxcala',1),(458,'VER',15401,'',0,'VER','Veracruz',1),(459,'YUC',15401,'',0,'YUC','Yucatán',1),(460,'ZAC',15401,'',0,'ZAC','Zacatecas',1),(461,'ANT',7001,'',0,'ANT','Antioquia',1),(462,'BOL',7001,'',0,'BOL','Bolívar',1),(463,'BOY',7001,'',0,'BOY','Boyacá',1),(464,'CAL',7001,'',0,'CAL','Caldas',1),(465,'CAU',7001,'',0,'CAU','Cauca',1),(466,'CUN',7001,'',0,'CUN','Cundinamarca',1),(467,'HUI',7001,'',0,'HUI','Huila',1),(468,'LAG',7001,'',0,'LAG','La Guajira',1),(469,'MET',7001,'',0,'MET','Meta',1),(470,'NAR',7001,'',0,'NAR','Nariño',1),(471,'NDS',7001,'',0,'NDS','Norte de Santander',1),(472,'SAN',7001,'',0,'SAN','Santander',1),(473,'SUC',7001,'',0,'SUC','Sucre',1),(474,'TOL',7001,'',0,'TOL','Tolima',1),(475,'VAC',7001,'',0,'VAC','Valle del Cauca',1),(476,'RIS',7001,'',0,'RIS','Risalda',1),(477,'ATL',7001,'',0,'ATL','Atlántico',1),(478,'COR',7001,'',0,'COR','Córdoba',1),(479,'SAP',7001,'',0,'SAP','San Andrés, Providencia y Santa Catalina',1),(480,'ARA',7001,'',0,'ARA','Arauca',1),(481,'CAS',7001,'',0,'CAS','Casanare',1),(482,'AMA',7001,'',0,'AMA','Amazonas',1),(483,'CAQ',7001,'',0,'CAQ','Caquetá',1),(484,'CHO',7001,'',0,'CHO','Chocó',1),(485,'GUA',7001,'',0,'GUA','Guainía',1),(486,'GUV',7001,'',0,'GUV','Guaviare',1),(487,'PUT',7001,'',0,'PUT','Putumayo',1),(488,'QUI',7001,'',0,'QUI','Quindío',1),(489,'VAU',7001,'',0,'VAU','Vaupés',1),(490,'BOG',7001,'',0,'BOG','Bogotá',1),(491,'VID',7001,'',0,'VID','Vichada',1),(492,'CES',7001,'',0,'CES','Cesar',1),(493,'MAG',7001,'',0,'MAG','Magdalena',1),(494,'AT',11401,'',0,'AT','Atlántida',1),(495,'CH',11401,'',0,'CH','Choluteca',1),(496,'CL',11401,'',0,'CL','Colón',1),(497,'CM',11401,'',0,'CM','Comayagua',1),(498,'CO',11401,'',0,'CO','Copán',1),(499,'CR',11401,'',0,'CR','Cortés',1),(500,'EP',11401,'',0,'EP','El Paraíso',1),(501,'FM',11401,'',0,'FM','Francisco Morazán',1),(502,'GD',11401,'',0,'GD','Gracias a Dios',1),(503,'IN',11401,'',0,'IN','Intibucá',1),(504,'IB',11401,'',0,'IB','Islas de la Bahía',1),(505,'LP',11401,'',0,'LP','La Paz',1),(506,'LM',11401,'',0,'LM','Lempira',1),(507,'OC',11401,'',0,'OC','Ocotepeque',1),(508,'OL',11401,'',0,'OL','Olancho',1),(509,'SB',11401,'',0,'SB','Santa Bárbara',1),(510,'VL',11401,'',0,'VL','Valle',1),(511,'YO',11401,'',0,'YO','Yoro',1),(512,'DC',11401,'',0,'DC','Distrito Central',1),(652,'CC',4601,'Oistins',0,'CC','Christ Church',1),(655,'SA',4601,'Greenland',0,'SA','Saint Andrew',1),(656,'SG',4601,'Bulkeley',0,'SG','Saint George',1),(657,'JA',4601,'Holetown',0,'JA','Saint James',1),(658,'SJ',4601,'Four Roads',0,'SJ','Saint John',1),(659,'SB',4601,'Bathsheba',0,'SB','Saint Joseph',1),(660,'SL',4601,'Crab Hill',0,'SL','Saint Lucy',1),(661,'SM',4601,'Bridgetown',0,'SM','Saint Michael',1),(662,'SP',4601,'Speightstown',0,'SP','Saint Peter',1),(663,'SC',4601,'Crane',0,'SC','Saint Philip',1),(664,'ST',4601,'Hillaby',0,'ST','Saint Thomas',1),(777,'AG',315,NULL,NULL,NULL,'AGRIGENTO',1),(778,'AL',312,NULL,NULL,NULL,'ALESSANDRIA',1),(779,'AN',310,NULL,NULL,NULL,'ANCONA',1),(780,'AO',319,NULL,NULL,NULL,'AOSTA',1),(781,'AR',316,NULL,NULL,NULL,'AREZZO',1),(782,'AP',310,NULL,NULL,NULL,'ASCOLI PICENO',1),(783,'AT',312,NULL,NULL,NULL,'ASTI',1),(784,'AV',304,NULL,NULL,NULL,'AVELLINO',1),(785,'BA',313,NULL,NULL,NULL,'BARI',1),(786,'BT',313,NULL,NULL,NULL,'BARLETTA-ANDRIA-TRANI',1),(787,'BL',320,NULL,NULL,NULL,'BELLUNO',1),(788,'BN',304,NULL,NULL,NULL,'BENEVENTO',1),(789,'BG',309,NULL,NULL,NULL,'BERGAMO',1),(790,'BI',312,NULL,NULL,NULL,'BIELLA',1),(791,'BO',305,NULL,NULL,NULL,'BOLOGNA',1),(792,'BZ',317,NULL,NULL,NULL,'BOLZANO',1),(793,'BS',309,NULL,NULL,NULL,'BRESCIA',1),(794,'BR',313,NULL,NULL,NULL,'BRINDISI',1),(795,'CA',314,NULL,NULL,NULL,'CAGLIARI',1),(796,'CL',315,NULL,NULL,NULL,'CALTANISSETTA',1),(797,'CB',311,NULL,NULL,NULL,'CAMPOBASSO',1),(798,'CI',314,NULL,NULL,NULL,'CARBONIA-IGLESIAS',1),(799,'CE',304,NULL,NULL,NULL,'CASERTA',1),(800,'CT',315,NULL,NULL,NULL,'CATANIA',1),(801,'CZ',303,NULL,NULL,NULL,'CATANZARO',1),(802,'CH',301,NULL,NULL,NULL,'CHIETI',1),(803,'CO',309,NULL,NULL,NULL,'COMO',1),(804,'CS',303,NULL,NULL,NULL,'COSENZA',1),(805,'CR',309,NULL,NULL,NULL,'CREMONA',1),(806,'KR',303,NULL,NULL,NULL,'CROTONE',1),(807,'CN',312,NULL,NULL,NULL,'CUNEO',1),(808,'EN',315,NULL,NULL,NULL,'ENNA',1),(809,'FM',310,NULL,NULL,NULL,'FERMO',1),(810,'FE',305,NULL,NULL,NULL,'FERRARA',1),(811,'FI',316,NULL,NULL,NULL,'FIRENZE',1),(812,'FG',313,NULL,NULL,NULL,'FOGGIA',1),(813,'FC',305,NULL,NULL,NULL,'FORLI-CESENA',1),(814,'FR',307,NULL,NULL,NULL,'FROSINONE',1),(815,'GE',308,NULL,NULL,NULL,'GENOVA',1),(816,'GO',306,NULL,NULL,NULL,'GORIZIA',1),(817,'GR',316,NULL,NULL,NULL,'GROSSETO',1),(818,'IM',308,NULL,NULL,NULL,'IMPERIA',1),(819,'IS',311,NULL,NULL,NULL,'ISERNIA',1),(820,'SP',308,NULL,NULL,NULL,'LA SPEZIA',1),(821,'AQ',301,NULL,NULL,NULL,'L AQUILA',1),(822,'LT',307,NULL,NULL,NULL,'LATINA',1),(823,'LE',313,NULL,NULL,NULL,'LECCE',1),(824,'LC',309,NULL,NULL,NULL,'LECCO',1),(825,'LI',314,NULL,NULL,NULL,'LIVORNO',1),(826,'LO',309,NULL,NULL,NULL,'LODI',1),(827,'LU',316,NULL,NULL,NULL,'LUCCA',1),(828,'MC',310,NULL,NULL,NULL,'MACERATA',1),(829,'MN',309,NULL,NULL,NULL,'MANTOVA',1),(830,'MS',316,NULL,NULL,NULL,'MASSA-CARRARA',1),(831,'MT',302,NULL,NULL,NULL,'MATERA',1),(832,'VS',314,NULL,NULL,NULL,'MEDIO CAMPIDANO',1),(833,'ME',315,NULL,NULL,NULL,'MESSINA',1),(834,'MI',309,NULL,NULL,NULL,'MILANO',1),(835,'MB',309,NULL,NULL,NULL,'MONZA e BRIANZA',1),(836,'MO',305,NULL,NULL,NULL,'MODENA',1),(837,'NA',304,NULL,NULL,NULL,'NAPOLI',1),(838,'NO',312,NULL,NULL,NULL,'NOVARA',1),(839,'NU',314,NULL,NULL,NULL,'NUORO',1),(840,'OG',314,NULL,NULL,NULL,'OGLIASTRA',1),(841,'OT',314,NULL,NULL,NULL,'OLBIA-TEMPIO',1),(842,'OR',314,NULL,NULL,NULL,'ORISTANO',1),(843,'PD',320,NULL,NULL,NULL,'PADOVA',1),(844,'PA',315,NULL,NULL,NULL,'PALERMO',1),(845,'PR',305,NULL,NULL,NULL,'PARMA',1),(846,'PV',309,NULL,NULL,NULL,'PAVIA',1),(847,'PG',318,NULL,NULL,NULL,'PERUGIA',1),(848,'PU',310,NULL,NULL,NULL,'PESARO e URBINO',1),(849,'PE',301,NULL,NULL,NULL,'PESCARA',1),(850,'PC',305,NULL,NULL,NULL,'PIACENZA',1),(851,'PI',316,NULL,NULL,NULL,'PISA',1),(852,'PT',316,NULL,NULL,NULL,'PISTOIA',1),(853,'PN',306,NULL,NULL,NULL,'PORDENONE',1),(854,'PZ',302,NULL,NULL,NULL,'POTENZA',1),(855,'PO',316,NULL,NULL,NULL,'PRATO',1),(856,'RG',315,NULL,NULL,NULL,'RAGUSA',1),(857,'RA',305,NULL,NULL,NULL,'RAVENNA',1),(858,'RC',303,NULL,NULL,NULL,'REGGIO CALABRIA',1),(859,'RE',305,NULL,NULL,NULL,'REGGIO NELL EMILIA',1),(860,'RI',307,NULL,NULL,NULL,'RIETI',1),(861,'RN',305,NULL,NULL,NULL,'RIMINI',1),(862,'RM',307,NULL,NULL,NULL,'ROMA',1),(863,'RO',320,NULL,NULL,NULL,'ROVIGO',1),(864,'SA',304,NULL,NULL,NULL,'SALERNO',1),(865,'SS',314,NULL,NULL,NULL,'SASSARI',1),(866,'SV',308,NULL,NULL,NULL,'SAVONA',1),(867,'SI',316,NULL,NULL,NULL,'SIENA',1),(868,'SR',315,NULL,NULL,NULL,'SIRACUSA',1),(869,'SO',309,NULL,NULL,NULL,'SONDRIO',1),(870,'TA',313,NULL,NULL,NULL,'TARANTO',1),(871,'TE',301,NULL,NULL,NULL,'TERAMO',1),(872,'TR',318,NULL,NULL,NULL,'TERNI',1),(873,'TO',312,NULL,NULL,NULL,'TORINO',1),(874,'TP',315,NULL,NULL,NULL,'TRAPANI',1),(875,'TN',317,NULL,NULL,NULL,'TRENTO',1),(876,'TV',320,NULL,NULL,NULL,'TREVISO',1),(877,'TS',306,NULL,NULL,NULL,'TRIESTE',1),(878,'UD',306,NULL,NULL,NULL,'UDINE',1),(879,'VA',309,NULL,NULL,NULL,'VARESE',1),(880,'VE',320,NULL,NULL,NULL,'VENEZIA',1),(881,'VB',312,NULL,NULL,NULL,'VERBANO-CUSIO-OSSOLA',1),(882,'VC',312,NULL,NULL,NULL,'VERCELLI',1),(883,'VR',320,NULL,NULL,NULL,'VERONA',1),(884,'VV',303,NULL,NULL,NULL,'VIBO VALENTIA',1),(885,'VI',320,NULL,NULL,NULL,'VICENZA',1),(886,'VT',307,NULL,NULL,NULL,'VITERBO',1),(1036,'VE-L',23201,'',0,'VE-L','Mérida',1),(1037,'VE-T',23201,'',0,'VE-T','Trujillo',1),(1038,'VE-E',23201,'',0,'VE-E','Barinas',1),(1039,'VE-M',23202,'',0,'VE-M','Miranda',1),(1040,'VE-W',23202,'',0,'VE-W','Vargas',1),(1041,'VE-A',23202,'',0,'VE-A','Distrito Capital',1),(1042,'VE-D',23203,'',0,'VE-D','Aragua',1),(1043,'VE-G',23203,'',0,'VE-G','Carabobo',1),(1044,'VE-I',23204,'',0,'VE-I','Falcón',1),(1045,'VE-K',23204,'',0,'VE-K','Lara',1),(1046,'VE-U',23204,'',0,'VE-U','Yaracuy',1),(1047,'VE-F',23205,'',0,'VE-F','Bolívar',1),(1048,'VE-X',23205,'',0,'VE-X','Amazonas',1),(1049,'VE-Y',23205,'',0,'VE-Y','Delta Amacuro',1),(1050,'VE-O',23206,'',0,'VE-O','Nueva Esparta',1),(1051,'VE-Z',23206,'',0,'VE-Z','Dependencias Federales',1),(1052,'VE-C',23207,'',0,'VE-C','Apure',1),(1053,'VE-J',23207,'',0,'VE-J','Guárico',1),(1054,'VE-H',23207,'',0,'VE-H','Cojedes',1),(1055,'VE-P',23207,'',0,'VE-P','Portuguesa',1),(1056,'VE-B',23208,'',0,'VE-B','Anzoátegui',1),(1057,'VE-N',23208,'',0,'VE-N','Monagas',1),(1058,'VE-R',23208,'',0,'VE-R','Sucre',1),(1059,'VE-V',23209,'',0,'VE-V','Zulia',1),(1060,'VE-S',23209,'',0,'VE-S','Táchira',1),(1061,'66',10201,NULL,NULL,NULL,'?????',1),(1062,'00',10205,NULL,NULL,NULL,'?????',1),(1063,'01',10205,NULL,NULL,NULL,'?????',1),(1064,'02',10205,NULL,NULL,NULL,'?????',1),(1065,'03',10205,NULL,NULL,NULL,'??????',1),(1066,'04',10205,NULL,NULL,NULL,'?????',1),(1067,'05',10205,NULL,NULL,NULL,'??????',1),(1068,'06',10203,NULL,NULL,NULL,'??????',1),(1069,'07',10203,NULL,NULL,NULL,'???????????',1),(1070,'08',10203,NULL,NULL,NULL,'??????',1),(1071,'09',10203,NULL,NULL,NULL,'?????',1),(1072,'10',10203,NULL,NULL,NULL,'??????',1),(1073,'11',10203,NULL,NULL,NULL,'??????',1),(1074,'12',10203,NULL,NULL,NULL,'?????????',1),(1075,'13',10206,NULL,NULL,NULL,'????',1),(1076,'14',10206,NULL,NULL,NULL,'?????????',1),(1077,'15',10206,NULL,NULL,NULL,'????????',1),(1078,'16',10206,NULL,NULL,NULL,'???????',1),(1079,'17',10213,NULL,NULL,NULL,'???????',1),(1080,'18',10213,NULL,NULL,NULL,'????????',1),(1081,'19',10213,NULL,NULL,NULL,'??????',1),(1082,'20',10213,NULL,NULL,NULL,'???????',1),(1083,'21',10212,NULL,NULL,NULL,'????????',1),(1084,'22',10212,NULL,NULL,NULL,'??????',1),(1085,'23',10212,NULL,NULL,NULL,'????????',1),(1086,'24',10212,NULL,NULL,NULL,'???????',1),(1087,'25',10212,NULL,NULL,NULL,'????????',1),(1088,'26',10212,NULL,NULL,NULL,'???????',1),(1089,'27',10202,NULL,NULL,NULL,'??????',1),(1090,'28',10202,NULL,NULL,NULL,'?????????',1),(1091,'29',10202,NULL,NULL,NULL,'????????',1),(1092,'30',10202,NULL,NULL,NULL,'??????',1),(1093,'31',10209,NULL,NULL,NULL,'????????',1),(1094,'32',10209,NULL,NULL,NULL,'???????',1),(1095,'33',10209,NULL,NULL,NULL,'????????',1),(1096,'34',10209,NULL,NULL,NULL,'???????',1),(1097,'35',10209,NULL,NULL,NULL,'????????',1),(1098,'36',10211,NULL,NULL,NULL,'???????????????',1),(1099,'37',10211,NULL,NULL,NULL,'?????',1),(1100,'38',10211,NULL,NULL,NULL,'?????',1),(1101,'39',10207,NULL,NULL,NULL,'????????',1),(1102,'40',10207,NULL,NULL,NULL,'???????',1),(1103,'41',10207,NULL,NULL,NULL,'??????????',1),(1104,'42',10207,NULL,NULL,NULL,'?????',1),(1105,'43',10207,NULL,NULL,NULL,'???????',1),(1106,'44',10208,NULL,NULL,NULL,'??????',1),(1107,'45',10208,NULL,NULL,NULL,'??????',1),(1108,'46',10208,NULL,NULL,NULL,'??????',1),(1109,'47',10208,NULL,NULL,NULL,'?????',1),(1110,'48',10208,NULL,NULL,NULL,'????',1),(1111,'49',10210,NULL,NULL,NULL,'??????',1),(1112,'50',10210,NULL,NULL,NULL,'????',1),(1113,'51',10210,NULL,NULL,NULL,'????????',1),(1114,'52',10210,NULL,NULL,NULL,'????????',1),(1115,'53',10210,NULL,NULL,NULL,'???-??????',1),(1116,'54',10210,NULL,NULL,NULL,'??',1),(1117,'55',10210,NULL,NULL,NULL,'?????',1),(1118,'56',10210,NULL,NULL,NULL,'???????',1),(1119,'57',10210,NULL,NULL,NULL,'?????',1),(1120,'58',10210,NULL,NULL,NULL,'?????',1),(1121,'59',10210,NULL,NULL,NULL,'?????',1),(1122,'60',10210,NULL,NULL,NULL,'?????',1),(1123,'61',10210,NULL,NULL,NULL,'?????',1),(1124,'62',10204,NULL,NULL,NULL,'????????',1),(1125,'63',10204,NULL,NULL,NULL,'??????',1),(1126,'64',10204,NULL,NULL,NULL,'???????',1),(1127,'65',10204,NULL,NULL,NULL,'?????',1),(1128,'AL01',1301,'',0,'','Wilaya d\'Adrar',1),(1129,'AL02',1301,'',0,'','Wilaya de Chlef',1),(1130,'AL03',1301,'',0,'','Wilaya de Laghouat',1),(1131,'AL04',1301,'',0,'','Wilaya d\'Oum El Bouaghi',1),(1132,'AL05',1301,'',0,'','Wilaya de Batna',1),(1133,'AL06',1301,'',0,'','Wilaya de Béjaïa',1),(1134,'AL07',1301,'',0,'','Wilaya de Biskra',1),(1135,'AL08',1301,'',0,'','Wilaya de Béchar',1),(1136,'AL09',1301,'',0,'','Wilaya de Blida',1),(1137,'AL11',1301,'',0,'','Wilaya de Bouira',1),(1138,'AL12',1301,'',0,'','Wilaya de Tamanrasset',1),(1139,'AL13',1301,'',0,'','Wilaya de Tébessa',1),(1140,'AL14',1301,'',0,'','Wilaya de Tlemcen',1),(1141,'AL15',1301,'',0,'','Wilaya de Tiaret',1),(1142,'AL16',1301,'',0,'','Wilaya de Tizi Ouzou',1),(1143,'AL17',1301,'',0,'','Wilaya d\'Alger',1),(1144,'AL18',1301,'',0,'','Wilaya de Djelfa',1),(1145,'AL19',1301,'',0,'','Wilaya de Jijel',1),(1146,'AL20',1301,'',0,'','Wilaya de Sétif ',1),(1147,'AL21',1301,'',0,'','Wilaya de Saïda',1),(1148,'AL22',1301,'',0,'','Wilaya de Skikda',1),(1149,'AL23',1301,'',0,'','Wilaya de Sidi Bel Abbès',1),(1150,'AL24',1301,'',0,'','Wilaya d\'Annaba',1),(1151,'AL25',1301,'',0,'','Wilaya de Guelma',1),(1152,'AL26',1301,'',0,'','Wilaya de Constantine',1),(1153,'AL27',1301,'',0,'','Wilaya de Médéa',1),(1154,'AL28',1301,'',0,'','Wilaya de Mostaganem',1),(1155,'AL29',1301,'',0,'','Wilaya de M\'Sila',1),(1156,'AL30',1301,'',0,'','Wilaya de Mascara',1),(1157,'AL31',1301,'',0,'','Wilaya d\'Ouargla',1),(1158,'AL32',1301,'',0,'','Wilaya d\'Oran',1),(1159,'AL33',1301,'',0,'','Wilaya d\'El Bayadh',1),(1160,'AL34',1301,'',0,'','Wilaya d\'Illizi',1),(1161,'AL35',1301,'',0,'','Wilaya de Bordj Bou Arreridj',1),(1162,'AL36',1301,'',0,'','Wilaya de Boumerdès',1),(1163,'AL37',1301,'',0,'','Wilaya d\'El Tarf',1),(1164,'AL38',1301,'',0,'','Wilaya de Tindouf',1),(1165,'AL39',1301,'',0,'','Wilaya de Tissemsilt',1),(1166,'AL40',1301,'',0,'','Wilaya d\'El Oued',1),(1167,'AL41',1301,'',0,'','Wilaya de Khenchela',1),(1168,'AL42',1301,'',0,'','Wilaya de Souk Ahras',1),(1169,'AL43',1301,'',0,'','Wilaya de Tipaza',1),(1170,'AL44',1301,'',0,'','Wilaya de Mila',1),(1171,'AL45',1301,'',0,'','Wilaya d\'Aïn Defla',1),(1172,'AL46',1301,'',0,'','Wilaya de Naâma',1),(1173,'AL47',1301,'',0,'','Wilaya d\'Aïn Témouchent',1),(1174,'AL48',1301,'',0,'','Wilaya de Ghardaia',1),(1175,'AL49',1301,'',0,'','Wilaya de Relizane',1),(1176,'MA',1209,'',0,'','Province de Benslimane',1),(1177,'MA1',1209,'',0,'','Province de Berrechid',1),(1178,'MA2',1209,'',0,'','Province de Khouribga',1),(1179,'MA3',1209,'',0,'','Province de Settat',1),(1180,'MA4',1210,'',0,'','Province d\'El Jadida',1),(1181,'MA5',1210,'',0,'','Province de Safi',1),(1182,'MA6',1210,'',0,'','Province de Sidi Bennour',1),(1183,'MA7',1210,'',0,'','Province de Youssoufia',1),(1184,'MA6B',1205,'',0,'','Préfecture de Fès',1),(1185,'MA7B',1205,'',0,'','Province de Boulemane',1),(1186,'MA8',1205,'',0,'','Province de Moulay Yacoub',1),(1187,'MA9',1205,'',0,'','Province de Sefrou',1),(1188,'MA8A',1202,'',0,'','Province de Kénitra',1),(1189,'MA9A',1202,'',0,'','Province de Sidi Kacem',1),(1190,'MA10',1202,'',0,'','Province de Sidi Slimane',1),(1191,'MA11',1208,'',0,'','Préfecture de Casablanca',1),(1192,'MA12',1208,'',0,'','Préfecture de Mohammédia',1),(1193,'MA13',1208,'',0,'','Province de Médiouna',1),(1194,'MA14',1208,'',0,'','Province de Nouaceur',1),(1195,'MA15',1214,'',0,'','Province d\'Assa-Zag',1),(1196,'MA16',1214,'',0,'','Province d\'Es-Semara',1),(1197,'MA17A',1214,'',0,'','Province de Guelmim',1),(1198,'MA18',1214,'',0,'','Province de Tata',1),(1199,'MA19',1214,'',0,'','Province de Tan-Tan',1),(1200,'MA15',1215,'',0,'','Province de Boujdour',1),(1201,'MA16',1215,'',0,'','Province de Lâayoune',1),(1202,'MA17',1215,'',0,'','Province de Tarfaya',1),(1203,'MA18',1211,'',0,'','Préfecture de Marrakech',1),(1204,'MA19',1211,'',0,'','Province d\'Al Haouz',1),(1205,'MA20',1211,'',0,'','Province de Chichaoua',1),(1206,'MA21',1211,'',0,'','Province d\'El Kelâa des Sraghna',1),(1207,'MA22',1211,'',0,'','Province d\'Essaouira',1),(1208,'MA23',1211,'',0,'','Province de Rehamna',1),(1209,'MA24',1206,'',0,'','Préfecture de Meknès',1),(1210,'MA25',1206,'',0,'','Province d’El Hajeb',1),(1211,'MA26',1206,'',0,'','Province d\'Errachidia',1),(1212,'MA27',1206,'',0,'','Province d’Ifrane',1),(1213,'MA28',1206,'',0,'','Province de Khénifra',1),(1214,'MA29',1206,'',0,'','Province de Midelt',1),(1215,'MA30',1204,'',0,'','Préfecture d\'Oujda-Angad',1),(1216,'MA31',1204,'',0,'','Province de Berkane',1),(1217,'MA32',1204,'',0,'','Province de Driouch',1),(1218,'MA33',1204,'',0,'','Province de Figuig',1),(1219,'MA34',1204,'',0,'','Province de Jerada',1),(1220,'MA35',1204,'',0,'','Province de Nadorgg',1),(1221,'MA36',1204,'',0,'','Province de Taourirt',1),(1222,'MA37',1216,'',0,'','Province d\'Aousserd',1),(1223,'MA38',1216,'',0,'','Province d\'Oued Ed-Dahab',1),(1224,'MA39',1207,'',0,'','Préfecture de Rabat',1),(1225,'MA40',1207,'',0,'','Préfecture de Skhirat-Témara',1),(1226,'MA41',1207,'',0,'','Préfecture de Salé',1),(1227,'MA42',1207,'',0,'','Province de Khémisset',1),(1228,'MA43',1213,'',0,'','Préfecture d\'Agadir Ida-Outanane',1),(1229,'MA44',1213,'',0,'','Préfecture d\'Inezgane-Aït Melloul',1),(1230,'MA45',1213,'',0,'','Province de Chtouka-Aït Baha',1),(1231,'MA46',1213,'',0,'','Province d\'Ouarzazate',1),(1232,'MA47',1213,'',0,'','Province de Sidi Ifni',1),(1233,'MA48',1213,'',0,'','Province de Taroudant',1),(1234,'MA49',1213,'',0,'','Province de Tinghir',1),(1235,'MA50',1213,'',0,'','Province de Tiznit',1),(1236,'MA51',1213,'',0,'','Province de Zagora',1),(1237,'MA52',1212,'',0,'','Province d\'Azilal',1),(1238,'MA53',1212,'',0,'','Province de Beni Mellal',1),(1239,'MA54',1212,'',0,'','Province de Fquih Ben Salah',1),(1240,'MA55',1201,'',0,'','Préfecture de M\'diq-Fnideq',1),(1241,'MA56',1201,'',0,'','Préfecture de Tanger-Asilah',1),(1242,'MA57',1201,'',0,'','Province de Chefchaouen',1),(1243,'MA58',1201,'',0,'','Province de Fahs-Anjra',1),(1244,'MA59',1201,'',0,'','Province de Larache',1),(1245,'MA60',1201,'',0,'','Province d\'Ouezzane',1),(1246,'MA61',1201,'',0,'','Province de Tétouan',1),(1247,'MA62',1203,'',0,'','Province de Guercif',1),(1248,'MA63',1203,'',0,'','Province d\'Al Hoceïma',1),(1249,'MA64',1203,'',0,'','Province de Taounate',1),(1250,'MA65',1203,'',0,'','Province de Taza',1),(1251,'MA6A',1205,'',0,'','Préfecture de Fès',1),(1252,'MA7A',1205,'',0,'','Province de Boulemane',1),(1253,'MA15A',1214,'',0,'','Province d\'Assa-Zag',1),(1254,'MA16A',1214,'',0,'','Province d\'Es-Semara',1),(1255,'MA18A',1211,'',0,'','Préfecture de Marrakech',1),(1256,'MA19A',1214,'',0,'','Province de Tan-Tan',1),(1257,'MA19B',1214,'',0,'','Province de Tan-Tan',1),(1258,'TN01',1001,'',0,'','Ariana',1),(1259,'TN02',1001,'',0,'','Béja',1),(1260,'TN03',1001,'',0,'','Ben Arous',1),(1261,'TN04',1001,'',0,'','Bizerte',1),(1262,'TN05',1001,'',0,'','Gabès',1),(1263,'TN06',1001,'',0,'','Gafsa',1),(1264,'TN07',1001,'',0,'','Jendouba',1),(1265,'TN08',1001,'',0,'','Kairouan',1),(1266,'TN09',1001,'',0,'','Kasserine',1),(1267,'TN10',1001,'',0,'','Kébili',1),(1268,'TN11',1001,'',0,'','La Manouba',1),(1269,'TN12',1001,'',0,'','Le Kef',1),(1270,'TN13',1001,'',0,'','Mahdia',1),(1271,'TN14',1001,'',0,'','Médenine',1),(1272,'TN15',1001,'',0,'','Monastir',1),(1273,'TN16',1001,'',0,'','Nabeul',1),(1274,'TN17',1001,'',0,'','Sfax',1),(1275,'TN18',1001,'',0,'','Sidi Bouzid',1),(1276,'TN19',1001,'',0,'','Siliana',1),(1277,'TN20',1001,'',0,'','Sousse',1),(1278,'TN21',1001,'',0,'','Tataouine',1),(1279,'TN22',1001,'',0,'','Tozeur',1),(1280,'TN23',1001,'',0,'','Tunis',1),(1281,'TN24',1001,'',0,'','Zaghouan',1),(1287,'976',6,'97601',3,'MAYOTTE','Mayotte',1),(1513,'ON',1401,'',1,'','Ontario',1),(1514,'QC',1401,'',1,'','Quebec',1),(1515,'NS',1401,'',1,'','Nova Scotia',1),(1516,'NB',1401,'',1,'','New Brunswick',1),(1517,'MB',1401,'',1,'','Manitoba',1),(1518,'BC',1401,'',1,'','British Columbia',1),(1519,'PE',1401,'',1,'','Prince Edward Island',1),(1520,'SK',1401,'',1,'','Saskatchewan',1),(1521,'AB',1401,'',1,'','Alberta',1),(1522,'NL',1401,'',1,'','Newfoundland and Labrador',1),(1575,'BW',501,NULL,NULL,'BADEN-WÜRTTEMBERG','Baden-Württemberg',1),(1576,'BY',501,NULL,NULL,'BAYERN','Bayern',1),(1577,'BE',501,NULL,NULL,'BERLIN','Berlin',1),(1578,'BB',501,NULL,NULL,'BRANDENBURG','Brandenburg',1),(1579,'HB',501,NULL,NULL,'BREMEN','Bremen',1),(1580,'HH',501,NULL,NULL,'HAMBURG','Hamburg',1),(1581,'HE',501,NULL,NULL,'HESSEN','Hessen',1),(1582,'MV',501,NULL,NULL,'MECKLENBURG-VORPOMMERN','Mecklenburg-Vorpommern',1),(1583,'NI',501,NULL,NULL,'NIEDERSACHSEN','Niedersachsen',1),(1584,'NW',501,NULL,NULL,'NORDRHEIN-WESTFALEN','Nordrhein-Westfalen',1),(1585,'RP',501,NULL,NULL,'RHEINLAND-PFALZ','Rheinland-Pfalz',1),(1586,'SL',501,NULL,NULL,'SAARLAND','Saarland',1),(1587,'SN',501,NULL,NULL,'SACHSEN','Sachsen',1),(1588,'ST',501,NULL,NULL,'SACHSEN-ANHALT','Sachsen-Anhalt',1),(1589,'SH',501,NULL,NULL,'SCHLESWIG-HOLSTEIN','Schleswig-Holstein',1),(1590,'TH',501,NULL,NULL,'THÜRINGEN','Thüringen',1),(1592,'67',10205,'',0,'','Δράμα',1),(1684,'701',701,NULL,0,NULL,'Bedfordshire',1),(1685,'702',701,NULL,0,NULL,'Berkshire',1),(1686,'703',701,NULL,0,NULL,'Bristol, City of',1),(1687,'704',701,NULL,0,NULL,'Buckinghamshire',1),(1688,'705',701,NULL,0,NULL,'Cambridgeshire',1),(1689,'706',701,NULL,0,NULL,'Cheshire',1),(1690,'707',701,NULL,0,NULL,'Cleveland',1),(1691,'708',701,NULL,0,NULL,'Cornwall',1),(1692,'709',701,NULL,0,NULL,'Cumberland',1),(1693,'710',701,NULL,0,NULL,'Cumbria',1),(1694,'711',701,NULL,0,NULL,'Derbyshire',1),(1695,'712',701,NULL,0,NULL,'Devon',1),(1696,'713',701,NULL,0,NULL,'Dorset',1),(1697,'714',701,NULL,0,NULL,'Co. Durham',1),(1698,'715',701,NULL,0,NULL,'East Riding of Yorkshire',1),(1699,'716',701,NULL,0,NULL,'East Sussex',1),(1700,'717',701,NULL,0,NULL,'Essex',1),(1701,'718',701,NULL,0,NULL,'Gloucestershire',1),(1702,'719',701,NULL,0,NULL,'Greater Manchester',1),(1703,'720',701,NULL,0,NULL,'Hampshire',1),(1704,'721',701,NULL,0,NULL,'Hertfordshire',1),(1705,'722',701,NULL,0,NULL,'Hereford and Worcester',1),(1706,'723',701,NULL,0,NULL,'Herefordshire',1),(1707,'724',701,NULL,0,NULL,'Huntingdonshire',1),(1708,'725',701,NULL,0,NULL,'Isle of Man',1),(1709,'726',701,NULL,0,NULL,'Isle of Wight',1),(1710,'727',701,NULL,0,NULL,'Jersey',1),(1711,'728',701,NULL,0,NULL,'Kent',1),(1712,'729',701,NULL,0,NULL,'Lancashire',1),(1713,'730',701,NULL,0,NULL,'Leicestershire',1),(1714,'731',701,NULL,0,NULL,'Lincolnshire',1),(1715,'732',701,NULL,0,NULL,'London - City of London',1),(1716,'733',701,NULL,0,NULL,'Merseyside',1),(1717,'734',701,NULL,0,NULL,'Middlesex',1),(1718,'735',701,NULL,0,NULL,'Norfolk',1),(1719,'736',701,NULL,0,NULL,'North Yorkshire',1),(1720,'737',701,NULL,0,NULL,'North Riding of Yorkshire',1),(1721,'738',701,NULL,0,NULL,'Northamptonshire',1),(1722,'739',701,NULL,0,NULL,'Northumberland',1),(1723,'740',701,NULL,0,NULL,'Nottinghamshire',1),(1724,'741',701,NULL,0,NULL,'Oxfordshire',1),(1725,'742',701,NULL,0,NULL,'Rutland',1),(1726,'743',701,NULL,0,NULL,'Shropshire',1),(1727,'744',701,NULL,0,NULL,'Somerset',1),(1728,'745',701,NULL,0,NULL,'Staffordshire',1),(1729,'746',701,NULL,0,NULL,'Suffolk',1),(1730,'747',701,NULL,0,NULL,'Surrey',1),(1731,'748',701,NULL,0,NULL,'Sussex',1),(1732,'749',701,NULL,0,NULL,'Tyne and Wear',1),(1733,'750',701,NULL,0,NULL,'Warwickshire',1),(1734,'751',701,NULL,0,NULL,'West Midlands',1),(1735,'752',701,NULL,0,NULL,'West Sussex',1),(1736,'753',701,NULL,0,NULL,'West Yorkshire',1),(1737,'754',701,NULL,0,NULL,'West Riding of Yorkshire',1),(1738,'755',701,NULL,0,NULL,'Wiltshire',1),(1739,'756',701,NULL,0,NULL,'Worcestershire',1),(1740,'757',701,NULL,0,NULL,'Yorkshire',1),(1741,'758',702,NULL,0,NULL,'Anglesey',1),(1742,'759',702,NULL,0,NULL,'Breconshire',1),(1743,'760',702,NULL,0,NULL,'Caernarvonshire',1),(1744,'761',702,NULL,0,NULL,'Cardiganshire',1),(1745,'762',702,NULL,0,NULL,'Carmarthenshire',1),(1746,'763',702,NULL,0,NULL,'Ceredigion',1),(1747,'764',702,NULL,0,NULL,'Denbighshire',1),(1748,'765',702,NULL,0,NULL,'Flintshire',1),(1749,'766',702,NULL,0,NULL,'Glamorgan',1),(1750,'767',702,NULL,0,NULL,'Gwent',1),(1751,'768',702,NULL,0,NULL,'Gwynedd',1),(1752,'769',702,NULL,0,NULL,'Merionethshire',1),(1753,'770',702,NULL,0,NULL,'Monmouthshire',1),(1754,'771',702,NULL,0,NULL,'Mid Glamorgan',1),(1755,'772',702,NULL,0,NULL,'Montgomeryshire',1),(1756,'773',702,NULL,0,NULL,'Pembrokeshire',1),(1757,'774',702,NULL,0,NULL,'Powys',1),(1758,'775',702,NULL,0,NULL,'Radnorshire',1),(1759,'776',702,NULL,0,NULL,'South Glamorgan',1),(1760,'777',703,NULL,0,NULL,'Aberdeen, City of',1),(1761,'778',703,NULL,0,NULL,'Angus',1),(1762,'779',703,NULL,0,NULL,'Argyll',1),(1763,'780',703,NULL,0,NULL,'Ayrshire',1),(1764,'781',703,NULL,0,NULL,'Banffshire',1),(1765,'782',703,NULL,0,NULL,'Berwickshire',1),(1766,'783',703,NULL,0,NULL,'Bute',1),(1767,'784',703,NULL,0,NULL,'Caithness',1),(1768,'785',703,NULL,0,NULL,'Clackmannanshire',1),(1769,'786',703,NULL,0,NULL,'Dumfriesshire',1),(1770,'787',703,NULL,0,NULL,'Dumbartonshire',1),(1771,'788',703,NULL,0,NULL,'Dundee, City of',1),(1772,'789',703,NULL,0,NULL,'East Lothian',1),(1773,'790',703,NULL,0,NULL,'Fife',1),(1774,'791',703,NULL,0,NULL,'Inverness',1),(1775,'792',703,NULL,0,NULL,'Kincardineshire',1),(1776,'793',703,NULL,0,NULL,'Kinross-shire',1),(1777,'794',703,NULL,0,NULL,'Kirkcudbrightshire',1),(1778,'795',703,NULL,0,NULL,'Lanarkshire',1),(1779,'796',703,NULL,0,NULL,'Midlothian',1),(1780,'797',703,NULL,0,NULL,'Morayshire',1),(1781,'798',703,NULL,0,NULL,'Nairnshire',1),(1782,'799',703,NULL,0,NULL,'Orkney',1),(1783,'800',703,NULL,0,NULL,'Peebleshire',1),(1784,'801',703,NULL,0,NULL,'Perthshire',1),(1785,'802',703,NULL,0,NULL,'Renfrewshire',1),(1786,'803',703,NULL,0,NULL,'Ross & Cromarty',1),(1787,'804',703,NULL,0,NULL,'Roxburghshire',1),(1788,'805',703,NULL,0,NULL,'Selkirkshire',1),(1789,'806',703,NULL,0,NULL,'Shetland',1),(1790,'807',703,NULL,0,NULL,'Stirlingshire',1),(1791,'808',703,NULL,0,NULL,'Sutherland',1),(1792,'809',703,NULL,0,NULL,'West Lothian',1),(1793,'810',703,NULL,0,NULL,'Wigtownshire',1),(1794,'811',704,NULL,0,NULL,'Antrim',1),(1795,'812',704,NULL,0,NULL,'Armagh',1),(1796,'813',704,NULL,0,NULL,'Co. Down',1),(1797,'814',704,NULL,0,NULL,'Co. Fermanagh',1),(1798,'815',704,NULL,0,NULL,'Co. Londonderry',1),(1849,'GR',1701,NULL,NULL,NULL,'Groningen',1),(1850,'FR',1701,NULL,NULL,NULL,'Friesland',1),(1851,'DR',1701,NULL,NULL,NULL,'Drenthe',1),(1852,'OV',1701,NULL,NULL,NULL,'Overijssel',1),(1853,'GD',1701,NULL,NULL,NULL,'Gelderland',1),(1854,'FL',1701,NULL,NULL,NULL,'Flevoland',1),(1855,'UT',1701,NULL,NULL,NULL,'Utrecht',1),(1856,'NH',1701,NULL,NULL,NULL,'Noord-Holland',1),(1857,'ZH',1701,NULL,NULL,NULL,'Zuid-Holland',1),(1858,'ZL',1701,NULL,NULL,NULL,'Zeeland',1),(1859,'NB',1701,NULL,NULL,NULL,'Noord-Brabant',1),(1860,'LB',1701,NULL,NULL,NULL,'Limburg',1),(1900,'AC',5601,'ACRE',0,'AC','Acre',1),(1901,'AL',5601,'ALAGOAS',0,'AL','Alagoas',1),(1902,'AP',5601,'AMAPA',0,'AP','Amapá',1),(1903,'AM',5601,'AMAZONAS',0,'AM','Amazonas',1),(1904,'BA',5601,'BAHIA',0,'BA','Bahia',1),(1905,'CE',5601,'CEARA',0,'CE','Ceará',1),(1906,'ES',5601,'ESPIRITO SANTO',0,'ES','Espirito Santo',1),(1907,'GO',5601,'GOIAS',0,'GO','Goiás',1),(1908,'MA',5601,'MARANHAO',0,'MA','Maranhão',1),(1909,'MT',5601,'MATO GROSSO',0,'MT','Mato Grosso',1),(1910,'MS',5601,'MATO GROSSO DO SUL',0,'MS','Mato Grosso do Sul',1),(1911,'MG',5601,'MINAS GERAIS',0,'MG','Minas Gerais',1),(1912,'PA',5601,'PARA',0,'PA','Pará',1),(1913,'PB',5601,'PARAIBA',0,'PB','Paraiba',1),(1914,'PR',5601,'PARANA',0,'PR','Paraná',1),(1915,'PE',5601,'PERNAMBUCO',0,'PE','Pernambuco',1),(1916,'PI',5601,'PIAUI',0,'PI','Piauí',1),(1917,'RJ',5601,'RIO DE JANEIRO',0,'RJ','Rio de Janeiro',1),(1918,'RN',5601,'RIO GRANDE DO NORTE',0,'RN','Rio Grande do Norte',1),(1919,'RS',5601,'RIO GRANDE DO SUL',0,'RS','Rio Grande do Sul',1),(1920,'RO',5601,'RONDONIA',0,'RO','Rondônia',1),(1921,'RR',5601,'RORAIMA',0,'RR','Roraima',1),(1922,'SC',5601,'SANTA CATARINA',0,'SC','Santa Catarina',1),(1923,'SE',5601,'SERGIPE',0,'SE','Sergipe',1),(1924,'SP',5601,'SAO PAULO',0,'SP','Sao Paulo',1),(1925,'TO',5601,'TOCANTINS',0,'TO','Tocantins',1),(1926,'DF',5601,'DISTRITO FEDERAL',0,'DF','Distrito Federal',1),(1927,'001',5201,'',0,'','Belisario Boeto',1),(1928,'002',5201,'',0,'','Hernando Siles',1),(1929,'003',5201,'',0,'','Jaime Zudáñez',1),(1930,'004',5201,'',0,'','Juana Azurduy de Padilla',1),(1931,'005',5201,'',0,'','Luis Calvo',1),(1932,'006',5201,'',0,'','Nor Cinti',1),(1933,'007',5201,'',0,'','Oropeza',1),(1934,'008',5201,'',0,'','Sud Cinti',1),(1935,'009',5201,'',0,'','Tomina',1),(1936,'010',5201,'',0,'','Yamparáez',1),(1937,'011',5202,'',0,'','Abel Iturralde',1),(1938,'012',5202,'',0,'','Aroma',1),(1939,'013',5202,'',0,'','Bautista Saavedra',1),(1940,'014',5202,'',0,'','Caranavi',1),(1941,'015',5202,'',0,'','Eliodoro Camacho',1),(1942,'016',5202,'',0,'','Franz Tamayo',1),(1943,'017',5202,'',0,'','Gualberto Villarroel',1),(1944,'018',5202,'',0,'','Ingaví',1),(1945,'019',5202,'',0,'','Inquisivi',1),(1946,'020',5202,'',0,'','José Ramón Loayza',1),(1947,'021',5202,'',0,'','Larecaja',1),(1948,'022',5202,'',0,'','Los Andes (Bolivia)',1),(1949,'023',5202,'',0,'','Manco Kapac',1),(1950,'024',5202,'',0,'','Muñecas',1),(1951,'025',5202,'',0,'','Nor Yungas',1),(1952,'026',5202,'',0,'','Omasuyos',1),(1953,'027',5202,'',0,'','Pacajes',1),(1954,'028',5202,'',0,'','Pedro Domingo Murillo',1),(1955,'029',5202,'',0,'','Sud Yungas',1),(1956,'030',5202,'',0,'','General José Manuel Pando',1),(1957,'031',5203,'',0,'','Arani',1),(1958,'032',5203,'',0,'','Arque',1),(1959,'033',5203,'',0,'','Ayopaya',1),(1960,'034',5203,'',0,'','Bolívar (Bolivia)',1),(1961,'035',5203,'',0,'','Campero',1),(1962,'036',5203,'',0,'','Capinota',1),(1963,'037',5203,'',0,'','Cercado (Cochabamba)',1),(1964,'038',5203,'',0,'','Esteban Arze',1),(1965,'039',5203,'',0,'','Germán Jordán',1),(1966,'040',5203,'',0,'','José Carrasco',1),(1967,'041',5203,'',0,'','Mizque',1),(1968,'042',5203,'',0,'','Punata',1),(1969,'043',5203,'',0,'','Quillacollo',1),(1970,'044',5203,'',0,'','Tapacarí',1),(1971,'045',5203,'',0,'','Tiraque',1),(1972,'046',5203,'',0,'','Chapare',1),(1973,'047',5204,'',0,'','Carangas',1),(1974,'048',5204,'',0,'','Cercado (Oruro)',1),(1975,'049',5204,'',0,'','Eduardo Avaroa',1),(1976,'050',5204,'',0,'','Ladislao Cabrera',1),(1977,'051',5204,'',0,'','Litoral de Atacama',1),(1978,'052',5204,'',0,'','Mejillones',1),(1979,'053',5204,'',0,'','Nor Carangas',1),(1980,'054',5204,'',0,'','Pantaleón Dalence',1),(1981,'055',5204,'',0,'','Poopó',1),(1982,'056',5204,'',0,'','Sabaya',1),(1983,'057',5204,'',0,'','Sajama',1),(1984,'058',5204,'',0,'','San Pedro de Totora',1),(1985,'059',5204,'',0,'','Saucarí',1),(1986,'060',5204,'',0,'','Sebastián Pagador',1),(1987,'061',5204,'',0,'','Sud Carangas',1),(1988,'062',5204,'',0,'','Tomás Barrón',1),(1989,'063',5205,'',0,'','Alonso de Ibáñez',1),(1990,'064',5205,'',0,'','Antonio Quijarro',1),(1991,'065',5205,'',0,'','Bernardino Bilbao',1),(1992,'066',5205,'',0,'','Charcas (Potosí)',1),(1993,'067',5205,'',0,'','Chayanta',1),(1994,'068',5205,'',0,'','Cornelio Saavedra',1),(1995,'069',5205,'',0,'','Daniel Campos',1),(1996,'070',5205,'',0,'','Enrique Baldivieso',1),(1997,'071',5205,'',0,'','José María Linares',1),(1998,'072',5205,'',0,'','Modesto Omiste',1),(1999,'073',5205,'',0,'','Nor Chichas',1),(2000,'074',5205,'',0,'','Nor Lípez',1),(2001,'075',5205,'',0,'','Rafael Bustillo',1),(2002,'076',5205,'',0,'','Sud Chichas',1),(2003,'077',5205,'',0,'','Sud Lípez',1),(2004,'078',5205,'',0,'','Tomás Frías',1),(2005,'079',5206,'',0,'','Aniceto Arce',1),(2006,'080',5206,'',0,'','Burdet O\'Connor',1),(2007,'081',5206,'',0,'','Cercado (Tarija)',1),(2008,'082',5206,'',0,'','Eustaquio Méndez',1),(2009,'083',5206,'',0,'','José María Avilés',1),(2010,'084',5206,'',0,'','Gran Chaco',1),(2011,'085',5207,'',0,'','Andrés Ibáñez',1),(2012,'086',5207,'',0,'','Caballero',1),(2013,'087',5207,'',0,'','Chiquitos',1),(2014,'088',5207,'',0,'','Cordillera (Bolivia)',1),(2015,'089',5207,'',0,'','Florida',1),(2016,'090',5207,'',0,'','Germán Busch',1),(2017,'091',5207,'',0,'','Guarayos',1),(2018,'092',5207,'',0,'','Ichilo',1),(2019,'093',5207,'',0,'','Obispo Santistevan',1),(2020,'094',5207,'',0,'','Sara',1),(2021,'095',5207,'',0,'','Vallegrande',1),(2022,'096',5207,'',0,'','Velasco',1),(2023,'097',5207,'',0,'','Warnes',1),(2024,'098',5207,'',0,'','Ángel Sandóval',1),(2025,'099',5207,'',0,'','Ñuflo de Chaves',1),(2026,'100',5208,'',0,'','Cercado (Beni)',1),(2027,'101',5208,'',0,'','Iténez',1),(2028,'102',5208,'',0,'','Mamoré',1),(2029,'103',5208,'',0,'','Marbán',1),(2030,'104',5208,'',0,'','Moxos',1),(2031,'105',5208,'',0,'','Vaca Díez',1),(2032,'106',5208,'',0,'','Yacuma',1),(2033,'107',5208,'',0,'','General José Ballivián Segurola',1),(2034,'108',5209,'',0,'','Abuná',1),(2035,'109',5209,'',0,'','Madre de Dios',1),(2036,'110',5209,'',0,'','Manuripi',1),(2037,'111',5209,'',0,'','Nicolás Suárez',1),(2038,'112',5209,'',0,'','General Federico Román',1),(2039,'B',4101,NULL,NULL,'BURGENLAND','Burgenland',1),(2040,'K',4101,NULL,NULL,'KAERNTEN','Kärnten',1),(2041,'N',4101,NULL,NULL,'NIEDEROESTERREICH','Niederösterreich',1),(2042,'O',4101,NULL,NULL,'OBEROESTERREICH','Oberösterreich',1),(2043,'S',4101,NULL,NULL,'SALZBURG','Salzburg',1),(2044,'ST',4101,NULL,NULL,'STEIERMARK','Steiermark',1),(2045,'T',4101,NULL,NULL,'TIROL','Tirol',1),(2046,'V',4101,NULL,NULL,'VORARLBERG','Vorarlberg',1),(2047,'W',4101,NULL,NULL,'WIEN','Wien',1),(2048,'2326',2305,'',0,'MISIONES','Misiones',1),(2049,'PA-1',17801,'',0,'','Bocas del Toro',1),(2050,'PA-2',17801,'',0,'','Coclé',1),(2051,'PA-3',17801,'',0,'','Colón',1),(2052,'PA-4',17801,'',0,'','Chiriquí',1),(2053,'PA-5',17801,'',0,'','Darién',1),(2054,'PA-6',17801,'',0,'','Herrera',1),(2055,'PA-7',17801,'',0,'','Los Santos',1),(2056,'PA-8',17801,'',0,'','Panamá',1),(2057,'PA-9',17801,'',0,'','Veraguas',1),(2058,'PA-13',17801,'',0,'','Panamá Oeste',1),(2059,'AE-1',22701,'',0,'','Abu Dhabi',1),(2060,'AE-2',22701,'',0,'','Dubai',1),(2061,'AE-3',22701,'',0,'','Ajman',1),(2062,'AE-4',22701,'',0,'','Fujairah',1),(2063,'AE-5',22701,'',0,'','Ras al-Khaimah',1),(2064,'AE-6',22701,'',0,'','Sharjah',1),(2065,'AE-7',22701,'',0,'','Umm al-Quwain',1); +/*!40000 ALTER TABLE `llx_c_departements` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_ecotaxe` +-- + +DROP TABLE IF EXISTS `llx_c_ecotaxe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_ecotaxe` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(64) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `organization` varchar(255) DEFAULT NULL, + `fk_pays` int(11) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_ecotaxe` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_ecotaxe` +-- + +LOCK TABLES `llx_c_ecotaxe` WRITE; +/*!40000 ALTER TABLE `llx_c_ecotaxe` DISABLE KEYS */; +INSERT INTO `llx_c_ecotaxe` VALUES (1,'ER-A-A','Materiels electriques < 0,2kg',0.01000000,'ERP',1,1),(2,'ER-A-B','Materiels electriques >= 0,2 kg et < 0,5 kg',0.03000000,'ERP',1,1),(3,'ER-A-C','Materiels electriques >= 0,5 kg et < 1 kg',0.04000000,'ERP',1,1),(4,'ER-A-D','Materiels electriques >= 1 kg et < 2 kg',0.13000000,'ERP',1,1),(5,'ER-A-E','Materiels electriques >= 2 kg et < 4kg',0.21000000,'ERP',1,1),(6,'ER-A-F','Materiels electriques >= 4 kg et < 8 kg',0.42000000,'ERP',1,1),(7,'ER-A-G','Materiels electriques >= 8 kg et < 15 kg',0.84000000,'ERP',1,1),(8,'ER-A-H','Materiels electriques >= 15 kg et < 20 kg',1.25000000,'ERP',1,1),(9,'ER-A-I','Materiels electriques >= 20 kg et < 30 kg',1.88000000,'ERP',1,1),(10,'ER-A-J','Materiels electriques >= 30 kg',3.34000000,'ERP',1,1),(11,'ER-M-1','TV, Moniteurs < 9kg',0.84000000,'ERP',1,1),(12,'ER-M-2','TV, Moniteurs >= 9kg et < 15kg',1.67000000,'ERP',1,1),(13,'ER-M-3','TV, Moniteurs >= 15kg et < 30kg',3.34000000,'ERP',1,1),(14,'ER-M-4','TV, Moniteurs >= 30 kg',6.69000000,'ERP',1,1),(15,'EC-A-A','Materiels electriques 0,2 kg max',0.00840000,'Ecologic',1,1),(16,'EC-A-B','Materiels electriques 0,21 kg min - 0,50 kg max',0.02500000,'Ecologic',1,1),(17,'EC-A-C','Materiels electriques 0,51 kg min - 1 kg max',0.04000000,'Ecologic',1,1),(18,'EC-A-D','Materiels electriques 1,01 kg min - 2,5 kg max',0.13000000,'Ecologic',1,1),(19,'EC-A-E','Materiels electriques 2,51 kg min - 4 kg max',0.21000000,'Ecologic',1,1),(20,'EC-A-F','Materiels electriques 4,01 kg min - 8 kg max',0.42000000,'Ecologic',1,1),(21,'EC-A-G','Materiels electriques 8,01 kg min - 12 kg max',0.63000000,'Ecologic',1,1),(22,'EC-A-H','Materiels electriques 12,01 kg min - 20 kg max',1.05000000,'Ecologic',1,1),(23,'EC-A-I','Materiels electriques 20,01 kg min',1.88000000,'Ecologic',1,1),(24,'EC-M-1','TV, Moniteurs 9 kg max',0.84000000,'Ecologic',1,1),(25,'EC-M-2','TV, Moniteurs 9,01 kg min - 18 kg max',1.67000000,'Ecologic',1,1),(26,'EC-M-3','TV, Moniteurs 18,01 kg min - 36 kg max',3.34000000,'Ecologic',1,1),(27,'EC-M-4','TV, Moniteurs 36,01 kg min',6.69000000,'Ecologic',1,1),(28,'ES-M-1','TV, Moniteurs <= 20 pouces',0.84000000,'Eco-systemes',1,1),(29,'ES-M-2','TV, Moniteurs > 20 pouces et <= 32 pouces',3.34000000,'Eco-systemes',1,1),(30,'ES-M-3','TV, Moniteurs > 32 pouces et autres grands ecrans',6.69000000,'Eco-systemes',1,1),(31,'ES-A-A','Ordinateur fixe, Audio home systems (HIFI), elements hifi separes',0.84000000,'Eco-systemes',1,1),(32,'ES-A-B','Ordinateur portable, CD-RCR, VCR, lecteurs et enregistreurs DVD, instruments de musique et caisses de resonance, haut parleurs...',0.25000000,'Eco-systemes',1,1),(33,'ES-A-C','Imprimante, photocopieur, telecopieur',0.42000000,'Eco-systemes',1,1),(34,'ES-A-D','Accessoires, clavier, souris, PDA, imprimante photo, appareil photo, gps, telephone, repondeur, telephone sans fil, modem, telecommande, casque, camescope, baladeur mp3, radio portable, radio K7 et CD portable, radio reveil',0.08400000,'Eco-systemes',1,1),(35,'ES-A-E','GSM',0.00840000,'Eco-systemes',1,1),(36,'ES-A-F','Jouets et equipements de loisirs et de sports < 0,5 kg',0.04200000,'Eco-systemes',1,1),(37,'ES-A-G','Jouets et equipements de loisirs et de sports > 0,5 kg',0.17000000,'Eco-systemes',1,1),(38,'ES-A-H','Jouets et equipements de loisirs et de sports > 10 kg',1.25000000,'Eco-systemes',1,1); +/*!40000 ALTER TABLE `llx_c_ecotaxe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_effectif` +-- + +DROP TABLE IF EXISTS `llx_c_effectif`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_effectif` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_effectif` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_effectif` +-- + +LOCK TABLES `llx_c_effectif` WRITE; +/*!40000 ALTER TABLE `llx_c_effectif` DISABLE KEYS */; +INSERT INTO `llx_c_effectif` VALUES (0,'EF0','-',1,NULL),(1,'EF1-5','1 - 5',1,NULL),(2,'EF6-10','6 - 10',1,NULL),(3,'EF11-50','11 - 50',1,NULL),(4,'EF51-100','51 - 100',1,NULL),(5,'EF100-500','100 - 500',1,NULL),(6,'EF500-','> 500',1,NULL); +/*!40000 ALTER TABLE `llx_c_effectif` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_email_templates` +-- + +DROP TABLE IF EXISTS `llx_c_email_templates`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_email_templates` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `type_template` varchar(32) DEFAULT NULL, + `lang` varchar(6) DEFAULT NULL, + `private` smallint(6) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) DEFAULT NULL, + `position` smallint(6) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `topic` text, + `content` text, + `content_lines` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_email_templates` (`entity`,`label`,`lang`), + KEY `idx_type` (`type_template`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_email_templates` +-- + +LOCK TABLES `llx_c_email_templates` WRITE; +/*!40000 ALTER TABLE `llx_c_email_templates` DISABLE KEYS */; +INSERT INTO `llx_c_email_templates` VALUES (1,1,NULL,'propal_send',NULL,1,NULL,NULL,'2017-02-12 16:42:47','ggg',1,1,'gg','gggfff',NULL); +/*!40000 ALTER TABLE `llx_c_email_templates` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_field_list` +-- + +DROP TABLE IF EXISTS `llx_c_field_list`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_field_list` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `element` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `name` varchar(32) NOT NULL, + `alias` varchar(32) NOT NULL, + `title` varchar(32) NOT NULL, + `align` varchar(6) DEFAULT 'left', + `sort` tinyint(4) NOT NULL DEFAULT '1', + `search` tinyint(4) NOT NULL DEFAULT '0', + `enabled` varchar(255) DEFAULT '1', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_field_list` +-- + +LOCK TABLES `llx_c_field_list` WRITE; +/*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */; +INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); +/*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_format_cards` +-- + +DROP TABLE IF EXISTS `llx_c_format_cards`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_format_cards` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(50) NOT NULL, + `name` varchar(50) NOT NULL, + `paper_size` varchar(20) NOT NULL, + `orientation` varchar(1) NOT NULL, + `metric` varchar(5) NOT NULL, + `leftmargin` double(24,8) NOT NULL, + `topmargin` double(24,8) NOT NULL, + `nx` int(11) NOT NULL, + `ny` int(11) NOT NULL, + `spacex` double(24,8) NOT NULL, + `spacey` double(24,8) NOT NULL, + `width` double(24,8) NOT NULL, + `height` double(24,8) NOT NULL, + `font_size` int(11) NOT NULL, + `custom_x` double(24,8) NOT NULL, + `custom_y` double(24,8) NOT NULL, + `active` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_format_cards` +-- + +LOCK TABLES `llx_c_format_cards` WRITE; +/*!40000 ALTER TABLE `llx_c_format_cards` DISABLE KEYS */; +INSERT INTO `llx_c_format_cards` VALUES (1,'5160','Avery-5160, WL-875WX','letter','P','mm',5.58165000,12.70000000,3,10,3.55600000,0.00000000,65.87490000,25.40000000,7,0.00000000,0.00000000,1),(2,'5161','Avery-5161, WL-75WX','letter','P','mm',4.44500000,12.70000000,2,10,3.96800000,0.00000000,101.60000000,25.40000000,7,0.00000000,0.00000000,1),(3,'5162','Avery-5162, WL-100WX','letter','P','mm',3.87350000,22.35200000,2,7,4.95400000,0.00000000,101.60000000,33.78100000,8,0.00000000,0.00000000,1),(4,'5163','Avery-5163, WL-125WX','letter','P','mm',4.57200000,12.70000000,2,5,3.55600000,0.00000000,101.60000000,50.80000000,10,0.00000000,0.00000000,1),(5,'5164','5164 (Letter)','letter','P','in',0.14800000,0.50000000,2,3,0.20310000,0.00000000,4.00000000,3.33000000,12,0.00000000,0.00000000,0),(6,'8600','Avery-8600','letter','P','mm',7.10000000,19.00000000,3,10,9.50000000,3.10000000,66.60000000,25.40000000,7,0.00000000,0.00000000,1),(7,'99012','DYMO 99012 89*36mm','custom','L','mm',1.00000000,1.00000000,1,1,0.00000000,0.00000000,36.00000000,89.00000000,10,36.00000000,89.00000000,1),(8,'99014','DYMO 99014 101*54mm','custom','L','mm',1.00000000,1.00000000,1,1,0.00000000,0.00000000,54.00000000,101.00000000,10,54.00000000,101.00000000,1),(9,'AVERYC32010','Avery-C32010','A4','P','mm',15.00000000,13.00000000,2,5,10.00000000,0.00000000,85.00000000,54.00000000,10,0.00000000,0.00000000,1),(10,'CARD','Dolibarr Business cards','A4','P','mm',15.00000000,15.00000000,2,5,0.00000000,0.00000000,85.00000000,54.00000000,10,0.00000000,0.00000000,1),(11,'L7163','Avery-L7163','A4','P','mm',5.00000000,15.00000000,2,7,2.50000000,0.00000000,99.10000000,38.10000000,8,0.00000000,0.00000000,1); +/*!40000 ALTER TABLE `llx_c_format_cards` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_forme_juridique` +-- + +DROP TABLE IF EXISTS `llx_c_forme_juridique`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_forme_juridique` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` int(11) NOT NULL, + `fk_pays` int(11) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `isvatexempted` tinyint(4) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_forme_juridique` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=100221 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_forme_juridique` +-- + +LOCK TABLES `llx_c_forme_juridique` WRITE; +/*!40000 ALTER TABLE `llx_c_forme_juridique` DISABLE KEYS */; +INSERT INTO `llx_c_forme_juridique` VALUES (100001,100001,1,'Etudiant',0,0,'cabinetmed',0),(100002,100002,1,'Retraité',0,0,'cabinetmed',0),(100003,100003,1,'Artisan',0,0,'cabinetmed',0),(100004,100004,1,'Femme de ménage',0,0,'cabinetmed',0),(100005,100005,1,'Professeur',0,0,'cabinetmed',0),(100006,100006,1,'Profession libérale',0,0,'cabinetmed',0),(100007,100007,1,'Informaticien',0,0,'cabinetmed',0),(100009,0,0,'-',0,1,NULL,0),(100010,2301,23,'Monotributista',0,1,NULL,0),(100011,2302,23,'Sociedad Civil',0,1,NULL,0),(100012,2303,23,'Sociedades Comerciales',0,1,NULL,0),(100013,2304,23,'Sociedades de Hecho',0,1,NULL,0),(100014,2305,23,'Sociedades Irregulares',0,1,NULL,0),(100015,2306,23,'Sociedad Colectiva',0,1,NULL,0),(100016,2307,23,'Sociedad en Comandita Simple',0,1,NULL,0),(100017,2308,23,'Sociedad de Capital e Industria',0,1,NULL,0),(100018,2309,23,'Sociedad Accidental o en participación',0,1,NULL,0),(100019,2310,23,'Sociedad de Responsabilidad Limitada',0,1,NULL,0),(100020,2311,23,'Sociedad Anónima',0,1,NULL,0),(100021,2312,23,'Sociedad Anónima con Participación Estatal Mayoritaria',0,1,NULL,0),(100022,2313,23,'Sociedad en Comandita por Acciones (arts. 315 a 324, LSC)',0,1,NULL,0),(100023,11,1,'Artisan Commerçant (EI)',0,1,NULL,0),(100024,12,1,'Commerçant (EI)',0,1,NULL,0),(100025,13,1,'Artisan (EI)',0,1,NULL,0),(100026,14,1,'Officier public ou ministériel',0,1,NULL,0),(100027,15,1,'Profession libérale (EI)',0,1,NULL,0),(100028,16,1,'Exploitant agricole',0,1,NULL,0),(100029,17,1,'Agent commercial',0,1,NULL,0),(100030,18,1,'Associé Gérant de société',0,1,NULL,0),(100031,19,1,'Personne physique',0,1,NULL,0),(100032,21,1,'Indivision',0,1,NULL,0),(100033,22,1,'Société créée de fait',0,1,NULL,0),(100034,23,1,'Société en participation',0,1,NULL,0),(100035,27,1,'Paroisse hors zone concordataire',0,1,NULL,0),(100036,29,1,'Groupement de droit privé non doté de la personnalité morale',0,1,NULL,0),(100037,31,1,'Personne morale de droit étranger, immatriculée au RCS',0,1,NULL,0),(100038,32,1,'Personne morale de droit étranger, non immatriculée au RCS',0,1,NULL,0),(100039,35,1,'Régime auto-entrepreneur',0,1,NULL,0),(100040,41,1,'Etablissement public ou régie à caractère industriel ou commercial',0,1,NULL,0),(100041,51,1,'Société coopérative commerciale particulière',0,1,NULL,0),(100042,52,1,'Société en nom collectif',0,1,NULL,0),(100043,53,1,'Société en commandite',0,1,NULL,0),(100044,54,1,'Société à responsabilité limitée (SARL)',0,1,NULL,0),(100045,55,1,'Société anonyme à conseil d administration',0,1,NULL,0),(100046,56,1,'Société anonyme à directoire',0,1,NULL,0),(100047,57,1,'Société par actions simplifiée (SAS)',0,1,NULL,0),(100048,58,1,'Entreprise Unipersonnelle à Responsabilité Limitée (EURL)',0,1,NULL,0),(100049,59,1,'Société par actions simplifiée unipersonnelle (SASU)',0,1,NULL,0),(100050,60,1,'Entreprise Individuelle à Responsabilité Limitée (EIRL)',0,1,NULL,0),(100051,61,1,'Caisse d\'épargne et de prévoyance',0,1,NULL,0),(100052,62,1,'Groupement d\'intérêt économique (GIE)',0,1,NULL,0),(100053,63,1,'Société coopérative agricole',0,1,NULL,0),(100054,64,1,'Société non commerciale d assurances',0,1,NULL,0),(100055,65,1,'Société civile',0,1,NULL,0),(100056,69,1,'Personnes de droit privé inscrites au RCS',0,1,NULL,0),(100057,71,1,'Administration de l état',0,1,NULL,0),(100058,72,1,'Collectivité territoriale',0,1,NULL,0),(100059,73,1,'Etablissement public administratif',0,1,NULL,0),(100060,74,1,'Personne morale de droit public administratif',0,1,NULL,0),(100061,81,1,'Organisme gérant régime de protection social à adhésion obligatoire',0,1,NULL,0),(100062,82,1,'Organisme mutualiste',0,1,NULL,0),(100063,83,1,'Comité d entreprise',0,1,NULL,0),(100064,84,1,'Organisme professionnel',0,1,NULL,0),(100065,85,1,'Organisme de retraite à adhésion non obligatoire',0,1,NULL,0),(100066,91,1,'Syndicat de propriétaires',0,1,NULL,0),(100067,92,1,'Association loi 1901 ou assimilé',0,1,NULL,0),(100068,93,1,'Fondation',0,1,NULL,0),(100069,99,1,'Personne morale de droit privé',0,1,NULL,0),(100070,200,2,'Indépendant',0,1,NULL,0),(100071,201,2,'SPRL - Société à responsabilité limitée',0,1,NULL,0),(100072,202,2,'SA - Société Anonyme',0,1,NULL,0),(100073,203,2,'SCRL - Société coopérative à responsabilité limitée',0,1,NULL,0),(100074,204,2,'ASBL - Association sans but Lucratif',0,1,NULL,0),(100075,205,2,'SCRI - Société coopérative à responsabilité illimitée',0,1,NULL,0),(100076,206,2,'SCS - Société en commandite simple',0,1,NULL,0),(100077,207,2,'SCA - Société en commandite par action',0,1,NULL,0),(100078,208,2,'SNC - Société en nom collectif',0,1,NULL,0),(100079,209,2,'GIE - Groupement d intérêt économique',0,1,NULL,0),(100080,210,2,'GEIE - Groupement européen d intérêt économique',0,1,NULL,0),(100081,220,2,'Eenmanszaak',0,1,NULL,0),(100082,221,2,'BVBA - Besloten vennootschap met beperkte aansprakelijkheid',0,1,NULL,0),(100083,222,2,'NV - Naamloze Vennootschap',0,1,NULL,0),(100084,223,2,'CVBA - Coöperatieve vennootschap met beperkte aansprakelijkheid',0,1,NULL,0),(100085,224,2,'VZW - Vereniging zonder winstoogmerk',0,1,NULL,0),(100086,225,2,'CVOA - Coöperatieve vennootschap met onbeperkte aansprakelijkheid ',0,1,NULL,0),(100087,226,2,'GCV - Gewone commanditaire vennootschap',0,1,NULL,0),(100088,227,2,'Comm.VA - Commanditaire vennootschap op aandelen',0,1,NULL,0),(100089,228,2,'VOF - Vennootschap onder firma',0,1,NULL,0),(100090,229,2,'VS0 - Vennootschap met sociaal oogmerk',0,1,NULL,0),(100091,500,5,'GmbH - Gesellschaft mit beschränkter Haftung',0,1,NULL,0),(100092,501,5,'AG - Aktiengesellschaft ',0,1,NULL,0),(100093,502,5,'GmbH&Co. KG - Gesellschaft mit beschränkter Haftung & Compagnie Kommanditgesellschaft',0,1,NULL,0),(100094,503,5,'Gewerbe - Personengesellschaft',0,1,NULL,0),(100095,504,5,'UG - Unternehmergesellschaft -haftungsbeschränkt-',0,1,NULL,0),(100096,505,5,'GbR - Gesellschaft des bürgerlichen Rechts',0,1,NULL,0),(100097,506,5,'KG - Kommanditgesellschaft',0,1,NULL,0),(100098,507,5,'Ltd. - Limited Company',0,1,NULL,0),(100099,508,5,'OHG - Offene Handelsgesellschaft',0,1,NULL,0),(100100,10201,102,'Ατομική επιχείρηση',0,1,NULL,0),(100101,10202,102,'Εταιρική επιχείρηση',0,1,NULL,0),(100102,10203,102,'Ομόρρυθμη Εταιρεία Ο.Ε',0,1,NULL,0),(100103,10204,102,'Ετερόρρυθμη Εταιρεία Ε.Ε',0,1,NULL,0),(100104,10205,102,'Εταιρεία Περιορισμένης Ευθύνης Ε.Π.Ε',0,1,NULL,0),(100105,10206,102,'Ανώνυμη Εταιρεία Α.Ε',0,1,NULL,0),(100106,10207,102,'Ανώνυμη ναυτιλιακή εταιρεία Α.Ν.Ε',0,1,NULL,0),(100107,10208,102,'Συνεταιρισμός',0,1,NULL,0),(100108,10209,102,'Συμπλοιοκτησία',0,1,NULL,0),(100109,301,3,'Società semplice',0,1,NULL,0),(100110,302,3,'Società in nome collettivo s.n.c.',0,1,NULL,0),(100111,303,3,'Società in accomandita semplice s.a.s.',0,1,NULL,0),(100112,304,3,'Società per azioni s.p.a.',0,1,NULL,0),(100113,305,3,'Società a responsabilità limitata s.r.l.',0,1,NULL,0),(100114,306,3,'Società in accomandita per azioni s.a.p.a.',0,1,NULL,0),(100115,307,3,'Società cooperativa a r.l.',0,1,NULL,0),(100116,308,3,'Società consortile',0,1,NULL,0),(100117,309,3,'Società europea',0,1,NULL,0),(100118,310,3,'Società cooperativa europea',0,1,NULL,0),(100119,311,3,'Società unipersonale',0,1,NULL,0),(100120,312,3,'Società di professionisti',0,1,NULL,0),(100121,313,3,'Società di fatto',0,1,NULL,0),(100122,315,3,'Società apparente',0,1,NULL,0),(100123,316,3,'Impresa individuale ',0,1,NULL,0),(100124,317,3,'Impresa coniugale',0,1,NULL,0),(100125,318,3,'Impresa familiare',0,1,NULL,0),(100126,319,3,'Consorzio cooperativo',0,1,NULL,0),(100127,320,3,'Società cooperativa sociale',0,1,NULL,0),(100128,321,3,'Società cooperativa di consumo',0,1,NULL,0),(100129,322,3,'Società cooperativa agricola',0,1,NULL,0),(100130,323,3,'A.T.I. Associazione temporanea di imprese',0,1,NULL,0),(100131,324,3,'R.T.I. Raggruppamento temporaneo di imprese',0,1,NULL,0),(100132,325,3,'Studio associato',0,1,NULL,0),(100133,600,6,'Raison Individuelle',0,1,NULL,0),(100134,601,6,'Société Simple',0,1,NULL,0),(100135,602,6,'Société en nom collectif',0,1,NULL,0),(100136,603,6,'Société en commandite',0,1,NULL,0),(100137,604,6,'Société anonyme (SA)',0,1,NULL,0),(100138,605,6,'Société en commandite par actions',0,1,NULL,0),(100139,606,6,'Société à responsabilité limitée (SARL)',0,1,NULL,0),(100140,607,6,'Société coopérative',0,1,NULL,0),(100141,608,6,'Association',0,1,NULL,0),(100142,609,6,'Fondation',0,1,NULL,0),(100143,700,7,'Sole Trader',0,1,NULL,0),(100144,701,7,'Partnership',0,1,NULL,0),(100145,702,7,'Private Limited Company by shares (LTD)',0,1,NULL,0),(100146,703,7,'Public Limited Company',0,1,NULL,0),(100147,704,7,'Workers Cooperative',0,1,NULL,0),(100148,705,7,'Limited Liability Partnership',0,1,NULL,0),(100149,706,7,'Franchise',0,1,NULL,0),(100150,1000,10,'Société à responsabilité limitée (SARL)',0,1,NULL,0),(100151,1001,10,'Société en Nom Collectif (SNC)',0,1,NULL,0),(100152,1002,10,'Société en Commandite Simple (SCS)',0,1,NULL,0),(100153,1003,10,'société en participation',0,1,NULL,0),(100154,1004,10,'Société Anonyme (SA)',0,1,NULL,0),(100155,1005,10,'Société Unipersonnelle à Responsabilité Limitée (SUARL)',0,1,NULL,0),(100156,1006,10,'Groupement d\'intérêt économique (GEI)',0,1,NULL,0),(100157,1007,10,'Groupe de sociétés',0,1,NULL,0),(100158,1701,17,'Eenmanszaak',0,1,NULL,0),(100159,1702,17,'Maatschap',0,1,NULL,0),(100160,1703,17,'Vennootschap onder firma',0,1,NULL,0),(100161,1704,17,'Commanditaire vennootschap',0,1,NULL,0),(100162,1705,17,'Besloten vennootschap (BV)',0,1,NULL,0),(100163,1706,17,'Naamloze Vennootschap (NV)',0,1,NULL,0),(100164,1707,17,'Vereniging',0,1,NULL,0),(100165,1708,17,'Stichting',0,1,NULL,0),(100166,1709,17,'Coöperatie met beperkte aansprakelijkheid (BA)',0,1,NULL,0),(100167,1710,17,'Coöperatie met uitgesloten aansprakelijkheid (UA)',0,1,NULL,0),(100168,1711,17,'Coöperatie met wettelijke aansprakelijkheid (WA)',0,1,NULL,0),(100169,1712,17,'Onderlinge waarborgmaatschappij',0,1,NULL,0),(100170,401,4,'Empresario Individual',0,1,NULL,0),(100171,402,4,'Comunidad de Bienes',0,1,NULL,0),(100172,403,4,'Sociedad Civil',0,1,NULL,0),(100173,404,4,'Sociedad Colectiva',0,1,NULL,0),(100174,405,4,'Sociedad Limitada',0,1,NULL,0),(100175,406,4,'Sociedad Anónima',0,1,NULL,0),(100176,407,4,'Sociedad Comanditaria por Acciones',0,1,NULL,0),(100177,408,4,'Sociedad Comanditaria Simple',0,1,NULL,0),(100178,409,4,'Sociedad Laboral',0,1,NULL,0),(100179,410,4,'Sociedad Cooperativa',0,1,NULL,0),(100180,411,4,'Sociedad de Garantía Recíproca',0,1,NULL,0),(100181,412,4,'Entidad de Capital-Riesgo',0,1,NULL,0),(100182,413,4,'Agrupación de Interés Económico',0,1,NULL,0),(100183,414,4,'Sociedad de Inversión Mobiliaria',0,1,NULL,0),(100184,415,4,'Agrupación sin Ánimo de Lucro',0,1,NULL,0),(100185,15201,152,'Mauritius Private Company Limited By Shares',0,1,NULL,0),(100186,15202,152,'Mauritius Company Limited By Guarantee',0,1,NULL,0),(100187,15203,152,'Mauritius Public Company Limited By Shares',0,1,NULL,0),(100188,15204,152,'Mauritius Foreign Company',0,1,NULL,0),(100189,15205,152,'Mauritius GBC1 (Offshore Company)',0,1,NULL,0),(100190,15206,152,'Mauritius GBC2 (International Company)',0,1,NULL,0),(100191,15207,152,'Mauritius General Partnership',0,1,NULL,0),(100192,15208,152,'Mauritius Limited Partnership',0,1,NULL,0),(100193,15209,152,'Mauritius Sole Proprietorship',0,1,NULL,0),(100194,15210,152,'Mauritius Trusts',0,1,NULL,0),(100195,15401,154,'Sociedad en nombre colectivo',0,1,NULL,0),(100196,15402,154,'Sociedad en comandita simple',0,1,NULL,0),(100197,15403,154,'Sociedad de responsabilidad limitada',0,1,NULL,0),(100198,15404,154,'Sociedad anónima',0,1,NULL,0),(100199,15405,154,'Sociedad en comandita por acciones',0,1,NULL,0),(100200,15406,154,'Sociedad cooperativa',0,1,NULL,0),(100201,4100,41,'GmbH - Gesellschaft mit beschränkter Haftung',0,1,NULL,0),(100202,4101,41,'GesmbH - Gesellschaft mit beschränkter Haftung',0,1,NULL,0),(100203,4102,41,'AG - Aktiengesellschaft',0,1,NULL,0),(100204,4103,41,'EWIV - Europäische wirtschaftliche Interessenvereinigung',0,1,NULL,0),(100205,4104,41,'KEG - Kommanditerwerbsgesellschaft',0,1,NULL,0),(100206,4105,41,'OEG - Offene Erwerbsgesellschaft',0,1,NULL,0),(100207,4106,41,'OHG - Offene Handelsgesellschaft',0,1,NULL,0),(100208,4107,41,'AG & Co KG - Kommanditgesellschaft',0,1,NULL,0),(100209,4108,41,'GmbH & Co KG - Kommanditgesellschaft',0,1,NULL,0),(100210,4109,41,'KG - Kommanditgesellschaft',0,1,NULL,0),(100211,4110,41,'OG - Offene Gesellschaft',0,1,NULL,0),(100212,4111,41,'GbR - Gesellschaft nach bürgerlichem Recht',0,1,NULL,0),(100213,4112,41,'GesbR - Gesellschaft nach bürgerlichem Recht',0,1,NULL,0),(100214,4113,41,'GesnbR - Gesellschaft nach bürgerlichem Recht',0,1,NULL,0),(100215,4114,41,'e.U. - eingetragener Einzelunternehmer',0,1,NULL,0),(100216,17801,178,'Empresa individual',0,1,NULL,0),(100217,17802,178,'Asociación General',0,1,NULL,0),(100218,17803,178,'Sociedad de Responsabilidad Limitada',0,1,NULL,0),(100219,17804,178,'Sociedad Civil',0,1,NULL,0),(100220,17805,178,'Sociedad Anónima',0,1,NULL,0); +/*!40000 ALTER TABLE `llx_c_forme_juridique` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_holiday_types` +-- + +DROP TABLE IF EXISTS `llx_c_holiday_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_holiday_types` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(255) NOT NULL, + `affect` int(11) NOT NULL, + `delay` int(11) NOT NULL, + `newByMonth` double(8,5) NOT NULL DEFAULT '0.00000', + `fk_country` int(11) DEFAULT NULL, + `active` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_holiday_types` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_holiday_types` +-- + +LOCK TABLES `llx_c_holiday_types` WRITE; +/*!40000 ALTER TABLE `llx_c_holiday_types` DISABLE KEYS */; +INSERT INTO `llx_c_holiday_types` VALUES (1,'LEAVE_SICK','Sick leave',0,0,0.00000,NULL,1),(2,'LEAVE_OTHER','Other leave',0,0,0.00000,NULL,1),(3,'LEAVE_PAID','Paid vacation',1,7,0.00000,NULL,1),(4,'LEAVE_RTT_FR','RTT',1,7,0.83000,1,0),(5,'LEAVE_PAID_FR','Paid vacation',1,30,2.08334,1,0); +/*!40000 ALTER TABLE `llx_c_holiday_types` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_hrm_department` +-- + +DROP TABLE IF EXISTS `llx_c_hrm_department`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_hrm_department` ( + `rowid` int(11) NOT NULL, + `pos` tinyint(4) NOT NULL DEFAULT '0', + `code` varchar(16) NOT NULL, + `label` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_hrm_department` +-- + +LOCK TABLES `llx_c_hrm_department` WRITE; +/*!40000 ALTER TABLE `llx_c_hrm_department` DISABLE KEYS */; +INSERT INTO `llx_c_hrm_department` VALUES (1,5,'MANAGEMENT','Management',1),(2,10,'GESTION','Gestion',1),(3,15,'TRAINING','Training',1),(4,20,'IT','Inform. Technology (IT)',1),(5,25,'MARKETING','Marketing',1),(6,30,'SALES','Sales',1),(7,35,'LEGAL','Legal',1),(8,40,'FINANCIAL','Financial accounting',1),(9,45,'HUMANRES','Human resources',1),(10,50,'PURCHASING','Purchasing',1),(11,55,'SERVICES','Services',1),(12,60,'CUSTOMSERV','Customer service',1),(13,65,'CONSULTING','Consulting',1),(14,70,'LOGISTIC','Logistics',1),(15,75,'CONSTRUCT','Engineering/design',1),(16,80,'PRODUCTION','Manufacturing',1),(17,85,'QUALITY','Quality assurance',1),(18,85,'MAINT','Plant assurance',1); +/*!40000 ALTER TABLE `llx_c_hrm_department` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_hrm_function` +-- + +DROP TABLE IF EXISTS `llx_c_hrm_function`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_hrm_function` ( + `rowid` int(11) NOT NULL, + `pos` tinyint(4) NOT NULL DEFAULT '0', + `code` varchar(16) NOT NULL, + `label` varchar(50) DEFAULT NULL, + `c_level` tinyint(4) NOT NULL DEFAULT '0', + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_hrm_function` +-- + +LOCK TABLES `llx_c_hrm_function` WRITE; +/*!40000 ALTER TABLE `llx_c_hrm_function` DISABLE KEYS */; +INSERT INTO `llx_c_hrm_function` VALUES (1,5,'EXECBOARD','Executive board',0,1),(2,10,'MANAGDIR','Managing director',1,1),(3,15,'ACCOUNTMANAG','Account manager',0,1),(4,20,'ENGAGDIR','Engagement director',1,1),(5,25,'DIRECTOR','Director',1,1),(6,30,'PROJMANAG','Project manager',0,1),(7,35,'DEPHEAD','Department head',0,1),(8,40,'SECRETAR','Secretary',0,1),(9,45,'EMPLOYEE','Department employee',0,1); +/*!40000 ALTER TABLE `llx_c_hrm_function` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_incoterms` +-- + +DROP TABLE IF EXISTS `llx_c_incoterms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_incoterms` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(3) NOT NULL, + `libelle` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_incoterms` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_incoterms` +-- + +LOCK TABLES `llx_c_incoterms` WRITE; +/*!40000 ALTER TABLE `llx_c_incoterms` DISABLE KEYS */; +INSERT INTO `llx_c_incoterms` VALUES (1,'EXW','Ex Works, au départ non chargé, non dédouané sortie d\'usine (uniquement adapté aux flux domestiques, nationaux)',1),(2,'FCA','Free Carrier, marchandises dédouanées et chargées dans le pays de départ, chez le vendeur ou chez le commissionnaire de transport de l\'acheteur',1),(3,'FAS','Free Alongside Ship, sur le quai du port de départ',1),(4,'FOB','Free On Board, chargé sur le bateau, les frais de chargement dans celui-ci étant fonction du liner term indiqué par la compagnie maritime (à la charge du vendeur)',1),(5,'CFR','Cost and Freight, chargé dans le bateau, livraison au port de départ, frais payés jusqu\'au port d\'arrivée, sans assurance pour le transport, non déchargé du navire à destination (les frais de déchargement sont inclus ou non au port d\'arrivée)',1),(6,'CIF','Cost, Insurance and Freight, chargé sur le bateau, frais jusqu\'au port d\'arrivée, avec l\'assurance marchandise transportée souscrite par le vendeur pour le compte de l\'acheteur',1),(7,'CPT','Carriage Paid To, livraison au premier transporteur, frais jusqu\'au déchargement du mode de transport, sans assurance pour le transport',1),(8,'CIP','Carriage and Insurance Paid to, idem CPT, avec assurance marchandise transportée souscrite par le vendeur pour le compte de l\'acheteur',1),(9,'DAT','Delivered At Terminal, marchandises (déchargées) livrées sur quai, dans un terminal maritime, fluvial, aérien, routier ou ferroviaire désigné (dédouanement import, et post-acheminement payés par l\'acheteur)',1),(10,'DAP','Delivered At Place, marchandises (non déchargées) mises à disposition de l\'acheteur dans le pays d\'importation au lieu précisé dans le contrat (déchargement, dédouanement import payé par l\'acheteur)',1),(11,'DDP','Delivered Duty Paid, marchandises (non déchargées) livrées à destination finale, dédouanement import et taxes à la charge du vendeur ; l\'acheteur prend en charge uniquement le déchargement (si exclusion des taxes type TVA, le préciser clairement)',1); +/*!40000 ALTER TABLE `llx_c_incoterms` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_input_method` +-- + +DROP TABLE IF EXISTS `llx_c_input_method`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_input_method` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) DEFAULT NULL, + `libelle` varchar(60) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`), + UNIQUE KEY `uk_c_input_method` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_input_method` +-- + +LOCK TABLES `llx_c_input_method` WRITE; +/*!40000 ALTER TABLE `llx_c_input_method` DISABLE KEYS */; +INSERT INTO `llx_c_input_method` VALUES (1,'OrderByMail','Courrier',1,NULL),(2,'OrderByFax','Fax',1,NULL),(3,'OrderByEMail','EMail',1,NULL),(4,'OrderByPhone','Téléphone',1,NULL),(5,'OrderByWWW','En ligne',1,NULL); +/*!40000 ALTER TABLE `llx_c_input_method` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_input_reason` +-- + +DROP TABLE IF EXISTS `llx_c_input_reason`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_input_reason` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) NOT NULL, + `label` varchar(60) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_input_reason` (`code`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_input_reason` +-- + +LOCK TABLES `llx_c_input_reason` WRITE; +/*!40000 ALTER TABLE `llx_c_input_reason` DISABLE KEYS */; +INSERT INTO `llx_c_input_reason` VALUES (1,'SRC_INTE','Web site',1,NULL),(2,'SRC_CAMP_MAIL','Mailing campaign',1,NULL),(3,'SRC_CAMP_PHO','Phone campaign',1,NULL),(4,'SRC_CAMP_FAX','Fax campaign',1,NULL),(5,'SRC_COMM','Commercial contact',1,NULL),(6,'SRC_SHOP','Shop contact',1,NULL),(7,'SRC_CAMP_EMAIL','EMailing campaign',1,NULL),(8,'SRC_WOM','Word of mouth',1,NULL),(9,'SRC_PARTNER','Partner',1,NULL),(10,'SRC_EMPLOYEE','Employee',1,NULL),(11,'SRC_SPONSORING','Sponsoring',1,NULL); +/*!40000 ALTER TABLE `llx_c_input_reason` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_lead_status` +-- + +DROP TABLE IF EXISTS `llx_c_lead_status`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_lead_status` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(10) DEFAULT NULL, + `label` varchar(50) DEFAULT NULL, + `position` int(11) DEFAULT NULL, + `percent` double(5,2) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_lead_status_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_lead_status` +-- + +LOCK TABLES `llx_c_lead_status` WRITE; +/*!40000 ALTER TABLE `llx_c_lead_status` DISABLE KEYS */; +INSERT INTO `llx_c_lead_status` VALUES (1,'PROSP','Prospection',10,0.00,1),(2,'QUAL','Qualification',20,20.00,1),(3,'PROPO','Proposal',30,40.00,1),(4,'NEGO','Negotiation',40,60.00,1),(5,'PENDING','Pending',50,50.00,0),(6,'WON','Won',60,100.00,1),(7,'LOST','Lost',70,0.00,1); +/*!40000 ALTER TABLE `llx_c_lead_status` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_methode_commande_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_c_methode_commande_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_methode_commande_fournisseur` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(30) DEFAULT NULL, + `libelle` varchar(60) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_methode_commande_fournisseur` +-- + +LOCK TABLES `llx_c_methode_commande_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_c_methode_commande_fournisseur` VALUES (1,'OrderByMail','Courrier',1),(2,'OrderByFax','Fax',1),(3,'OrderByEMail','EMail',1),(4,'OrderByPhone','Téléphone',1),(5,'OrderByWWW','En ligne',1); +/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_paiement` +-- + +DROP TABLE IF EXISTS `llx_c_paiement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_paiement` ( + `id` int(11) NOT NULL, + `code` varchar(6) NOT NULL, + `libelle` varchar(62) DEFAULT NULL, + `type` smallint(6) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code` varchar(32) DEFAULT NULL, + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_paiement` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_paiement` +-- + +LOCK TABLES `llx_c_paiement` WRITE; +/*!40000 ALTER TABLE `llx_c_paiement` DISABLE KEYS */; +INSERT INTO `llx_c_paiement` VALUES (0,'','-',3,1,NULL,NULL),(1,'TIP','TIP',2,0,NULL,NULL),(2,'VIR','Virement',2,1,NULL,NULL),(3,'PRE','Prélèvement',2,1,NULL,NULL),(4,'LIQ','Espèces',2,1,NULL,NULL),(6,'CB','Carte Bancaire',2,1,NULL,NULL),(7,'CHQ','Chèque',2,1,NULL,NULL),(50,'VAD','Paiement en ligne',2,0,NULL,NULL),(51,'TRA','Traite',2,0,NULL,NULL),(52,'LCR','LCR',2,0,NULL,NULL),(53,'FAC','Factor',2,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_paiement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_paper_format` +-- + +DROP TABLE IF EXISTS `llx_c_paper_format`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_paper_format` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(16) NOT NULL, + `label` varchar(50) NOT NULL, + `width` float(6,2) DEFAULT '0.00', + `height` float(6,2) DEFAULT '0.00', + `unit` varchar(5) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=226 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_paper_format` +-- + +LOCK TABLES `llx_c_paper_format` WRITE; +/*!40000 ALTER TABLE `llx_c_paper_format` DISABLE KEYS */; +INSERT INTO `llx_c_paper_format` VALUES (1,'EU4A0','Format 4A0',1682.00,2378.00,'mm',1,NULL),(2,'EU2A0','Format 2A0',1189.00,1682.00,'mm',1,NULL),(3,'EUA0','Format A0',840.00,1189.00,'mm',1,NULL),(4,'EUA1','Format A1',594.00,840.00,'mm',1,NULL),(5,'EUA2','Format A2',420.00,594.00,'mm',1,NULL),(6,'EUA3','Format A3',297.00,420.00,'mm',1,NULL),(7,'EUA4','Format A4',210.00,297.00,'mm',1,NULL),(8,'EUA5','Format A5',148.00,210.00,'mm',1,NULL),(9,'EUA6','Format A6',105.00,148.00,'mm',1,NULL),(100,'USLetter','Format Letter (A)',216.00,279.00,'mm',1,NULL),(105,'USLegal','Format Legal',216.00,356.00,'mm',1,NULL),(110,'USExecutive','Format Executive',190.00,254.00,'mm',1,NULL),(115,'USLedger','Format Ledger/Tabloid (B)',279.00,432.00,'mm',1,NULL),(200,'CAP1','Format Canadian P1',560.00,860.00,'mm',1,NULL),(205,'CAP2','Format Canadian P2',430.00,560.00,'mm',1,NULL),(210,'CAP3','Format Canadian P3',280.00,430.00,'mm',1,NULL),(215,'CAP4','Format Canadian P4',215.00,280.00,'mm',1,NULL),(220,'CAP5','Format Canadian P5',140.00,215.00,'mm',1,NULL),(225,'CAP6','Format Canadian P6',107.00,140.00,'mm',1,NULL); +/*!40000 ALTER TABLE `llx_c_paper_format` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_payment_term` +-- + +DROP TABLE IF EXISTS `llx_c_payment_term`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_payment_term` ( + `rowid` int(11) NOT NULL, + `code` varchar(16) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` tinyint(4) DEFAULT '1', + `libelle` varchar(255) DEFAULT NULL, + `libelle_facture` text, + `type_cdr` tinyint(4) DEFAULT NULL, + `nbjour` smallint(6) DEFAULT NULL, + `decalage` smallint(6) DEFAULT NULL, + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_payment_term` +-- + +LOCK TABLES `llx_c_payment_term` WRITE; +/*!40000 ALTER TABLE `llx_c_payment_term` DISABLE KEYS */; +INSERT INTO `llx_c_payment_term` VALUES (1,'RECEP',1,1,'A réception','Réception de facture',0,0,NULL,NULL),(2,'30D',2,1,'30 jours','Réglement à 30 jours',0,30,NULL,NULL),(3,'30DENDMONTH',3,1,'30 jours fin de mois','Réglement à 30 jours fin de mois',1,30,NULL,NULL),(4,'60D',4,1,'60 jours','Réglement à 60 jours',0,60,NULL,NULL),(5,'60DENDMONTH',5,1,'60 jours fin de mois','Réglement à 60 jours fin de mois',1,60,NULL,NULL),(6,'PT_ORDER',6,1,'A réception de commande','A réception de commande',0,0,NULL,NULL),(7,'PT_DELIVERY',7,1,'Livraison','Règlement à la livraison',0,0,NULL,NULL),(8,'PT_5050',8,1,'50 et 50','Règlement 50% à la commande, 50% à la livraison',0,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_payment_term` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_pays` +-- + +DROP TABLE IF EXISTS `llx_c_pays`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_pays` ( + `rowid` int(11) NOT NULL, + `code` varchar(2) NOT NULL, + `code_iso` varchar(3) DEFAULT NULL, + `libelle` varchar(50) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_c_pays_code` (`code`), + UNIQUE KEY `idx_c_pays_libelle` (`libelle`), + UNIQUE KEY `idx_c_pays_code_iso` (`code_iso`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_pays` +-- + +LOCK TABLES `llx_c_pays` WRITE; +/*!40000 ALTER TABLE `llx_c_pays` DISABLE KEYS */; +INSERT INTO `llx_c_pays` VALUES (0,'',NULL,'-',1),(1,'FR',NULL,'France',1),(2,'BE',NULL,'Belgium',1),(3,'IT',NULL,'Italy',1),(4,'ES',NULL,'Spain',1),(5,'DE',NULL,'Germany',1),(6,'CH',NULL,'Suisse',1),(7,'GB',NULL,'United Kingdow',1),(8,'IE',NULL,'Irland',1),(9,'CN',NULL,'China',1),(10,'TN',NULL,'Tunisie',1),(11,'US',NULL,'United States',1),(12,'MA',NULL,'Maroc',1),(13,'DZ',NULL,'Algérie',1),(14,'CA',NULL,'Canada',1),(15,'TG',NULL,'Togo',1),(16,'GA',NULL,'Gabon',1),(17,'NL',NULL,'Nerderland',1),(18,'HU',NULL,'Hongrie',1),(19,'RU',NULL,'Russia',1),(20,'SE',NULL,'Sweden',1),(21,'CI',NULL,'Côte d\'Ivoire',1),(22,'SN',NULL,'Sénégal',1),(23,'AR',NULL,'Argentine',1),(24,'CM',NULL,'Cameroun',1),(25,'PT',NULL,'Portugal',1),(26,'SA',NULL,'Arabie Saoudite',1),(27,'MC',NULL,'Monaco',1),(28,'AU',NULL,'Australia',1),(29,'SG',NULL,'Singapour',1),(30,'AF',NULL,'Afghanistan',1),(31,'AX',NULL,'Iles Aland',1),(32,'AL',NULL,'Albanie',1),(33,'AS',NULL,'Samoa américaines',1),(34,'AD',NULL,'Andorre',1),(35,'AO',NULL,'Angola',1),(36,'AI',NULL,'Anguilla',1),(37,'AQ',NULL,'Antarctique',1),(38,'AG',NULL,'Antigua-et-Barbuda',1),(39,'AM',NULL,'Arménie',1),(40,'AW',NULL,'Aruba',1),(41,'AT',NULL,'Autriche',1),(42,'AZ',NULL,'Azerbaïdjan',1),(43,'BS',NULL,'Bahamas',1),(44,'BH',NULL,'Bahreïn',1),(45,'BD',NULL,'Bangladesh',1),(46,'BB',NULL,'Barbade',1),(47,'BY',NULL,'Biélorussie',1),(48,'BZ',NULL,'Belize',1),(49,'BJ',NULL,'Bénin',1),(50,'BM',NULL,'Bermudes',1),(51,'BT',NULL,'Bhoutan',1),(52,'BO',NULL,'Bolivie',1),(53,'BA',NULL,'Bosnie-Herzégovine',1),(54,'BW',NULL,'Botswana',1),(55,'BV',NULL,'Ile Bouvet',1),(56,'BR',NULL,'Brésil',1),(57,'IO',NULL,'Territoire britannique de l\'Océan Indien',1),(58,'BN',NULL,'Brunei',1),(59,'BG',NULL,'Bulgarie',1),(60,'BF',NULL,'Burkina Faso',1),(61,'BI',NULL,'Burundi',1),(62,'KH',NULL,'Cambodge',1),(63,'CV',NULL,'Cap-Vert',1),(64,'KY',NULL,'Iles Cayman',1),(65,'CF',NULL,'République centrafricaine',1),(66,'TD',NULL,'Tchad',1),(67,'CL',NULL,'Chili',1),(68,'CX',NULL,'Ile Christmas',1),(69,'CC',NULL,'Iles des Cocos (Keeling)',1),(70,'CO',NULL,'Colombie',1),(71,'KM',NULL,'Comores',1),(72,'CG',NULL,'Congo',1),(73,'CD',NULL,'République démocratique du Congo',1),(74,'CK',NULL,'Iles Cook',1),(75,'CR',NULL,'Costa Rica',1),(76,'HR',NULL,'Croatie',1),(77,'CU',NULL,'Cuba',1),(78,'CY',NULL,'Chypre',1),(79,'CZ',NULL,'République Tchèque',1),(80,'DK',NULL,'Danemark',1),(81,'DJ',NULL,'Djibouti',1),(82,'DM',NULL,'Dominique',1),(83,'DO',NULL,'République Dominicaine',1),(84,'EC',NULL,'Equateur',1),(85,'EG',NULL,'Egypte',1),(86,'SV',NULL,'Salvador',1),(87,'GQ',NULL,'Guinée Equatoriale',1),(88,'ER',NULL,'Erythrée',1),(89,'EE',NULL,'Estonie',1),(90,'ET',NULL,'Ethiopie',1),(91,'FK',NULL,'Iles Falkland',1),(92,'FO',NULL,'Iles Féroé',1),(93,'FJ',NULL,'Iles Fidji',1),(94,'FI',NULL,'Finlande',1),(95,'GF',NULL,'Guyane française',1),(96,'PF',NULL,'Polynésie française',1),(97,'TF',NULL,'Terres australes françaises',1),(98,'GM',NULL,'Gambie',1),(99,'GE',NULL,'Géorgie',1),(100,'GH',NULL,'Ghana',1),(101,'GI',NULL,'Gibraltar',1),(102,'GR',NULL,'Grèce',1),(103,'GL',NULL,'Groenland',1),(104,'GD',NULL,'Grenade',1),(105,'GP',NULL,'Guadeloupe',1),(106,'GU',NULL,'Guam',1),(107,'GT',NULL,'Guatemala',1),(108,'GN',NULL,'Guinée',1),(109,'GW',NULL,'Guinée-Bissao',1),(110,'GY',NULL,'Guyana',1),(111,'HT',NULL,'Haiti',1),(112,'HM',NULL,'Iles Heard et McDonald',1),(113,'VA',NULL,'Saint-Siège (Vatican)',1),(114,'HN',NULL,'Honduras',1),(115,'HK',NULL,'Hong Kong',1),(116,'IS',NULL,'Islande',1),(117,'IN',NULL,'India',1),(118,'ID',NULL,'Indonésie',1),(119,'IR',NULL,'Iran',1),(120,'IQ',NULL,'Iraq',1),(121,'IL',NULL,'Israel',1),(122,'JM',NULL,'Jamaïque',1),(123,'JP',NULL,'Japon',1),(124,'JO',NULL,'Jordanie',1),(125,'KZ',NULL,'Kazakhstan',1),(126,'KE',NULL,'Kenya',1),(127,'KI',NULL,'Kiribati',1),(128,'KP',NULL,'Corée du Nord',1),(129,'KR',NULL,'Corée du Sud',1),(130,'KW',NULL,'Koweït',1),(131,'KG',NULL,'Kirghizistan',1),(132,'LA',NULL,'Laos',1),(133,'LV',NULL,'Lettonie',1),(134,'LB',NULL,'Liban',1),(135,'LS',NULL,'Lesotho',1),(136,'LR',NULL,'Liberia',1),(137,'LY',NULL,'Libye',1),(138,'LI',NULL,'Liechtenstein',1),(139,'LT',NULL,'Lituanie',1),(140,'LU',NULL,'Luxembourg',1),(141,'MO',NULL,'Macao',1),(142,'MK',NULL,'ex-République yougoslave de Macédoine',1),(143,'MG',NULL,'Madagascar',1),(144,'MW',NULL,'Malawi',1),(145,'MY',NULL,'Malaisie',1),(146,'MV',NULL,'Maldives',1),(147,'ML',NULL,'Mali',1),(148,'MT',NULL,'Malte',1),(149,'MH',NULL,'Iles Marshall',1),(150,'MQ',NULL,'Martinique',1),(151,'MR',NULL,'Mauritanie',1),(152,'MU',NULL,'Maurice',1),(153,'YT',NULL,'Mayotte',1),(154,'MX',NULL,'Mexique',1),(155,'FM',NULL,'Micronésie',1),(156,'MD',NULL,'Moldavie',1),(157,'MN',NULL,'Mongolie',1),(158,'MS',NULL,'Monserrat',1),(159,'MZ',NULL,'Mozambique',1),(160,'MM',NULL,'Birmanie (Myanmar)',1),(161,'NA',NULL,'Namibie',1),(162,'NR',NULL,'Nauru',1),(163,'NP',NULL,'Népal',1),(164,'AN',NULL,'Antilles néerlandaises',1),(165,'NC',NULL,'Nouvelle-Calédonie',1),(166,'NZ',NULL,'Nouvelle-Zélande',1),(167,'NI',NULL,'Nicaragua',1),(168,'NE',NULL,'Niger',1),(169,'NG',NULL,'Nigeria',1),(170,'NU',NULL,'Nioué',1),(171,'NF',NULL,'Ile Norfolk',1),(172,'MP',NULL,'Mariannes du Nord',1),(173,'NO',NULL,'Norvège',1),(174,'OM',NULL,'Oman',1),(175,'PK',NULL,'Pakistan',1),(176,'PW',NULL,'Palaos',1),(177,'PS',NULL,'territoire Palestinien Occupé',1),(178,'PA',NULL,'Panama',1),(179,'PG',NULL,'Papouasie-Nouvelle-Guinée',1),(180,'PY',NULL,'Paraguay',1),(181,'PE',NULL,'Pérou',1),(182,'PH',NULL,'Philippines',1),(183,'PN',NULL,'Iles Pitcairn',1),(184,'PL',NULL,'Pologne',1),(185,'PR',NULL,'Porto Rico',1),(186,'QA',NULL,'Qatar',1),(187,'RE',NULL,'Réunion',1),(188,'RO',NULL,'Roumanie',1),(189,'RW',NULL,'Rwanda',1),(190,'SH',NULL,'Sainte-Hélène',1),(191,'KN',NULL,'Saint-Christophe-et-Niévès',1),(192,'LC',NULL,'Sainte-Lucie',1),(193,'PM',NULL,'Saint-Pierre-et-Miquelon',1),(194,'VC',NULL,'Saint-Vincent-et-les-Grenadines',1),(195,'WS',NULL,'Samoa',1),(196,'SM',NULL,'Saint-Marin',1),(197,'ST',NULL,'Sao Tomé-et-Principe',1),(198,'RS',NULL,'Serbie',1),(199,'SC',NULL,'Seychelles',1),(200,'SL',NULL,'Sierra Leone',1),(201,'SK',NULL,'Slovaquie',1),(202,'SI',NULL,'Slovénie',1),(203,'SB',NULL,'Iles Salomon',1),(204,'SO',NULL,'Somalie',1),(205,'ZA',NULL,'Afrique du Sud',1),(206,'GS',NULL,'Iles Géorgie du Sud et Sandwich du Sud',1),(207,'LK',NULL,'Sri Lanka',1),(208,'SD',NULL,'Soudan',1),(209,'SR',NULL,'Suriname',1),(210,'SJ',NULL,'Iles Svalbard et Jan Mayen',1),(211,'SZ',NULL,'Swaziland',1),(212,'SY',NULL,'Syrie',1),(213,'TW',NULL,'Taïwan',1),(214,'TJ',NULL,'Tadjikistan',1),(215,'TZ',NULL,'Tanzanie',1),(216,'TH',NULL,'Thaïlande',1),(217,'TL',NULL,'Timor Oriental',1),(218,'TK',NULL,'Tokélaou',1),(219,'TO',NULL,'Tonga',1),(220,'TT',NULL,'Trinité-et-Tobago',1),(221,'TR',NULL,'Turquie',1),(222,'TM',NULL,'Turkménistan',1),(223,'TC',NULL,'Iles Turks-et-Caicos',1),(224,'TV',NULL,'Tuvalu',1),(225,'UG',NULL,'Ouganda',1),(226,'UA',NULL,'Ukraine',1),(227,'AE',NULL,'Émirats arabes unis',1),(228,'UM',NULL,'Iles mineures éloignées des États-Unis',1),(229,'UY',NULL,'Uruguay',1),(230,'UZ',NULL,'Ouzbékistan',1),(231,'VU',NULL,'Vanuatu',1),(232,'VE',NULL,'Vénézuela',1),(233,'VN',NULL,'Viêt Nam',1),(234,'VG',NULL,'Iles Vierges britanniques',1),(235,'VI',NULL,'Iles Vierges américaines',1),(236,'WF',NULL,'Wallis-et-Futuna',1),(237,'EH',NULL,'Sahara occidental',1),(238,'YE',NULL,'Yémen',1),(239,'ZM',NULL,'Zambie',1),(240,'ZW',NULL,'Zimbabwe',1),(241,'GG',NULL,'Guernesey',1),(242,'IM',NULL,'Ile de Man',1),(243,'JE',NULL,'Jersey',1),(244,'ME',NULL,'Monténégro',1),(245,'BL',NULL,'Saint-Barthélemy',1),(246,'MF',NULL,'Saint-Martin',1); +/*!40000 ALTER TABLE `llx_c_pays` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_price_expression` +-- + +DROP TABLE IF EXISTS `llx_c_price_expression`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_price_expression` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `title` varchar(20) NOT NULL, + `expression` varchar(80) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_price_expression` +-- + +LOCK TABLES `llx_c_price_expression` WRITE; +/*!40000 ALTER TABLE `llx_c_price_expression` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_price_expression` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_price_global_variable` +-- + +DROP TABLE IF EXISTS `llx_c_price_global_variable`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_price_global_variable` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(20) NOT NULL, + `description` text, + `value` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_price_global_variable` +-- + +LOCK TABLES `llx_c_price_global_variable` WRITE; +/*!40000 ALTER TABLE `llx_c_price_global_variable` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_price_global_variable` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_price_global_variable_updater` +-- + +DROP TABLE IF EXISTS `llx_c_price_global_variable_updater`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_price_global_variable_updater` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `type` int(11) NOT NULL, + `description` text, + `parameters` text, + `fk_variable` int(11) NOT NULL, + `update_interval` int(11) DEFAULT '0', + `next_update` int(11) DEFAULT '0', + `last_status` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_price_global_variable_updater` +-- + +LOCK TABLES `llx_c_price_global_variable_updater` WRITE; +/*!40000 ALTER TABLE `llx_c_price_global_variable_updater` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_price_global_variable_updater` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_propalst` +-- + +DROP TABLE IF EXISTS `llx_c_propalst`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_propalst` ( + `id` smallint(6) NOT NULL, + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_propalst` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_propalst` +-- + +LOCK TABLES `llx_c_propalst` WRITE; +/*!40000 ALTER TABLE `llx_c_propalst` DISABLE KEYS */; +INSERT INTO `llx_c_propalst` VALUES (0,'PR_DRAFT','Brouillon',1),(1,'PR_OPEN','Ouverte',1),(2,'PR_SIGNED','Signée',1),(3,'PR_NOTSIGNED','Non Signée',1),(4,'PR_FAC','Facturée',1); +/*!40000 ALTER TABLE `llx_c_propalst` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_prospectlevel` +-- + +DROP TABLE IF EXISTS `llx_c_prospectlevel`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_prospectlevel` ( + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `sortorder` smallint(6) DEFAULT NULL, + `active` smallint(6) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_prospectlevel` +-- + +LOCK TABLES `llx_c_prospectlevel` WRITE; +/*!40000 ALTER TABLE `llx_c_prospectlevel` DISABLE KEYS */; +INSERT INTO `llx_c_prospectlevel` VALUES ('PL_HIGH','High',4,1,NULL),('PL_LOW','Low',2,1,NULL),('PL_MEDIUM','Medium',3,1,NULL),('PL_NONE','None',1,1,NULL); +/*!40000 ALTER TABLE `llx_c_prospectlevel` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_regions` +-- + +DROP TABLE IF EXISTS `llx_c_regions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_regions` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code_region` int(11) NOT NULL, + `fk_pays` int(11) NOT NULL, + `cheflieu` varchar(50) DEFAULT NULL, + `tncc` int(11) DEFAULT NULL, + `nom` varchar(50) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `code_region` (`code_region`), + UNIQUE KEY `uk_code_region` (`code_region`), + KEY `idx_c_regions_fk_pays` (`fk_pays`), + CONSTRAINT `fk_c_regions_fk_pays` FOREIGN KEY (`fk_pays`) REFERENCES `llx_c_pays` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=23347 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_regions` +-- + +LOCK TABLES `llx_c_regions` WRITE; +/*!40000 ALTER TABLE `llx_c_regions` DISABLE KEYS */; +INSERT INTO `llx_c_regions` VALUES (1,0,0,'0',0,'-',1),(101,1,1,'97105',3,'Guadeloupe',1),(102,2,1,'97209',3,'Martinique',1),(103,3,1,'97302',3,'Guyane',1),(104,4,1,'97411',3,'Réunion',1),(105,11,1,'75056',1,'Île-de-France',1),(106,21,1,'51108',0,'Champagne-Ardenne',1),(107,22,1,'80021',0,'Picardie',1),(108,23,1,'76540',0,'Haute-Normandie',1),(109,24,1,'45234',2,'Centre',1),(110,25,1,'14118',0,'Basse-Normandie',1),(111,26,1,'21231',0,'Bourgogne',1),(112,31,1,'59350',2,'Nord-Pas-de-Calais',1),(113,41,1,'57463',0,'Lorraine',1),(114,42,1,'67482',1,'Alsace',1),(115,43,1,'25056',0,'Franche-Comté',1),(116,52,1,'44109',4,'Pays de la Loire',1),(117,53,1,'35238',0,'Bretagne',1),(118,54,1,'86194',2,'Poitou-Charentes',1),(119,72,1,'33063',1,'Aquitaine',1),(120,73,1,'31555',0,'Midi-Pyrénées',1),(121,74,1,'87085',2,'Limousin',1),(122,82,1,'69123',2,'Rhône-Alpes',1),(123,83,1,'63113',1,'Auvergne',1),(124,91,1,'34172',2,'Languedoc-Roussillon',1),(125,93,1,'13055',0,'Provence-Alpes-Côte d\'Azur',1),(126,94,1,'2A004',0,'Corse',1),(201,201,2,'',1,'Flandre',1),(202,202,2,'',2,'Wallonie',1),(203,203,2,'',3,'Bruxelles-Capitale',1),(301,301,3,NULL,1,'Abruzzo',1),(302,302,3,NULL,1,'Basilicata',1),(303,303,3,NULL,1,'Calabria',1),(304,304,3,NULL,1,'Campania',1),(305,305,3,NULL,1,'Emilia-Romagna',1),(306,306,3,NULL,1,'Friuli-Venezia Giulia',1),(307,307,3,NULL,1,'Lazio',1),(308,308,3,NULL,1,'Liguria',1),(309,309,3,NULL,1,'Lombardia',1),(310,310,3,NULL,1,'Marche',1),(311,311,3,NULL,1,'Molise',1),(312,312,3,NULL,1,'Piemonte',1),(313,313,3,NULL,1,'Puglia',1),(314,314,3,NULL,1,'Sardegna',1),(315,315,3,NULL,1,'Sicilia',1),(316,316,3,NULL,1,'Toscana',1),(317,317,3,NULL,1,'Trentino-Alto Adige',1),(318,318,3,NULL,1,'Umbria',1),(319,319,3,NULL,1,'Valle d Aosta',1),(320,320,3,NULL,1,'Veneto',1),(401,401,4,'',0,'Andalucia',1),(402,402,4,'',0,'Aragón',1),(403,403,4,'',0,'Castilla y León',1),(404,404,4,'',0,'Castilla la Mancha',1),(405,405,4,'',0,'Canarias',1),(406,406,4,'',0,'Cataluña',1),(407,407,4,'',0,'Comunidad de Ceuta',1),(408,408,4,'',0,'Comunidad Foral de Navarra',1),(409,409,4,'',0,'Comunidad de Melilla',1),(410,410,4,'',0,'Cantabria',1),(411,411,4,'',0,'Comunidad Valenciana',1),(412,412,4,'',0,'Extemadura',1),(413,413,4,'',0,'Galicia',1),(414,414,4,'',0,'Islas Baleares',1),(415,415,4,'',0,'La Rioja',1),(416,416,4,'',0,'Comunidad de Madrid',1),(417,417,4,'',0,'Región de Murcia',1),(418,418,4,'',0,'Principado de Asturias',1),(419,419,4,'',0,'Pais Vasco',1),(601,601,6,'',1,'Cantons',1),(1001,1001,10,'',0,'Ariana',1),(1002,1002,10,'',0,'Béja',1),(1003,1003,10,'',0,'Ben Arous',1),(1004,1004,10,'',0,'Bizerte',1),(1005,1005,10,'',0,'Gabès',1),(1006,1006,10,'',0,'Gafsa',1),(1007,1007,10,'',0,'Jendouba',1),(1008,1008,10,'',0,'Kairouan',1),(1009,1009,10,'',0,'Kasserine',1),(1010,1010,10,'',0,'Kébili',1),(1011,1011,10,'',0,'La Manouba',1),(1012,1012,10,'',0,'Le Kef',1),(1013,1013,10,'',0,'Mahdia',1),(1014,1014,10,'',0,'Médenine',1),(1015,1015,10,'',0,'Monastir',1),(1016,1016,10,'',0,'Nabeul',1),(1017,1017,10,'',0,'Sfax',1),(1018,1018,10,'',0,'Sidi Bouzid',1),(1019,1019,10,'',0,'Siliana',1),(1020,1020,10,'',0,'Sousse',1),(1021,1021,10,'',0,'Tataouine',1),(1022,1022,10,'',0,'Tozeur',1),(1023,1023,10,'',0,'Tunis',1),(1024,1024,10,'',0,'Zaghouan',1),(1101,1101,11,'',0,'United-States',1),(1201,1201,12,'',0,'Tanger-Tétouan',1),(1202,1202,12,'',0,'Gharb-Chrarda-Beni Hssen',1),(1203,1203,12,'',0,'Taza-Al Hoceima-Taounate',1),(1204,1204,12,'',0,'L\'Oriental',1),(1205,1205,12,'',0,'Fès-Boulemane',1),(1206,1206,12,'',0,'Meknès-Tafialet',1),(1207,1207,12,'',0,'Rabat-Salé-Zemour-Zaër',1),(1208,1208,12,'',0,'Grand Cassablanca',1),(1209,1209,12,'',0,'Chaouia-Ouardigha',1),(1210,1210,12,'',0,'Doukahla-Adba',1),(1211,1211,12,'',0,'Marrakech-Tensift-Al Haouz',1),(1212,1212,12,'',0,'Tadla-Azilal',1),(1213,1213,12,'',0,'Sous-Massa-Drâa',1),(1214,1214,12,'',0,'Guelmim-Es Smara',1),(1215,1215,12,'',0,'Laâyoune-Boujdour-Sakia el Hamra',1),(1216,1216,12,'',0,'Oued Ed-Dahab Lagouira',1),(1301,1301,13,'',0,'Algerie',1),(2301,2301,23,'',0,'Norte',1),(2302,2302,23,'',0,'Litoral',1),(2303,2303,23,'',0,'Cuyana',1),(2304,2304,23,'',0,'Central',1),(2305,2305,23,'',0,'Patagonia',1),(2801,2801,28,'',0,'Australia',1),(4601,4601,46,'',0,'Barbados',1),(6701,6701,67,NULL,NULL,'Tarapacá',1),(6702,6702,67,NULL,NULL,'Antofagasta',1),(6703,6703,67,NULL,NULL,'Atacama',1),(6704,6704,67,NULL,NULL,'Coquimbo',1),(6705,6705,67,NULL,NULL,'Valparaíso',1),(6706,6706,67,NULL,NULL,'General Bernardo O Higgins',1),(6707,6707,67,NULL,NULL,'Maule',1),(6708,6708,67,NULL,NULL,'Biobío',1),(6709,6709,67,NULL,NULL,'Raucanía',1),(6710,6710,67,NULL,NULL,'Los Lagos',1),(6711,6711,67,NULL,NULL,'Aysén General Carlos Ibáñez del Campo',1),(6712,6712,67,NULL,NULL,'Magallanes y Antártica Chilena',1),(6713,6713,67,NULL,NULL,'Santiago',1),(6714,6714,67,NULL,NULL,'Los Ríos',1),(6715,6715,67,NULL,NULL,'Arica y Parinacota',1),(7001,7001,70,'',0,'Colombie',1),(8601,8601,86,NULL,NULL,'Central',1),(8602,8602,86,NULL,NULL,'Oriental',1),(8603,8603,86,NULL,NULL,'Occidental',1),(10201,10201,102,NULL,NULL,'??????',1),(10202,10202,102,NULL,NULL,'?????? ??????',1),(10203,10203,102,NULL,NULL,'???????? ?????????',1),(10204,10204,102,NULL,NULL,'?????',1),(10205,10205,102,NULL,NULL,'????????? ????????? ??? ?????',1),(10206,10206,102,NULL,NULL,'???????',1),(10207,10207,102,NULL,NULL,'????? ?????',1),(10208,10208,102,NULL,NULL,'?????? ??????',1),(10209,10209,102,NULL,NULL,'????????????',1),(10210,10210,102,NULL,NULL,'????? ??????',1),(10211,10211,102,NULL,NULL,'?????? ??????',1),(10212,10212,102,NULL,NULL,'????????',1),(10213,10213,102,NULL,NULL,'?????? ?????????',1),(11401,11401,114,'',0,'Honduras',1),(11701,11701,117,'',0,'India',1),(15201,15201,152,'',0,'Rivière Noire',1),(15202,15202,152,'',0,'Flacq',1),(15203,15203,152,'',0,'Grand Port',1),(15204,15204,152,'',0,'Moka',1),(15205,15205,152,'',0,'Pamplemousses',1),(15206,15206,152,'',0,'Plaines Wilhems',1),(15207,15207,152,'',0,'Port-Louis',1),(15208,15208,152,'',0,'Rivière du Rempart',1),(15209,15209,152,'',0,'Savanne',1),(15210,15210,152,'',0,'Rodrigues',1),(15211,15211,152,'',0,'Les îles Agaléga',1),(15212,15212,152,'',0,'Les écueils des Cargados Carajos',1),(15401,15401,154,'',0,'Mexique',1),(23201,23201,232,'',0,'Los Andes',1),(23202,23202,232,'',0,'Capital',1),(23203,23203,232,'',0,'Central',1),(23204,23204,232,'',0,'Cento Occidental',1),(23205,23205,232,'',0,'Guayana',1),(23206,23206,232,'',0,'Insular',1),(23207,23207,232,'',0,'Los Llanos',1),(23208,23208,232,'',0,'Nor-Oriental',1),(23209,23209,232,'',0,'Zuliana',1),(23215,6,1,'97601',3,'Mayotte',1),(23280,420,4,'',0,'Otros',1),(23281,501,5,'',0,'Deutschland',1),(23296,701,7,'',0,'England',1),(23297,702,7,'',0,'Wales',1),(23298,703,7,'',0,'Scotland',1),(23299,704,7,'',0,'Northern Ireland',1),(23325,1401,14,'',0,'Canada',1),(23326,1701,17,'',0,'Provincies van Nederland ',1),(23333,5601,56,'',0,'Brasil',1),(23334,5201,52,'',0,'Chuquisaca',1),(23335,5202,52,'',0,'La Paz',1),(23336,5203,52,'',0,'Cochabamba',1),(23337,5204,52,'',0,'Oruro',1),(23338,5205,52,'',0,'Potosí',1),(23339,5206,52,'',0,'Tarija',1),(23340,5207,52,'',0,'Santa Cruz',1),(23341,5208,52,'',0,'El Beni',1),(23342,5209,52,'',0,'Pando',1),(23343,4101,41,'',0,'Österreich',1),(23344,17801,178,'',0,'Panama',1),(23345,22701,227,'',0,'United Arab Emirates',1); +/*!40000 ALTER TABLE `llx_c_regions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_revenuestamp` +-- + +DROP TABLE IF EXISTS `llx_c_revenuestamp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_revenuestamp` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pays` int(11) NOT NULL, + `taux` double NOT NULL, + `note` varchar(128) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code_sell` varchar(32) DEFAULT NULL, + `accountancy_code_buy` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_revenuestamp` +-- + +LOCK TABLES `llx_c_revenuestamp` WRITE; +/*!40000 ALTER TABLE `llx_c_revenuestamp` DISABLE KEYS */; +INSERT INTO `llx_c_revenuestamp` VALUES (101,10,0.4,'Revenue stamp tunisia',1,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_revenuestamp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_shipment_mode` +-- + +DROP TABLE IF EXISTS `llx_c_shipment_mode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_shipment_mode` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `code` varchar(30) NOT NULL, + `libelle` varchar(50) NOT NULL, + `description` text, + `tracking` varchar(256) NOT NULL, + `active` tinyint(4) DEFAULT '0', + `module` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_shipment_mode` +-- + +LOCK TABLES `llx_c_shipment_mode` WRITE; +/*!40000 ALTER TABLE `llx_c_shipment_mode` DISABLE KEYS */; +INSERT INTO `llx_c_shipment_mode` VALUES (1,'2010-10-09 23:43:16','CATCH','Catch','Catch by client','',1,NULL),(2,'2010-10-09 23:43:16','TRANS','Transporter','Generic transporter','',1,NULL),(3,'2010-10-09 23:43:16','COLSUI','Colissimo Suivi','Colissimo Suivi','',0,NULL),(4,'2011-07-18 17:28:27','LETTREMAX','Lettre Max','Courrier Suivi et Lettre Max','',0,NULL),(9,'2013-02-24 01:48:18','UPS','UPS','United Parcel Service','http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber2=&InquiryNumber3=&tracknums_displayed=3&loc=fr_FR&TypeOfInquiryNumber=T&HTMLVersion=4.0&InquiryNumber22=&InquiryNumber32=&track=Track&Suivi.x=64&Suivi.y=7&Suivi=Valider&InquiryNumber1={TRACKID}',0,NULL),(10,'2013-02-24 01:48:18','KIALA','KIALA','Relais Kiala','http://www.kiala.fr/tnt/delivery/{TRACKID}',0,NULL),(11,'2013-02-24 01:48:18','GLS','GLS','General Logistics Systems','http://www.gls-group.eu/276-I-PORTAL-WEB/content/GLS/FR01/FR/5004.htm?txtAction=71000&txtRefNo={TRACKID}',0,NULL),(12,'2013-02-24 01:48:18','CHRONO','Chronopost','Chronopost','http://www.chronopost.fr/expedier/inputLTNumbersNoJahia.do?listeNumeros={TRACKID}',0,NULL); +/*!40000 ALTER TABLE `llx_c_shipment_mode` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_stcomm` +-- + +DROP TABLE IF EXISTS `llx_c_stcomm`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_stcomm` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(30) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `picto` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_stcomm` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_stcomm` +-- + +LOCK TABLES `llx_c_stcomm` WRITE; +/*!40000 ALTER TABLE `llx_c_stcomm` DISABLE KEYS */; +INSERT INTO `llx_c_stcomm` VALUES (-1,'ST_NO','Do not contact',1,NULL),(0,'ST_NEVER','Never contacted',1,NULL),(1,'ST_TODO','To contact',1,NULL),(2,'ST_PEND','Contact in progress',1,NULL),(3,'ST_DONE','Contacted',1,NULL); +/*!40000 ALTER TABLE `llx_c_stcomm` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_tva` +-- + +DROP TABLE IF EXISTS `llx_c_tva`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_tva` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_pays` int(11) NOT NULL, + `code` varchar(10) DEFAULT '', + `taux` double NOT NULL, + `localtax1` varchar(20) DEFAULT NULL, + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2` varchar(20) DEFAULT NULL, + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `note` varchar(128) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `accountancy_code_sell` varchar(32) DEFAULT NULL, + `accountancy_code_buy` varchar(32) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_tva_id` (`fk_pays`,`code`,`taux`,`recuperableonly`) +) ENGINE=InnoDB AUTO_INCREMENT=2473 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_tva` +-- + +LOCK TABLES `llx_c_tva` WRITE; +/*!40000 ALTER TABLE `llx_c_tva` DISABLE KEYS */; +INSERT INTO `llx_c_tva` VALUES (11,1,'',20,NULL,'0',NULL,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,'',8.5,NULL,'0',NULL,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,'',8.5,NULL,'0',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,'',5.5,NULL,'0',NULL,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,'',2.1,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(17,1,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(21,2,'',21,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,'',6,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,'',12,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,'',21,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,'',4,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,'',21,'5.2','3','-19:-15:-9','5',0,'VAT standard rate',1,NULL,NULL),(42,4,'',10,'1.4','3','-19:-15:-9','5',0,'VAT reduced rate',1,NULL,NULL),(43,4,'',4,'0.5','3','-19:-15:-9','5',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,'',0,'0','3','-19:-15:-9','5',0,'VAT Rate 0',1,NULL,NULL),(51,5,'',19,NULL,'0',NULL,'0',0,'allgemeine Ust.',1,NULL,NULL),(52,5,'',7,NULL,'0',NULL,'0',0,'ermäßigte USt.',1,NULL,NULL),(53,5,'',0,NULL,'0',NULL,'0',0,'keine USt.',1,NULL,NULL),(54,5,'',5.5,NULL,'0',NULL,'0',0,'USt. Forst',0,NULL,NULL),(55,5,'',10.7,NULL,'0',NULL,'0',0,'USt. Landwirtschaft',0,NULL,NULL),(61,6,'',8,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,'',3.8,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,'',2.5,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,'',17.5,NULL,'0',NULL,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,'',5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(81,8,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(82,8,'',23,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(83,8,'',13.5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(84,8,'',9,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(85,8,'',4.8,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(91,9,'',17,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,'',13,NULL,'0',NULL,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,'',3,NULL,'0',NULL,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,'',6,'1','4','0','0',0,'VAT 6%',1,NULL,NULL),(102,10,'',12,'1','4','0','0',0,'VAT 12%',1,NULL,NULL),(103,10,'',18,'1','4','0','0',0,'VAT 18%',1,NULL,NULL),(104,10,'',7.5,'1','4','0','0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,'',15,'1','4','0','0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,'',22.5,'1','4','0','0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,'',0,'1','4','0','0',0,'VAT Rate 0',1,NULL,NULL),(111,11,'',0,NULL,'0',NULL,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,'',4,NULL,'0',NULL,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,'',6,NULL,'0',NULL,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,'',14,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,'',7,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,'',7,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,'',5,'9.975','1',NULL,'0',0,'GST/TPS and PST/TVQ rate for Province',1,NULL,NULL),(171,17,'',19,NULL,'0',NULL,'0',0,'Algemeen BTW tarief',1,NULL,NULL),(172,17,'',6,NULL,'0',NULL,'0',0,'Verlaagd BTW tarief',1,NULL,NULL),(173,17,'',0,NULL,'0',NULL,'0',0,'0 BTW tarief',1,NULL,NULL),(174,17,'',21,NULL,'0',NULL,'0',0,'Algemeen BTW tarief (vanaf 1 oktober 2012)',0,NULL,NULL),(201,20,'',25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,'',12,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,'',6,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(211,21,'',0,'0','0','0','0',0,'IVA Rate 0',1,NULL,NULL),(212,21,'',18,'7.5','2','0','0',0,'IVA standard rate',1,NULL,NULL),(221,22,'',18,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(222,22,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(223,22,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,'',21,NULL,'0',NULL,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,'',10.5,NULL,'0',NULL,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,'',0,NULL,'0',NULL,'0',0,'IVA Rate 0',1,NULL,NULL),(241,24,'',19.25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(242,24,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(251,25,'',23,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,'',13,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,'',6,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(261,26,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(271,27,'',19.6,NULL,'0',NULL,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,'',8.5,NULL,'0',NULL,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,'',8.5,NULL,'0',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,'',5.5,NULL,'0',NULL,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,'',2.1,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,'',10,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(462,46,'',15,NULL,'0',NULL,'0',0,'VAT 15%',1,NULL,NULL),(463,46,'',7.5,NULL,'0',NULL,'0',0,'VAT 7.5%',1,NULL,NULL),(561,56,'',0,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(591,59,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,'',19,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,'',25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,'',13,NULL,'0',NULL,'0',0,'IVA 13',1,NULL,NULL),(862,86,'',0,NULL,'0',NULL,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,'',0,NULL,'0',NULL,'0',0,'No ISV',1,NULL,NULL),(1142,114,'',12,NULL,'0',NULL,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,'',25.5,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,'',0,NULL,'0',NULL,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,'',12.5,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,'',4,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,'',1,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1176,117,'IGST-CGST',8,'8','1','0','0',0,'IGST-CGST',1,NULL,NULL),(1177,117,'SGST',0,'0','0','16','1',0,'SGST',1,NULL,NULL),(1231,123,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,'',5,NULL,'0',NULL,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,'',15,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,'',12,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,'',6,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,'',3,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1481,148,'',18,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1482,148,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1483,148,'',5,NULL,'0',NULL,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1484,148,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1511,151,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1512,151,'',14,NULL,'0',NULL,'0',0,'VAT Rate 14',1,NULL,NULL),(1521,152,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,'',15,NULL,'0',NULL,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(1542,154,'',16,NULL,'0',NULL,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,'',10,NULL,'0',NULL,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,'',15,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1692,169,'',5,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1693,169,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,'',25,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,'',14,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,'',8,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1781,178,'',7,NULL,'0',NULL,'0',0,'ITBMS standard rate',1,NULL,NULL),(1782,178,'',0,NULL,'0',NULL,'0',0,'ITBMS Rate 0',1,NULL,NULL),(1811,181,'',18,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1812,181,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,'',20,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,'',7,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,'',3,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,'',24,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,'',9,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,'',5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,'',0,NULL,'0',NULL,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,'',19,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,'',10,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,'',22,NULL,'0',NULL,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,'',9.5,NULL,'0',NULL,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2051,205,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(2052,205,'',14,NULL,'0',NULL,'0',0,'VAT 14%',1,NULL,NULL),(2131,213,'',5,NULL,'0',NULL,'0',0,'VAT 5%',1,NULL,NULL),(2261,226,'',20,NULL,'0',NULL,'0',0,'VAT standart rate',1,NULL,NULL),(2262,226,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,'',0,NULL,'0',NULL,'0',0,'No VAT',1,NULL,NULL),(2322,232,'',12,NULL,'0',NULL,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,'',8,NULL,'0',NULL,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,'',0,NULL,'0',NULL,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,102,'',23,'0','0','0','0',0,'Κανονικός Φ.Π.Α.',1,NULL,NULL),(2463,102,'',0,'0','0','0','0',0,'Μηδενικό Φ.Π.Α.',1,NULL,NULL),(2464,102,'',13,'0','0','0','0',0,'Μειωμένος Φ.Π.Α.',1,NULL,NULL),(2465,102,'',6.5,'0','0','0','0',0,'Υπερμειωμένος Φ.Π.Α.',1,NULL,NULL),(2466,102,'',16,'0','0','0','0',0,'Νήσων κανονικός Φ.Π.Α.',1,NULL,NULL),(2467,102,'',9,'0','0','0','0',0,'Νήσων μειωμένος Φ.Π.Α.',1,NULL,NULL),(2468,102,'',5,'0','0','0','0',0,'Νήσων υπερμειωμένος Φ.Π.Α.',1,NULL,NULL),(2469,1,'85',8.5,NULL,'0',NULL,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(2470,1,'85NPR',8.5,NULL,'0',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(2471,1,'85NPROM',8.5,'2','3',NULL,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0,NULL,NULL),(2472,1,'85NPROMOMR',8.5,'2','3','2.5','3',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0,NULL,NULL); +/*!40000 ALTER TABLE `llx_c_tva` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_contact` +-- + +DROP TABLE IF EXISTS `llx_c_type_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_contact` ( + `rowid` int(11) NOT NULL, + `element` varchar(30) NOT NULL, + `source` varchar(8) NOT NULL DEFAULT 'external', + `code` varchar(32) NOT NULL, + `libelle` varchar(64) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_type_contact_id` (`element`,`source`,`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_contact` +-- + +LOCK TABLES `llx_c_type_contact` WRITE; +/*!40000 ALTER TABLE `llx_c_type_contact` DISABLE KEYS */; +INSERT INTO `llx_c_type_contact` VALUES (10,'contrat','internal','SALESREPSIGN','Commercial signataire du contrat',1,NULL,0),(11,'contrat','internal','SALESREPFOLL','Commercial suivi du contrat',1,NULL,0),(20,'contrat','external','BILLING','Contact client facturation contrat',1,NULL,0),(21,'contrat','external','CUSTOMER','Contact client suivi contrat',1,NULL,0),(22,'contrat','external','SALESREPSIGN','Contact client signataire contrat',1,NULL,0),(31,'propal','internal','SALESREPFOLL','Commercial à l\'origine de la propale',1,NULL,0),(40,'propal','external','BILLING','Contact client facturation propale',1,NULL,0),(41,'propal','external','CUSTOMER','Contact client suivi propale',1,NULL,0),(50,'facture','internal','SALESREPFOLL','Responsable suivi du paiement',1,NULL,0),(60,'facture','external','BILLING','Contact client facturation',1,NULL,0),(61,'facture','external','SHIPPING','Contact client livraison',1,NULL,0),(62,'facture','external','SERVICE','Contact client prestation',1,NULL,0),(70,'invoice_supplier','internal','SALESREPFOLL','Responsable suivi du paiement',1,NULL,0),(71,'invoice_supplier','external','BILLING','Contact fournisseur facturation',1,NULL,0),(72,'invoice_supplier','external','SHIPPING','Contact fournisseur livraison',1,NULL,0),(73,'invoice_supplier','external','SERVICE','Contact fournisseur prestation',1,NULL,0),(80,'agenda','internal','ACTOR','Responsable',1,NULL,0),(81,'agenda','internal','GUEST','Guest',1,NULL,0),(85,'agenda','external','ACTOR','Responsable',1,NULL,0),(86,'agenda','external','GUEST','Guest',1,NULL,0),(91,'commande','internal','SALESREPFOLL','Responsable suivi de la commande',1,NULL,0),(100,'commande','external','BILLING','Contact client facturation commande',1,NULL,0),(101,'commande','external','CUSTOMER','Contact client suivi commande',1,NULL,0),(102,'commande','external','SHIPPING','Contact client livraison commande',1,NULL,0),(120,'fichinter','internal','INTERREPFOLL','Responsable suivi de l\'intervention',1,NULL,0),(121,'fichinter','internal','INTERVENING','Intervenant',1,NULL,0),(130,'fichinter','external','BILLING','Contact client facturation intervention',1,NULL,0),(131,'fichinter','external','CUSTOMER','Contact client suivi de l\'intervention',1,NULL,0),(140,'order_supplier','internal','SALESREPFOLL','Responsable suivi de la commande',1,NULL,0),(141,'order_supplier','internal','SHIPPING','Responsable réception de la commande',1,NULL,0),(142,'order_supplier','external','BILLING','Contact fournisseur facturation commande',1,NULL,0),(143,'order_supplier','external','CUSTOMER','Contact fournisseur suivi commande',1,NULL,0),(145,'order_supplier','external','SHIPPING','Contact fournisseur livraison commande',1,NULL,0),(150,'dolresource','internal','USERINCHARGE','In charge of resource',1,NULL,0),(151,'dolresource','external','THIRDINCHARGE','In charge of resource',1,NULL,0),(160,'project','internal','PROJECTLEADER','Chef de Projet',1,NULL,0),(161,'project','internal','PROJECTCONTRIBUTOR','Intervenant',1,NULL,0),(170,'project','external','PROJECTLEADER','Chef de Projet',1,NULL,0),(171,'project','external','PROJECTCONTRIBUTOR','Intervenant',1,NULL,0),(180,'project_task','internal','TASKEXECUTIVE','Responsable',1,NULL,0),(181,'project_task','internal','TASKCONTRIBUTOR','Intervenant',1,NULL,0),(190,'project_task','external','TASKEXECUTIVE','Responsable',1,NULL,0),(191,'project_task','external','TASKCONTRIBUTOR','Intervenant',1,NULL,0),(200,'societe','external','GENERALREF','Généraliste (référent)',0,'cabinetmed',0),(201,'societe','external','GENERALISTE','Généraliste',0,'cabinetmed',0),(210,'societe','external','SPECCHIROR','Chirurgien ortho',0,'cabinetmed',0),(211,'societe','external','SPECCHIROT','Chirurgien autre',0,'cabinetmed',0),(220,'societe','external','SPECDERMA','Dermatologue',0,'cabinetmed',0),(225,'societe','external','SPECENDOC','Endocrinologue',0,'cabinetmed',0),(230,'societe','external','SPECGYNECO','Gynécologue',0,'cabinetmed',0),(240,'societe','external','SPECGASTRO','Gastroantérologue',0,'cabinetmed',0),(245,'societe','external','SPECINTERNE','Interniste',0,'cabinetmed',0),(250,'societe','external','SPECCARDIO','Cardiologue',0,'cabinetmed',0),(260,'societe','external','SPECNEPHRO','Néphrologue',0,'cabinetmed',0),(263,'societe','external','SPECPNEUMO','Pneumologue',0,'cabinetmed',0),(265,'societe','external','SPECNEURO','Neurologue',0,'cabinetmed',0),(270,'societe','external','SPECRHUMATO','Rhumatologue',0,'cabinetmed',0),(280,'societe','external','KINE','Kinésithérapeute',0,'cabinetmed',0); +/*!40000 ALTER TABLE `llx_c_type_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_fees` +-- + +DROP TABLE IF EXISTS `llx_c_type_fees`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_fees` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(12) NOT NULL, + `label` varchar(30) DEFAULT NULL, + `accountancy_code` varchar(32) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_type_fees` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_fees` +-- + +LOCK TABLES `llx_c_type_fees` WRITE; +/*!40000 ALTER TABLE `llx_c_type_fees` DISABLE KEYS */; +INSERT INTO `llx_c_type_fees` VALUES (1,'TF_OTHER','Other','705',1,NULL,0),(2,'TF_TRIP','Trip',NULL,1,NULL,0),(3,'TF_LUNCH','Lunch',NULL,1,NULL,0); +/*!40000 ALTER TABLE `llx_c_type_fees` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_type_resource` +-- + +DROP TABLE IF EXISTS `llx_c_type_resource`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_type_resource` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(32) NOT NULL, + `label` varchar(64) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_type_resource_id` (`label`,`code`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_type_resource` +-- + +LOCK TABLES `llx_c_type_resource` WRITE; +/*!40000 ALTER TABLE `llx_c_type_resource` DISABLE KEYS */; +INSERT INTO `llx_c_type_resource` VALUES (1,'RES_ROOMS','Rooms',1),(2,'RES_CARS','Cars',1); +/*!40000 ALTER TABLE `llx_c_type_resource` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_typent` +-- + +DROP TABLE IF EXISTS `llx_c_typent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_typent` ( + `id` int(11) NOT NULL, + `code` varchar(12) NOT NULL, + `libelle` varchar(64) DEFAULT NULL, + `fk_country` int(11) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `module` varchar(32) DEFAULT NULL, + `position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_c_typent` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_typent` +-- + +LOCK TABLES `llx_c_typent` WRITE; +/*!40000 ALTER TABLE `llx_c_typent` DISABLE KEYS */; +INSERT INTO `llx_c_typent` VALUES (0,'TE_UNKNOWN','-',NULL,1,NULL,0),(1,'TE_STARTUP','Start-up',NULL,1,NULL,0),(2,'TE_GROUP','Grand groupe',NULL,1,NULL,0),(3,'TE_MEDIUM','PME/PMI',NULL,1,NULL,0),(4,'TE_SMALL','TPE',NULL,1,NULL,0),(5,'TE_ADMIN','Administration',NULL,1,NULL,0),(6,'TE_WHOLE','Grossiste',NULL,1,NULL,0),(7,'TE_RETAIL','Revendeur',NULL,1,NULL,0),(8,'TE_PRIVATE','Particulier',NULL,1,NULL,0),(100,'TE_OTHER','Autres',NULL,1,NULL,0),(101,'TE_HOMME','Homme',NULL,0,'cabinetmed',0),(102,'TE_FEMME','Femme',NULL,0,'cabinetmed',0),(231,'TE_A_RI','Responsable Inscripto',23,1,NULL,0),(232,'TE_B_RNI','Responsable No Inscripto',23,1,NULL,0),(233,'TE_C_FE','Consumidor Final/Exento',23,1,NULL,0); +/*!40000 ALTER TABLE `llx_c_typent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_units` +-- + +DROP TABLE IF EXISTS `llx_c_units`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_units` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(3) DEFAULT NULL, + `label` varchar(50) DEFAULT NULL, + `short_label` varchar(5) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_units_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_units` +-- + +LOCK TABLES `llx_c_units` WRITE; +/*!40000 ALTER TABLE `llx_c_units` DISABLE KEYS */; +INSERT INTO `llx_c_units` VALUES (1,'P','piece','p',1),(2,'SET','set','se',1),(3,'S','second','s',1),(4,'H','hour','h',1),(5,'D','day','d',1),(6,'KG','kilogram','kg',1),(7,'G','gram','g',1),(8,'M','meter','m',1),(9,'LM','linear meter','lm',1),(10,'M2','square meter','m2',1),(11,'M3','cubic meter','m3',1),(12,'L','liter','l',1); +/*!40000 ALTER TABLE `llx_c_units` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_c_ziptown` +-- + +DROP TABLE IF EXISTS `llx_c_ziptown`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_ziptown` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(5) DEFAULT NULL, + `fk_county` int(11) DEFAULT NULL, + `fk_pays` int(11) NOT NULL DEFAULT '0', + `zip` varchar(10) NOT NULL, + `town` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ziptown_fk_pays` (`zip`,`town`,`fk_pays`), + KEY `idx_c_ziptown_fk_county` (`fk_county`), + KEY `idx_c_ziptown_fk_pays` (`fk_pays`), + KEY `idx_c_ziptown_zip` (`zip`), + CONSTRAINT `fk_c_ziptown_fk_county` FOREIGN KEY (`fk_county`) REFERENCES `llx_c_departements` (`rowid`), + CONSTRAINT `fk_c_ziptown_fk_pays` FOREIGN KEY (`fk_pays`) REFERENCES `llx_c_pays` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_ziptown` +-- + +LOCK TABLES `llx_c_ziptown` WRITE; +/*!40000 ALTER TABLE `llx_c_ziptown` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_ziptown` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie` +-- + +DROP TABLE IF EXISTS `llx_categorie`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_parent` int(11) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `type` tinyint(4) NOT NULL DEFAULT '1', + `entity` int(11) NOT NULL DEFAULT '1', + `description` text, + `fk_soc` int(11) DEFAULT NULL, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `import_key` varchar(14) DEFAULT NULL, + `color` varchar(8) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_categorie_ref` (`entity`,`fk_parent`,`label`,`type`), + KEY `idx_categorie_type` (`type`), + KEY `idx_categorie_label` (`label`) +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie` +-- + +LOCK TABLES `llx_categorie` WRITE; +/*!40000 ALTER TABLE `llx_categorie` DISABLE KEYS */; +INSERT INTO `llx_categorie` VALUES (1,0,'Preferred Partners',1,1,'This category is used to tag suppliers that are Prefered Partners',NULL,0,NULL,'005fbf'),(2,0,'MyCategory',1,1,'This is description of MyCategory for customer and prospects
        ',NULL,0,NULL,NULL),(3,7,'Hot products',1,1,'This is description of hot products
        ',NULL,0,NULL,NULL),(4,0,'Merchant',1,1,'Category dedicated to merchant third parties',NULL,0,NULL,'bf5f00'),(5,7,'Bio Fairtrade',0,1,'',NULL,0,NULL,NULL),(6,7,'Bio AB',0,1,'',NULL,0,NULL,NULL),(7,9,'Bio',0,1,'This product is a BIO product',NULL,0,NULL,NULL),(8,7,'Bio Dynamic',0,1,'',NULL,0,NULL,NULL),(9,0,'High Quality Product',0,1,'Label dedicated for High quality products',NULL,0,NULL,'7f7f00'),(10,0,'Reserved for VIP',0,1,'Product of thi category are reserved to VIP customers',NULL,0,NULL,'7f0000'),(11,9,'ISO',0,1,'Product of this category has an ISO label',NULL,0,NULL,NULL),(12,0,'VIP',2,1,'',NULL,0,NULL,'bf5f00'),(13,0,'Region North',2,1,'Customer of North Region',NULL,0,NULL,'7f007f'),(14,0,'Regular customer',2,1,'',NULL,0,NULL,'5fbf00'),(15,13,'Region North A',2,1,'',NULL,0,NULL,'bf00bf'),(17,0,'MyTag1',4,1,'',NULL,0,NULL,NULL),(18,0,'Met during meeting',4,1,'',NULL,0,NULL,'ff7f00'),(19,17,'MySubTag1',4,1,'',NULL,0,NULL,NULL),(20,13,'Region North B',2,1,'',NULL,0,NULL,'bf005f'),(21,0,'Region South',2,1,'',NULL,0,NULL,NULL),(22,21,'Region South A',2,1,'',NULL,0,NULL,NULL),(23,21,'Region South B',2,1,'',NULL,0,NULL,NULL),(24,0,'Limited Edition',0,1,'This is a limited edition',NULL,0,NULL,'ff7f00'),(25,0,'Imported products',0,1,'For product we have to import from another country',NULL,0,NULL,NULL),(26,28,'Friends',4,1,'Category of friends contact',NULL,0,NULL,'00bf00'),(27,28,'Family',4,1,'Category of family contacts',NULL,0,NULL,'007f3f'),(28,0,'Personal contacts',4,1,'For personal contacts',NULL,0,NULL,'007f3f'),(29,0,'Online only merchant',1,1,'',NULL,0,NULL,'aaaaff'); +/*!40000 ALTER TABLE `llx_categorie` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_account` +-- + +DROP TABLE IF EXISTS `llx_categorie_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_account` ( + `fk_categorie` int(11) NOT NULL, + `fk_account` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_account`), + KEY `idx_categorie_account_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_account_fk_account` (`fk_account`), + CONSTRAINT `fk_categorie_account_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_account_fk_account` FOREIGN KEY (`fk_account`) REFERENCES `llx_bank_account` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_account` +-- + +LOCK TABLES `llx_categorie_account` WRITE; +/*!40000 ALTER TABLE `llx_categorie_account` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_association` +-- + +DROP TABLE IF EXISTS `llx_categorie_association`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_association` ( + `fk_categorie_mere` int(11) NOT NULL, + `fk_categorie_fille` int(11) NOT NULL, + UNIQUE KEY `uk_categorie_association` (`fk_categorie_mere`,`fk_categorie_fille`), + UNIQUE KEY `uk_categorie_association_fk_categorie_fille` (`fk_categorie_fille`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_association` +-- + +LOCK TABLES `llx_categorie_association` WRITE; +/*!40000 ALTER TABLE `llx_categorie_association` DISABLE KEYS */; +INSERT INTO `llx_categorie_association` VALUES (3,5),(9,11); +/*!40000 ALTER TABLE `llx_categorie_association` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_contact` +-- + +DROP TABLE IF EXISTS `llx_categorie_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_contact` ( + `fk_categorie` int(11) NOT NULL, + `fk_socpeople` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_socpeople`), + KEY `idx_categorie_contact_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_contact_fk_socpeople` (`fk_socpeople`), + CONSTRAINT `fk_categorie_contact_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_contact_fk_socpeople` FOREIGN KEY (`fk_socpeople`) REFERENCES `llx_socpeople` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_contact` +-- + +LOCK TABLES `llx_categorie_contact` WRITE; +/*!40000 ALTER TABLE `llx_categorie_contact` DISABLE KEYS */; +INSERT INTO `llx_categorie_contact` VALUES (18,3,NULL),(18,6,NULL),(19,6,NULL),(26,9,NULL),(27,7,NULL),(27,8,NULL),(27,10,NULL),(28,11,NULL); +/*!40000 ALTER TABLE `llx_categorie_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_categorie_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_fournisseur` ( + `fk_categorie` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_soc`), + KEY `idx_categorie_fournisseur_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_fournisseur_fk_societe` (`fk_soc`), + CONSTRAINT `fk_categorie_fournisseur_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_fournisseur_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_fournisseur` +-- + +LOCK TABLES `llx_categorie_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_categorie_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_categorie_fournisseur` VALUES (1,2,NULL),(1,10,NULL),(9,2,NULL); +/*!40000 ALTER TABLE `llx_categorie_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_lang` +-- + +DROP TABLE IF EXISTS `llx_categorie_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_lang` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_category` int(11) NOT NULL DEFAULT '0', + `lang` varchar(5) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `description` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_category_lang` (`fk_category`,`lang`), + CONSTRAINT `fk_category_lang_fk_category` FOREIGN KEY (`fk_category`) REFERENCES `llx_categorie` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_lang` +-- + +LOCK TABLES `llx_categorie_lang` WRITE; +/*!40000 ALTER TABLE `llx_categorie_lang` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_member` +-- + +DROP TABLE IF EXISTS `llx_categorie_member`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_member` ( + `fk_categorie` int(11) NOT NULL, + `fk_member` int(11) NOT NULL, + PRIMARY KEY (`fk_categorie`,`fk_member`), + KEY `idx_categorie_member_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_member_fk_member` (`fk_member`), + CONSTRAINT `fk_categorie_member_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_member_member_rowid` FOREIGN KEY (`fk_member`) REFERENCES `llx_adherent` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_member` +-- + +LOCK TABLES `llx_categorie_member` WRITE; +/*!40000 ALTER TABLE `llx_categorie_member` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_member` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_product` +-- + +DROP TABLE IF EXISTS `llx_categorie_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_product` ( + `fk_categorie` int(11) NOT NULL, + `fk_product` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_product`), + KEY `idx_categorie_product_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_product_fk_product` (`fk_product`), + CONSTRAINT `fk_categorie_product_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_product_product_rowid` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_product` +-- + +LOCK TABLES `llx_categorie_product` WRITE; +/*!40000 ALTER TABLE `llx_categorie_product` DISABLE KEYS */; +INSERT INTO `llx_categorie_product` VALUES (5,2,NULL),(6,2,NULL),(8,4,NULL),(9,5,NULL),(9,12,NULL),(10,3,NULL),(10,4,NULL),(24,1,NULL),(24,11,NULL),(25,10,NULL); +/*!40000 ALTER TABLE `llx_categorie_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_project` +-- + +DROP TABLE IF EXISTS `llx_categorie_project`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_project` ( + `fk_categorie` int(11) NOT NULL, + `fk_project` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_project`), + KEY `idx_categorie_project_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_project_fk_project` (`fk_project`), + CONSTRAINT `fk_categorie_project_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_project_fk_project` FOREIGN KEY (`fk_project`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_categorie_project_fk_project_rowid` FOREIGN KEY (`fk_project`) REFERENCES `llx_projet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_project` +-- + +LOCK TABLES `llx_categorie_project` WRITE; +/*!40000 ALTER TABLE `llx_categorie_project` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_project` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_societe` +-- + +DROP TABLE IF EXISTS `llx_categorie_societe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_societe` ( + `fk_categorie` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_soc`), + KEY `idx_categorie_societe_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_societe_fk_societe` (`fk_soc`), + CONSTRAINT `fk_categorie_societe_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_societe_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_societe` +-- + +LOCK TABLES `llx_categorie_societe` WRITE; +/*!40000 ALTER TABLE `llx_categorie_societe` DISABLE KEYS */; +INSERT INTO `llx_categorie_societe` VALUES (2,2,NULL),(2,19,NULL),(12,10,NULL),(12,11,NULL),(14,11,NULL); +/*!40000 ALTER TABLE `llx_categorie_societe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categorie_user` +-- + +DROP TABLE IF EXISTS `llx_categorie_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categorie_user` ( + `fk_categorie` int(11) NOT NULL, + `fk_user` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`fk_categorie`,`fk_user`), + KEY `idx_categorie_user_fk_categorie` (`fk_categorie`), + KEY `idx_categorie_user_fk_user` (`fk_user`), + CONSTRAINT `fk_categorie_user_categorie_rowid` FOREIGN KEY (`fk_categorie`) REFERENCES `llx_categorie` (`rowid`), + CONSTRAINT `fk_categorie_user_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categorie_user` +-- + +LOCK TABLES `llx_categorie_user` WRITE; +/*!40000 ALTER TABLE `llx_categorie_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categorie_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_categories_extrafields` +-- + +DROP TABLE IF EXISTS `llx_categories_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_categories_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_categories_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_categories_extrafields` +-- + +LOCK TABLES `llx_categories_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_categories_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_categories_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_chargesociales` +-- + +DROP TABLE IF EXISTS `llx_chargesociales`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_chargesociales` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_ech` datetime NOT NULL, + `libelle` varchar(80) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_type` int(11) NOT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `paye` smallint(6) NOT NULL DEFAULT '0', + `periode` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `ref` varchar(16) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_chargesociales` +-- + +LOCK TABLES `llx_chargesociales` WRITE; +/*!40000 ALTER TABLE `llx_chargesociales` DISABLE KEYS */; +INSERT INTO `llx_chargesociales` VALUES (4,'2011-08-09 00:00:00','fff',1,60,NULL,NULL,10,1,'2011-08-01','2012-12-08 13:11:10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_chargesociales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande` +-- + +DROP TABLE IF EXISTS `llx_commande`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `ref_client` varchar(255) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `date_commande` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `source` smallint(6) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `amount_ht` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `facture` tinyint(4) DEFAULT '0', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `fk_warehouse` int(11) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `fk_input_reason` int(11) DEFAULT NULL, + `fk_delivery_address` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_commande_ref` (`ref`,`entity`), + KEY `idx_commande_fk_soc` (`fk_soc`), + KEY `idx_commande_fk_user_author` (`fk_user_author`), + KEY `idx_commande_fk_user_valid` (`fk_user_valid`), + KEY `idx_commande_fk_user_cloture` (`fk_user_cloture`), + KEY `idx_commande_fk_projet` (`fk_projet`), + KEY `idx_commande_fk_account` (`fk_account`), + KEY `idx_commande_fk_currency` (`fk_currency`), + CONSTRAINT `fk_commande_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_commande_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_commande_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_commande_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_commande_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande` +-- + +LOCK TABLES `llx_commande` WRITE; +/*!40000 ALTER TABLE `llx_commande` DISABLE KEYS */; +INSERT INTO `llx_commande` VALUES (1,'2016-07-30 15:13:20',1,NULL,'CO1107-0002',1,NULL,NULL,'','2011-07-20 15:23:12','2016-08-08 13:59:09',NULL,'2016-07-20',1,NULL,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,1,1,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(2,'2016-07-30 15:13:20',1,NULL,'CO1107-0003',1,NULL,NULL,'','2011-07-20 23:20:12','2018-02-12 17:06:51',NULL,'2016-07-21',1,NULL,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,0,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(3,'2016-07-30 15:13:20',1,NULL,'CO1107-0004',1,NULL,NULL,'','2011-07-20 23:22:53','2018-02-17 18:27:56',NULL,'2016-07-21',1,NULL,1,NULL,NULL,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,30.00000000,30.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(5,'2016-07-30 15:12:32',1,NULL,'CO1108-0001',1,NULL,NULL,'','2011-08-08 03:04:11','2015-08-08 03:04:21',NULL,'2015-08-08',1,NULL,1,NULL,NULL,2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(6,'2016-07-30 15:13:20',19,NULL,'(PROV6)',1,NULL,NULL,'','2013-02-17 16:22:14',NULL,NULL,'2016-02-17',1,NULL,NULL,NULL,NULL,0,0,0,NULL,0,11.76000000,0.00000000,0.00000000,60.00000000,71.76000000,'','','einstein',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(17,'2017-02-15 22:50:34',4,NULL,'CO7001-0005',1,NULL,NULL,NULL,'2017-02-15 23:50:34','2017-02-15 23:50:34',NULL,'2016-05-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,509.00000000,509.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,509.00000000,0.00000000,509.00000000),(18,'2017-02-15 23:08:58',7,4,'CO7001-0006',1,NULL,NULL,NULL,'2017-02-15 23:51:23','2017-02-15 23:51:23',NULL,'2017-02-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,900.00000000,900.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000),(20,'2017-02-15 23:09:04',4,NULL,'CO7001-0007',1,NULL,NULL,NULL,'2017-02-15 23:55:52','2017-02-15 23:55:52',NULL,'2016-04-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,330.00000000,330.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,330.00000000,0.00000000,330.00000000),(29,'2017-02-15 23:08:42',4,NULL,'CO7001-0008',1,NULL,NULL,NULL,'2017-02-16 00:03:44','2017-02-16 00:03:44',NULL,'2017-02-12',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,457.00000000,457.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,457.00000000,0.00000000,457.00000000),(34,'2017-02-15 23:08:47',11,NULL,'CO7001-0009',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2017-02-16 00:05:01',NULL,'2017-01-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,124.00000000,124.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,124.00000000,0.00000000,124.00000000),(38,'2017-02-15 23:08:50',3,NULL,'CO7001-0010',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2017-02-16 00:05:01',NULL,'2017-02-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000),(40,'2017-02-15 23:08:53',11,NULL,'CO7001-0011',1,NULL,NULL,NULL,'2017-02-16 00:05:10','2017-02-16 00:05:11',NULL,'2017-01-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,1210.00000000,1210.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1210.00000000,0.00000000,1210.00000000),(43,'2017-02-15 23:05:11',10,NULL,'CO7001-0012',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2017-02-16 00:05:11',NULL,'2017-02-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,478.00000000,478.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,478.00000000,0.00000000,478.00000000),(47,'2017-02-15 23:09:10',1,NULL,'CO7001-0013',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2017-02-16 00:05:11',NULL,'2016-11-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,55.00000000,55.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,55.00000000,0.00000000,55.00000000),(48,'2017-02-15 23:09:07',4,NULL,'CO7001-0014',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2017-02-16 00:05:11',NULL,'2016-07-30',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,540.00000000,540.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,540.00000000,0.00000000,540.00000000),(50,'2017-02-15 23:05:26',1,NULL,'CO7001-0015',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2017-02-16 00:05:26',NULL,'2017-12-12',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,118.00000000,118.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,118.00000000,0.00000000,118.00000000),(54,'2017-02-15 23:06:01',12,NULL,'CO7001-0016',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2017-02-16 00:05:26','2017-02-16 03:05:56','2016-06-03',12,NULL,12,12,1,3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,220.00000000,220.00000000,'','','',1,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,220.00000000,0.00000000,220.00000000),(58,'2017-02-15 23:09:13',1,NULL,'CO7001-0017',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2017-02-16 00:05:26',NULL,'2016-07-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,436.00000000,436.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,436.00000000,0.00000000,436.00000000),(62,'2017-02-15 23:09:16',19,NULL,'CO7001-0018',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2017-02-16 00:05:35',NULL,'2016-02-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,410.00000000,410.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,410.00000000,0.00000000,410.00000000),(68,'2017-02-15 23:09:19',3,NULL,'CO7001-0019',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2017-02-16 00:05:35',NULL,'2016-05-19',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,45.00000000,45.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,45.00000000,0.00000000,45.00000000),(72,'2017-02-15 23:09:23',6,NULL,'CO7001-0020',1,NULL,NULL,NULL,'2017-02-16 00:05:36','2017-02-16 00:05:36',NULL,'2016-11-13',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,610.00000000,610.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,610.00000000,0.00000000,610.00000000),(75,'2017-02-16 00:14:20',4,NULL,'CO7001-0021',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2017-02-16 04:14:20',NULL,'2016-02-13',12,NULL,12,NULL,1,1,0,0,NULL,0,25.00000000,49.88000000,0.00000000,1200.00000000,1274.88000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,25.00000000,1274.88000000),(78,'2017-02-15 23:05:37',12,NULL,'CO7001-0022',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2017-02-16 00:05:37',NULL,'2016-10-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,928.00000000,928.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,928.00000000,0.00000000,928.00000000),(81,'2017-02-15 23:09:30',11,NULL,'CO7001-0023',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-07-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,725.00000000,725.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,725.00000000,0.00000000,725.00000000),(83,'2017-02-15 23:10:24',26,NULL,'CO7001-0024',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-04-03',12,NULL,12,NULL,1,-1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,105.00000000,105.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,105.00000000,0.00000000,105.00000000),(84,'2017-02-15 23:05:38',2,NULL,'CO7001-0025',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-06-19',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,510.00000000,510.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,510.00000000,0.00000000,510.00000000),(85,'2017-02-15 23:05:38',1,NULL,'CO7001-0026',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2016-01-03',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,47.00000000,47.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,47.00000000,0.00000000,47.00000000),(88,'2017-02-15 23:09:36',10,NULL,'CO7001-0027',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2017-02-16 00:05:38',NULL,'2015-02-23',12,NULL,12,NULL,1,1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000),(90,'2017-02-16 00:46:31',19,NULL,'(PROV90)',1,NULL,NULL,NULL,'2017-02-16 04:46:31',NULL,NULL,'2017-02-16',12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,440.00000000,440.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000),(91,'2017-02-16 00:46:37',1,NULL,'(PROV91)',1,NULL,NULL,NULL,'2017-02-16 04:46:37',NULL,NULL,'2017-02-16',12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000),(92,'2017-02-16 00:47:25',3,NULL,'(PROV92)',1,NULL,NULL,NULL,'2017-02-16 04:47:25',NULL,NULL,'2017-02-16',12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0.00000000,0.00000000,0.00000000,1018.00000000,1018.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000); +/*!40000 ALTER TABLE `llx_commande` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_extrafields` +-- + +LOCK TABLES `llx_commande_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) NOT NULL, + `ref` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_supplier` varchar(255) DEFAULT NULL, + `fk_projet` int(11) DEFAULT '0', + `date_creation` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_approve` datetime DEFAULT NULL, + `date_approve2` datetime DEFAULT NULL, + `date_commande` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_approve` int(11) DEFAULT NULL, + `fk_user_approve2` int(11) DEFAULT NULL, + `source` smallint(6) NOT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `billed` smallint(6) DEFAULT '0', + `amount_ht` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_input_method` int(11) DEFAULT '0', + `fk_cond_reglement` int(11) DEFAULT '0', + `fk_mode_reglement` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_livraison` datetime DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_commande_fournisseur_ref` (`ref`,`fk_soc`,`entity`), + KEY `idx_commande_fournisseur_fk_soc` (`fk_soc`), + KEY `billed` (`billed`), + CONSTRAINT `fk_commande_fournisseur_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur` +-- + +LOCK TABLES `llx_commande_fournisseur` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur` VALUES (1,'2017-02-01 14:54:01',13,'CF1007-0001',1,NULL,NULL,NULL,'2016-07-11 17:13:40','2017-02-01 18:51:42','2017-02-01 18:52:04',NULL,'2017-02-01',1,NULL,12,12,NULL,0,4,0,0,0,0,39.20000000,0.00000000,0.00000000,200.00000000,239.20000000,NULL,NULL,'muscadet',2,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(2,'2016-07-30 16:11:52',1,'CF1007-0002',1,NULL,NULL,NULL,'2016-07-11 18:46:28','2016-07-11 18:47:33',NULL,NULL,'2016-07-11',1,NULL,1,NULL,NULL,0,3,0,0,0,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,NULL,NULL,'muscadet',4,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(3,'2012-12-08 13:11:07',17,'(PROV3)',1,NULL,NULL,NULL,'2011-08-04 23:00:52',NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(4,'2012-12-08 13:11:07',17,'(PROV4)',1,NULL,NULL,NULL,'2011-08-04 23:19:32',NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(13,'2017-02-01 13:35:27',1,'CF1303-0004',1,NULL,NULL,NULL,'2016-03-09 19:39:18','2016-03-09 19:39:27','2016-03-09 19:39:32',NULL,'2016-03-09',1,NULL,1,1,NULL,0,2,0,0,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,NULL,NULL,'muscadet',1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_commande_fournisseur` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_dispatch` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_dispatch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_dispatch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `fk_commandefourndet` int(11) NOT NULL DEFAULT '0', + `qty` float DEFAULT NULL, + `fk_entrepot` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `batch` varchar(30) DEFAULT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseur_dispatch_fk_commande` (`fk_commande`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_dispatch` +-- + +LOCK TABLES `llx_commande_fournisseur_dispatch` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseur_dispatch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseur_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_extrafields` +-- + +LOCK TABLES `llx_commande_fournisseur_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseur_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseur_log` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseur_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseur_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datelog` datetime NOT NULL, + `fk_commande` int(11) NOT NULL, + `fk_statut` smallint(6) NOT NULL, + `fk_user` int(11) NOT NULL, + `comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseur_log` +-- + +LOCK TABLES `llx_commande_fournisseur_log` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseur_log` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseur_log` VALUES (1,'2010-07-11 15:13:40','2010-07-11 17:13:40',1,0,1,NULL),(2,'2010-07-11 15:15:42','2010-07-11 17:15:42',1,1,1,NULL),(3,'2010-07-11 15:16:28','2010-07-11 17:16:28',1,2,1,NULL),(4,'2010-07-11 15:19:14','2010-07-11 00:00:00',1,3,1,NULL),(5,'2010-07-11 15:19:36','2010-07-11 00:00:00',1,5,1,NULL),(6,'2010-07-11 16:46:28','2010-07-11 18:46:28',2,0,1,NULL),(7,'2010-07-11 16:47:33','2010-07-11 18:47:33',2,1,1,NULL),(8,'2010-07-11 16:47:41','2010-07-11 18:47:41',2,2,1,NULL),(9,'2010-07-11 16:48:00','2010-07-11 00:00:00',2,3,1,NULL),(10,'2011-08-04 21:00:52','2011-08-04 23:00:52',3,0,1,NULL),(11,'2011-08-04 21:19:32','2011-08-04 23:19:32',4,0,1,NULL),(12,'2011-08-04 21:22:16','2011-08-04 23:22:16',5,0,1,NULL),(13,'2011-08-04 21:22:54','2011-08-04 23:22:54',6,0,1,NULL),(14,'2011-08-04 21:23:29','2011-08-04 23:23:29',7,0,1,NULL),(15,'2011-08-04 21:36:10','2011-08-04 23:36:10',8,0,1,NULL),(19,'2011-08-08 13:04:37','2011-08-08 15:04:37',6,1,1,NULL),(20,'2011-08-08 13:04:38','2011-08-08 15:04:38',6,2,1,NULL),(29,'2013-03-09 18:39:18','2013-03-09 19:39:18',13,0,1,NULL),(30,'2013-03-09 18:39:27','2013-03-09 19:39:27',13,1,1,NULL),(31,'2013-03-09 18:39:32','2013-03-09 19:39:32',13,2,1,NULL),(32,'2013-03-09 18:39:41','2013-03-09 00:00:00',13,3,1,'hf'),(33,'2013-03-22 09:26:38','2013-03-22 10:26:38',14,0,1,NULL); +/*!40000 ALTER TABLE `llx_commande_fournisseur_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseurdet` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseurdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseurdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `fk_commande_fournisseurdet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_commande_fournisseurdet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseurdet` +-- + +LOCK TABLES `llx_commande_fournisseurdet` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet` DISABLE KEYS */; +INSERT INTO `llx_commande_fournisseurdet` VALUES (1,1,NULL,NULL,'','','Chips',19.600,'',0.000,'',0.000,'',10,0,0,20.00000000,200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,2,NULL,4,'ABCD','Decapsuleur','',0.000,'',0.000,'',0.000,'',20,0,0,10.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(6,13,NULL,NULL,'','','dfgdf',0.000,'',0.000,'0',0.000,'0',1,0,0,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_commande_fournisseurdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commande_fournisseurdet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commande_fournisseurdet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commande_fournisseurdet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commande_fournisseurdet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commande_fournisseurdet_extrafields` +-- + +LOCK TABLES `llx_commande_fournisseurdet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commande_fournisseurdet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commandedet` +-- + +DROP TABLE IF EXISTS `llx_commandedet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commandedet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_commande` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT NULL, + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT NULL, + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_commandefourndet` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_commandedet_fk_commande` (`fk_commande`), + KEY `idx_commandedet_fk_product` (`fk_product`), + KEY `fk_commandedet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_commandedet_fk_commande` FOREIGN KEY (`fk_commande`) REFERENCES `llx_commande` (`rowid`), + CONSTRAINT `fk_commandedet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=292 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commandedet` +-- + +LOCK TABLES `llx_commandedet` WRITE; +/*!40000 ALTER TABLE `llx_commandedet` DISABLE KEYS */; +INSERT INTO `llx_commandedet` VALUES (1,1,NULL,NULL,NULL,'Product 1',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,1,NULL,2,NULL,'',0.000,'',0.000,'',0.000,'',1,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,1,NULL,5,NULL,'cccc',0.000,'',0.000,'',0.000,'',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,2,NULL,NULL,NULL,'hgf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(10,5,NULL,NULL,NULL,'gfdgdf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(11,6,NULL,NULL,NULL,'gdfg',19.600,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(12,6,NULL,NULL,NULL,'gfdgd',19.600,'',0.000,'',0.000,'',1,0,0,NULL,50,50.00000000,50.00000000,9.80000000,0.00000000,0.00000000,59.80000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(14,3,NULL,NULL,NULL,'gdfgdf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(15,3,NULL,NULL,NULL,'fghfgh',0.000,'',0.000,'',0.000,'',1,0,0,NULL,20,20.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(16,17,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(17,17,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(18,17,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,9,9.00000000,9.00000000,0.00000000,0.00000000,0.00000000,9.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',9.00000000,9.00000000,0.00000000,9.00000000),(19,18,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(20,18,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(21,18,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(24,20,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,5,5.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,20.00000000,0.00000000,20.00000000),(25,20,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(26,20,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(55,29,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(56,29,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(57,29,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(58,29,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,1,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(59,29,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n
        ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,10,10.00000000,30.00000000,0.00000000,0.00000000,0.00000000,30.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',10.00000000,30.00000000,0.00000000,30.00000000),(75,34,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(76,34,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(77,34,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(78,34,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,9,9.00000000,9.00000000,0.00000000,0.00000000,0.00000000,9.00000000,1,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',9.00000000,9.00000000,0.00000000,9.00000000),(94,38,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(95,38,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(99,40,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(100,40,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(101,40,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(102,40,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(103,40,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(112,43,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(113,43,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(114,43,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(115,43,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(116,43,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(125,47,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(126,47,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(127,47,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(128,47,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(129,48,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(130,48,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(134,50,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(135,50,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(145,54,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(146,54,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(158,58,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(159,58,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(160,58,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,9,9.00000000,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',9.00000000,36.00000000,0.00000000,36.00000000),(174,62,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(175,62,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(176,62,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(198,68,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(199,68,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(209,72,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(210,72,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(211,72,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(212,72,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(213,72,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(227,75,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(235,78,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(236,78,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(237,78,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(238,78,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(246,81,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(247,81,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(248,81,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,5,5.00000000,25.00000000,0.00000000,0.00000000,0.00000000,25.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',5.00000000,25.00000000,0.00000000,25.00000000),(253,83,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,5,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,5.00000000,0.00000000,5.00000000),(254,83,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(255,83,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(256,83,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(257,84,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(258,84,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(259,84,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(260,85,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(261,85,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(262,85,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(271,88,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(272,88,NULL,3,NULL,'',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(276,75,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,90.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(278,75,NULL,13,NULL,'A powerfull computer XP4523 
        \r\n(Code douane: USXP765 - Pays d'origine: Etats-Unis)',5.000,'',9.975,'1',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,25.00000000,49.88000000,0.00000000,574.88000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,25.00000000,574.88000000),(279,75,NULL,13,NULL,'A powerfull computer XP4523 
        \n(Code douane: USXP765 - Pays d\'origine: Etats-Unis)',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(280,90,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(281,90,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,10,10.00000000,30.00000000,0.00000000,0.00000000,0.00000000,30.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',10.00000000,30.00000000,0.00000000,30.00000000),(282,90,NULL,2,NULL,'',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(283,90,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(284,91,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(285,91,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(286,91,NULL,13,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(287,92,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(288,92,NULL,13,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(289,92,NULL,10,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(290,92,NULL,13,NULL,'A powerfull computer XP4523 ',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(291,92,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0,'EUR',9.00000000,18.00000000,0.00000000,18.00000000); +/*!40000 ALTER TABLE `llx_commandedet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_commandedet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_commandedet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_commandedet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_commandedet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_commandedet_extrafields` +-- + +LOCK TABLES `llx_commandedet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_commandedet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_commandedet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_const` +-- + +DROP TABLE IF EXISTS `llx_const`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_const` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `value` text NOT NULL, + `type` varchar(6) DEFAULT NULL, + `visible` tinyint(4) NOT NULL DEFAULT '1', + `note` text, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_const` (`name`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=6137 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_const` +-- + +LOCK TABLES `llx_const` WRITE; +/*!40000 ALTER TABLE `llx_const` DISABLE KEYS */; +INSERT INTO `llx_const` VALUES (8,'MAIN_UPLOAD_DOC',0,'2048','chaine',0,'Max size for file upload (0 means no upload allowed)','2010-07-08 11:17:57'),(9,'MAIN_SEARCHFORM_SOCIETE',0,'1','yesno',0,'Show form for quick company search','2010-07-08 11:17:57'),(10,'MAIN_SEARCHFORM_CONTACT',0,'1','yesno',0,'Show form for quick contact search','2010-07-08 11:17:57'),(11,'MAIN_SEARCHFORM_PRODUITSERVICE',0,'1','yesno',0,'Show form for quick product search','2010-07-08 11:17:58'),(12,'MAIN_SEARCHFORM_ADHERENT',0,'1','yesno',0,'Show form for quick member search','2010-07-08 11:17:58'),(16,'MAIN_SIZE_LISTE_LIMIT',0,'25','chaine',0,'Longueur maximum des listes','2010-07-08 11:17:58'),(17,'MAIN_SHOW_WORKBOARD',0,'1','yesno',0,'Affichage tableau de bord de travail Dolibarr','2010-07-08 11:17:58'),(29,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',1,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2010-07-08 11:17:58'),(33,'SOCIETE_NOLIST_COURRIER',0,'1','yesno',0,'Liste les fichiers du repertoire courrier','2010-07-08 11:17:58'),(36,'ADHERENT_MAIL_REQUIRED',1,'1','yesno',0,'EMail required to create a new member','2010-07-08 11:17:58'),(37,'ADHERENT_MAIL_FROM',1,'adherents@domain.com','chaine',0,'Sender EMail for automatic emails','2010-07-08 11:17:58'),(38,'ADHERENT_MAIL_RESIL',1,'Your subscription has been resiliated.\r\nWe hope to see you soon again','texte',0,'Mail resiliation','2010-07-08 11:17:58'),(39,'ADHERENT_MAIL_VALID',1,'Your subscription has been validated.\r\nThis is a remind of your personal information :\r\n\r\n%INFOS%\r\n\r\n','texte',0,'Mail de validation','2010-07-08 11:17:59'),(40,'ADHERENT_MAIL_COTIS',1,'Hello %PRENOM%,\r\nThanks for your subscription.\r\nThis email confirms that your subscription has been received and processed.\r\n\r\n','texte',0,'Mail de validation de cotisation','2010-07-08 11:17:59'),(41,'ADHERENT_MAIL_VALID_SUBJECT',1,'Your subscription has been validated','chaine',0,'Sujet du mail de validation','2010-07-08 11:17:59'),(42,'ADHERENT_MAIL_RESIL_SUBJECT',1,'Resiliating your subscription','chaine',0,'Sujet du mail de resiliation','2010-07-08 11:17:59'),(43,'ADHERENT_MAIL_COTIS_SUBJECT',1,'Receipt of your subscription','chaine',0,'Sujet du mail de validation de cotisation','2010-07-08 11:17:59'),(44,'MAILING_EMAIL_FROM',1,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2010-07-08 11:17:59'),(45,'ADHERENT_USE_MAILMAN',1,'0','yesno',0,'Utilisation de Mailman','2010-07-08 11:17:59'),(46,'ADHERENT_MAILMAN_UNSUB_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%','chaine',0,'Url de desinscription aux listes mailman','2010-07-08 11:17:59'),(47,'ADHERENT_MAILMAN_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%','chaine',0,'Url pour les inscriptions mailman','2010-07-08 11:17:59'),(48,'ADHERENT_MAILMAN_LISTS',1,'test-test,test-test2','chaine',0,'Listes auxquelles inscrire les nouveaux adherents','2010-07-08 11:17:59'),(49,'ADHERENT_MAILMAN_ADMINPW',1,'','chaine',0,'Mot de passe Admin des liste mailman','2010-07-08 11:17:59'),(50,'ADHERENT_MAILMAN_SERVER',1,'lists.domain.com','chaine',0,'Serveur hebergeant les interfaces d Admin des listes mailman','2010-07-08 11:17:59'),(51,'ADHERENT_MAILMAN_LISTS_COTISANT',1,'','chaine',0,'Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement','2010-07-08 11:17:59'),(52,'ADHERENT_USE_SPIP',1,'0','yesno',0,'Utilisation de SPIP ?','2010-07-08 11:17:59'),(53,'ADHERENT_USE_SPIP_AUTO',1,'0','yesno',0,'Utilisation de SPIP automatiquement','2010-07-08 11:17:59'),(54,'ADHERENT_SPIP_USER',1,'user','chaine',0,'user spip','2010-07-08 11:17:59'),(55,'ADHERENT_SPIP_PASS',1,'pass','chaine',0,'Pass de connection','2010-07-08 11:17:59'),(56,'ADHERENT_SPIP_SERVEUR',1,'localhost','chaine',0,'serveur spip','2010-07-08 11:17:59'),(57,'ADHERENT_SPIP_DB',1,'spip','chaine',0,'db spip','2010-07-08 11:17:59'),(58,'ADHERENT_CARD_HEADER_TEXT',1,'%ANNEE%','chaine',0,'Texte imprime sur le haut de la carte adherent','2010-07-08 11:17:59'),(59,'ADHERENT_CARD_FOOTER_TEXT',1,'Association AZERTY','chaine',0,'Texte imprime sur le bas de la carte adherent','2010-07-08 11:17:59'),(61,'FCKEDITOR_ENABLE_USER',1,'1','yesno',0,'Activation fckeditor sur notes utilisateurs','2010-07-08 11:17:59'),(62,'FCKEDITOR_ENABLE_SOCIETE',1,'1','yesno',0,'Activation fckeditor sur notes societe','2010-07-08 11:17:59'),(63,'FCKEDITOR_ENABLE_PRODUCTDESC',1,'1','yesno',0,'Activation fckeditor sur notes produits','2010-07-08 11:17:59'),(64,'FCKEDITOR_ENABLE_MEMBER',1,'1','yesno',0,'Activation fckeditor sur notes adherent','2010-07-08 11:17:59'),(65,'FCKEDITOR_ENABLE_MAILING',1,'1','yesno',0,'Activation fckeditor sur emailing','2010-07-08 11:17:59'),(67,'DON_ADDON_MODEL',1,'html_cerfafr','chaine',0,'','2010-07-08 11:18:00'),(68,'PROPALE_ADDON',1,'mod_propale_marbre','chaine',0,'','2010-07-08 11:18:00'),(69,'PROPALE_ADDON_PDF',1,'azur','chaine',0,'','2010-07-08 11:18:00'),(70,'COMMANDE_ADDON',1,'mod_commande_marbre','chaine',0,'','2010-07-08 11:18:00'),(71,'COMMANDE_ADDON_PDF',1,'einstein','chaine',0,'','2010-07-08 11:18:00'),(72,'COMMANDE_SUPPLIER_ADDON',1,'mod_commande_fournisseur_muguet','chaine',0,'','2010-07-08 11:18:00'),(73,'COMMANDE_SUPPLIER_ADDON_PDF',1,'muscadet','chaine',0,'','2010-07-08 11:18:00'),(74,'EXPEDITION_ADDON',1,'enlevement','chaine',0,'','2010-07-08 11:18:00'),(76,'FICHEINTER_ADDON',1,'pacific','chaine',0,'','2010-07-08 11:18:00'),(77,'FICHEINTER_ADDON_PDF',1,'soleil','chaine',0,'','2010-07-08 11:18:00'),(79,'FACTURE_ADDON_PDF',1,'crabe','chaine',0,'','2010-07-08 11:18:00'),(80,'PROPALE_VALIDITY_DURATION',1,'15','chaine',0,'Durée de validitée des propales','2010-07-08 11:18:00'),(230,'COMPANY_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2010-07-08 11:26:20'),(238,'LIVRAISON_ADDON_PDF',1,'typhon','chaine',0,'Nom du gestionnaire de generation des commandes en PDF','2010-07-08 11:26:27'),(239,'LIVRAISON_ADDON_NUMBER',1,'mod_livraison_jade','chaine',0,'Nom du gestionnaire de numerotation des bons de livraison','2013-03-20 13:17:36'),(245,'FACTURE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2010-07-08 11:28:53'),(249,'DON_FORM',1,'fsfe.fr.php','chaine',0,'Nom du gestionnaire de formulaire de dons','2010-07-08 11:29:00'),(254,'ADHERENT_BANK_ACCOUNT',1,'','chaine',0,'ID du Compte banquaire utilise','2010-07-08 11:29:05'),(255,'ADHERENT_BANK_CATEGORIE',1,'','chaine',0,'ID de la categorie banquaire des cotisations','2010-07-08 11:29:05'),(256,'ADHERENT_ETIQUETTE_TYPE',1,'L7163','chaine',0,'Type d etiquette (pour impression de planche d etiquette)','2010-07-08 11:29:05'),(269,'PROJECT_ADDON_PDF',1,'baleine','chaine',0,'Nom du gestionnaire de generation des projets en PDF','2010-07-08 11:29:33'),(270,'PROJECT_ADDON',1,'mod_project_simple','chaine',0,'Nom du gestionnaire de numerotation des projets','2010-07-08 11:29:33'),(368,'STOCK_USERSTOCK_AUTOCREATE',1,'1','chaine',0,'','2010-07-08 22:44:59'),(369,'EXPEDITION_ADDON_PDF',1,'merou','chaine',0,'','2010-07-08 22:58:07'),(377,'FACTURE_ADDON',1,'mod_facture_terre','chaine',0,'','2010-07-08 23:08:12'),(380,'ADHERENT_CARD_TEXT',1,'%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','',0,'Texte imprime sur la carte adherent','2010-07-08 23:14:46'),(381,'ADHERENT_CARD_TEXT_RIGHT',1,'aaa','',0,'','2010-07-08 23:14:55'),(385,'PRODUIT_USE_SEARCH_TO_SELECT',1,'1','chaine',0,'','2010-07-08 23:22:19'),(386,'STOCK_CALCULATE_ON_SHIPMENT',1,'1','chaine',0,'','2010-07-08 23:23:21'),(387,'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',1,'1','chaine',0,'','2010-07-08 23:23:26'),(392,'MAIN_AGENDA_XCAL_EXPORTKEY',1,'dolibarr','chaine',0,'','2010-07-08 23:27:50'),(393,'MAIN_AGENDA_EXPORT_PAST_DELAY',1,'100','chaine',0,'','2010-07-08 23:27:50'),(610,'CASHDESK_ID_THIRDPARTY',1,'7','chaine',0,'','2010-07-11 17:08:18'),(611,'CASHDESK_ID_BANKACCOUNT_CASH',1,'3','chaine',0,'','2010-07-11 17:08:18'),(612,'CASHDESK_ID_BANKACCOUNT_CHEQUE',1,'1','chaine',0,'','2010-07-11 17:08:18'),(613,'CASHDESK_ID_BANKACCOUNT_CB',1,'1','chaine',0,'','2010-07-11 17:08:18'),(614,'CASHDESK_ID_WAREHOUSE',1,'2','chaine',0,'','2010-07-11 17:08:18'),(660,'LDAP_USER_DN',1,'ou=users,dc=my-domain,dc=com','chaine',0,NULL,'2010-07-18 10:25:27'),(661,'LDAP_GROUP_DN',1,'ou=groups,dc=my-domain,dc=com','chaine',0,NULL,'2010-07-18 10:25:27'),(662,'LDAP_FILTER_CONNECTION',1,'&(objectClass=user)(objectCategory=person)','chaine',0,NULL,'2010-07-18 10:25:27'),(663,'LDAP_FIELD_LOGIN',1,'uid','chaine',0,NULL,'2010-07-18 10:25:27'),(664,'LDAP_FIELD_FULLNAME',1,'cn','chaine',0,NULL,'2010-07-18 10:25:27'),(665,'LDAP_FIELD_NAME',1,'sn','chaine',0,NULL,'2010-07-18 10:25:27'),(666,'LDAP_FIELD_FIRSTNAME',1,'givenname','chaine',0,NULL,'2010-07-18 10:25:27'),(667,'LDAP_FIELD_MAIL',1,'mail','chaine',0,NULL,'2010-07-18 10:25:27'),(668,'LDAP_FIELD_PHONE',1,'telephonenumber','chaine',0,NULL,'2010-07-18 10:25:27'),(669,'LDAP_FIELD_FAX',1,'facsimiletelephonenumber','chaine',0,NULL,'2010-07-18 10:25:27'),(670,'LDAP_FIELD_MOBILE',1,'mobile','chaine',0,NULL,'2010-07-18 10:25:27'),(671,'LDAP_SERVER_TYPE',1,'openldap','chaine',0,'','2010-07-18 10:25:46'),(672,'LDAP_SERVER_PROTOCOLVERSION',1,'3','chaine',0,'','2010-07-18 10:25:47'),(673,'LDAP_SERVER_HOST',1,'localhost','chaine',0,'','2010-07-18 10:25:47'),(674,'LDAP_SERVER_PORT',1,'389','chaine',0,'','2010-07-18 10:25:47'),(675,'LDAP_SERVER_USE_TLS',1,'0','chaine',0,'','2010-07-18 10:25:47'),(676,'LDAP_SYNCHRO_ACTIVE',1,'dolibarr2ldap','chaine',0,'','2010-07-18 10:25:47'),(677,'LDAP_CONTACT_ACTIVE',1,'1','chaine',0,'','2010-07-18 10:25:47'),(678,'LDAP_MEMBER_ACTIVE',1,'1','chaine',0,'','2010-07-18 10:25:47'),(974,'MAIN_MODULE_WORKFLOW_TRIGGERS',1,'1','chaine',0,NULL,'2011-07-18 18:02:20'),(975,'WORKFLOW_PROPAL_AUTOCREATE_ORDER',1,'1','chaine',0,'','2011-07-18 18:02:24'),(980,'PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR',1,'1234567','chaine',0,'','2011-07-18 18:05:50'),(983,'FACTURE_RIB_NUMBER',1,'1','chaine',0,'','2011-07-18 18:35:14'),(984,'FACTURE_CHQ_NUMBER',1,'1','chaine',0,'','2011-07-18 18:35:14'),(1016,'GOOGLE_DUPLICATE_INTO_GCAL',1,'1','chaine',0,'','2011-07-18 21:40:20'),(1152,'SOCIETE_CODECLIENT_ADDON',1,'mod_codeclient_monkey','chaine',0,'','2011-07-29 20:50:02'),(1231,'MAIN_UPLOAD_DOC',1,'2048','chaine',0,'','2011-07-29 21:04:00'),(1234,'MAIN_UMASK',1,'0664','chaine',0,'','2011-07-29 21:04:11'),(1240,'MAIN_LOGEVENTS_USER_LOGIN',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1241,'MAIN_LOGEVENTS_USER_LOGIN_FAILED',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1242,'MAIN_LOGEVENTS_USER_LOGOUT',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1243,'MAIN_LOGEVENTS_USER_CREATE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1244,'MAIN_LOGEVENTS_USER_MODIFY',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1245,'MAIN_LOGEVENTS_USER_NEW_PASSWORD',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1246,'MAIN_LOGEVENTS_USER_ENABLEDISABLE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1247,'MAIN_LOGEVENTS_USER_DELETE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1248,'MAIN_LOGEVENTS_GROUP_CREATE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1249,'MAIN_LOGEVENTS_GROUP_MODIFY',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1250,'MAIN_LOGEVENTS_GROUP_DELETE',1,'1','chaine',0,'','2011-07-29 21:05:01'),(1251,'MAIN_BOXES_MAXLINES',1,'5','',0,'','2011-07-29 21:05:42'),(1482,'EXPEDITION_ADDON_NUMBER',1,'mod_expedition_safor','chaine',0,'Nom du gestionnaire de numerotation des expeditions','2011-08-05 17:53:11'),(1490,'CONTRACT_ADDON',1,'mod_contract_serpis','chaine',0,'Nom du gestionnaire de numerotation des contrats','2011-08-05 18:11:58'),(1677,'COMMANDE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/orders','chaine',0,NULL,'2012-12-08 13:11:02'),(1698,'PRODUCT_CODEPRODUCT_ADDON',1,'mod_codeproduct_leopard','yesno',0,'Module to control product codes','2012-12-08 13:11:25'),(1724,'PROPALE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2012-12-08 13:17:14'),(1730,'OPENSTREETMAP_ENABLE_MAPS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1731,'OPENSTREETMAP_ENABLE_MAPS_CONTACTS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1732,'OPENSTREETMAP_ENABLE_MAPS_MEMBERS',1,'1','chaine',0,'','2012-12-08 13:22:47'),(1733,'OPENSTREETMAP_MAPS_ZOOM_LEVEL',1,'15','chaine',0,'','2012-12-08 13:22:47'),(1742,'MAIN_MAIL_EMAIL_FROM',2,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2012-12-08 14:08:14'),(1743,'MAIN_MENU_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2013-02-11 19:43:54'),(1744,'MAIN_MENUFRONT_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2013-02-11 19:43:54'),(1745,'MAIN_MENU_SMARTPHONE',2,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2012-12-08 14:08:14'),(1746,'MAIN_MENUFRONT_SMARTPHONE',2,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2012-12-08 14:08:14'),(1747,'MAIN_THEME',2,'eldy','chaine',0,'Default theme','2012-12-08 14:08:14'),(1748,'MAIN_DELAY_ACTIONS_TODO',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2012-12-08 14:08:14'),(1749,'MAIN_DELAY_ORDERS_TO_PROCESS',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2012-12-08 14:08:14'),(1750,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2012-12-08 14:08:14'),(1751,'MAIN_DELAY_PROPALS_TO_CLOSE',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2012-12-08 14:08:14'),(1752,'MAIN_DELAY_PROPALS_TO_BILL',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2012-12-08 14:08:14'),(1753,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2012-12-08 14:08:14'),(1754,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2012-12-08 14:08:14'),(1755,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-12-08 14:08:14'),(1756,'MAIN_DELAY_RUNNING_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2012-12-08 14:08:14'),(1757,'MAIN_DELAY_MEMBERS',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2012-12-08 14:08:14'),(1758,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',2,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2012-12-08 14:08:14'),(1759,'MAILING_EMAIL_FROM',2,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-12-08 14:08:14'),(1760,'MAIN_INFO_SOCIETE_COUNTRY',3,'1:FR:France','chaine',0,'','2013-02-26 21:56:28'),(1761,'MAIN_INFO_SOCIETE_NOM',3,'bbb','chaine',0,'','2012-12-08 14:08:20'),(1762,'MAIN_INFO_SOCIETE_STATE',3,'0','chaine',0,'','2013-02-27 14:20:27'),(1763,'MAIN_MONNAIE',3,'EUR','chaine',0,'','2012-12-08 14:08:20'),(1764,'MAIN_LANG_DEFAULT',3,'auto','chaine',0,'','2012-12-08 14:08:20'),(1765,'MAIN_MAIL_EMAIL_FROM',3,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2012-12-08 14:08:20'),(1766,'MAIN_MENU_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2013-02-11 19:43:54'),(1767,'MAIN_MENUFRONT_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2013-02-11 19:43:54'),(1768,'MAIN_MENU_SMARTPHONE',3,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2012-12-08 14:08:20'),(1769,'MAIN_MENUFRONT_SMARTPHONE',3,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2012-12-08 14:08:20'),(1770,'MAIN_THEME',3,'eldy','chaine',0,'Default theme','2012-12-08 14:08:20'),(1771,'MAIN_DELAY_ACTIONS_TODO',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2012-12-08 14:08:20'),(1772,'MAIN_DELAY_ORDERS_TO_PROCESS',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2012-12-08 14:08:20'),(1773,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2012-12-08 14:08:20'),(1774,'MAIN_DELAY_PROPALS_TO_CLOSE',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2012-12-08 14:08:20'),(1775,'MAIN_DELAY_PROPALS_TO_BILL',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2012-12-08 14:08:20'),(1776,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2012-12-08 14:08:20'),(1777,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2012-12-08 14:08:20'),(1778,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-12-08 14:08:20'),(1779,'MAIN_DELAY_RUNNING_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2012-12-08 14:08:20'),(1780,'MAIN_DELAY_MEMBERS',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2012-12-08 14:08:20'),(1781,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',3,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2012-12-08 14:08:20'),(1782,'MAILING_EMAIL_FROM',3,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-12-08 14:08:20'),(1803,'SYSLOG_FILE',1,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2012-12-08 14:15:08'),(1804,'SYSLOG_HANDLERS',1,'[\"mod_syslog_file\"]','chaine',0,'','2012-12-08 14:15:08'),(1805,'MAIN_MODULE_SKINCOLOREDITOR',3,'1',NULL,0,NULL,'2012-12-08 14:35:40'),(1806,'MAIN_MODULE_SKINCOLOREDITOR_TABS_0',3,'user:+tabskincoloreditors:ColorEditor:skincoloreditor@skincoloreditor:/skincoloreditor/usercolors.php?id=__ID__','chaine',0,NULL,'2012-12-08 14:35:40'),(1922,'PAYPAL_API_SANDBOX',1,'1','chaine',0,'','2012-12-12 12:11:05'),(1923,'PAYPAL_API_USER',1,'seller_1355312017_biz_api1.nltechno.com','chaine',0,'','2012-12-12 12:11:05'),(1924,'PAYPAL_API_PASSWORD',1,'1355312040','chaine',0,'','2012-12-12 12:11:05'),(1925,'PAYPAL_API_SIGNATURE',1,'AXqqdsWBzvfn0q5iNmbuiDv1y.3EAXIMWyl4C5KvDReR9HDwwAd6dQ4Q','chaine',0,'','2012-12-12 12:11:05'),(1926,'PAYPAL_API_INTEGRAL_OR_PAYPALONLY',1,'integral','chaine',0,'','2012-12-12 12:11:05'),(1927,'PAYPAL_SECURITY_TOKEN',1,'50c82fab36bb3b6aa83e2a50691803b2','chaine',0,'','2012-12-12 12:11:05'),(1928,'PAYPAL_SECURITY_TOKEN_UNIQUE',1,'0','chaine',0,'','2012-12-12 12:11:05'),(1929,'PAYPAL_ADD_PAYMENT_URL',1,'1','chaine',0,'','2012-12-12 12:11:05'),(1980,'MAIN_PDF_FORMAT',1,'EUA4','chaine',0,'','2012-12-12 19:58:05'),(1981,'MAIN_PROFID1_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1982,'MAIN_PROFID2_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1983,'MAIN_PROFID3_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1984,'MAIN_PROFID4_IN_ADDRESS',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1985,'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',1,'0','chaine',0,'','2012-12-12 19:58:05'),(1990,'MAIN_SMS_SENDMODE',1,'ovh','chaine',0,'This is to enable OVH SMS engine','2012-12-17 21:19:01'),(2251,'FCKEDITOR_TEST',1,'Test
        \r\n\"\"fdfs','chaine',0,'','2012-12-19 19:12:24'),(2293,'SYSTEMTOOLS_MYSQLDUMP',1,'/usr/bin/mysqldump','chaine',0,'','2012-12-27 02:02:00'),(2835,'MAIN_USE_CONNECT_TIMEOUT',1,'10','chaine',0,'','2013-01-16 19:28:50'),(2836,'MAIN_USE_RESPONSE_TIMEOUT',1,'30','chaine',0,'','2013-01-16 19:28:50'),(2837,'MAIN_PROXY_USE',1,'0','chaine',0,'','2013-01-16 19:28:50'),(2838,'MAIN_PROXY_HOST',1,'localhost','chaine',0,'','2013-01-16 19:28:50'),(2839,'MAIN_PROXY_PORT',1,'8080','chaine',0,'','2013-01-16 19:28:50'),(2840,'MAIN_PROXY_USER',1,'aaa','chaine',0,'','2013-01-16 19:28:50'),(2841,'MAIN_PROXY_PASS',1,'bbb','chaine',0,'','2013-01-16 19:28:50'),(2848,'OVHSMS_NICK',1,'BN196-OVH','chaine',0,'','2013-01-16 19:32:36'),(2849,'OVHSMS_PASS',1,'bigone-10','chaine',0,'','2013-01-16 19:32:36'),(2850,'OVHSMS_SOAPURL',1,'https://www.ovh.com/soapi/soapi-re-1.55.wsdl','chaine',0,'','2013-01-16 19:32:36'),(2854,'THEME_ELDY_RGB',1,'bfbf00','chaine',0,'','2013-01-18 10:02:53'),(2855,'THEME_ELDY_ENABLE_PERSONALIZED',1,'0','chaine',0,'','2013-01-18 10:02:55'),(2858,'MAIN_SESSION_TIMEOUT',1,'2000','chaine',0,'','2013-01-19 17:01:53'),(2862,'TICKET_ADDON',1,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2013-01-19 17:16:10'),(2867,'FACSIM_ADDON',1,'mod_facsim_alcoy','chaine',0,'','2013-01-19 17:16:25'),(2868,'POS_SERVICES',1,'0','chaine',0,'','2013-01-19 17:16:51'),(2869,'POS_USE_TICKETS',1,'1','chaine',0,'','2013-01-19 17:16:51'),(2870,'POS_MAX_TTC',1,'100','chaine',0,'','2013-01-19 17:16:51'),(3190,'MAIN_MODULE_HOLIDAY',2,'1',NULL,0,NULL,'2013-02-01 08:52:34'),(3191,'MAIN_MODULE_HOLIDAY_TABS_0',2,'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->write:/holiday/index.php?mainmenu=holiday&id=__ID__','chaine',0,NULL,'2013-02-01 08:52:34'),(3195,'INVOICE_SUPPLIER_ADDON_PDF',1,'canelle','chaine',0,'','2013-02-10 19:50:27'),(3199,'MAIN_FORCE_RELOAD_PAGE',1,'1','chaine',0,NULL,'2013-02-12 16:22:55'),(3217,'MAIN_PDF_TITLE_BACKGROUND_COLOR',1,'240,240,240','chaine',1,'','2013-02-13 15:18:02'),(3223,'OVH_THIRDPARTY_IMPORT',1,'2','chaine',0,'','2013-02-13 16:20:18'),(3241,'COMPANY_USE_SEARCH_TO_SELECT',1,'2','chaine',0,'','2013-02-17 14:33:39'),(3409,'AGENDA_USE_EVENT_TYPE',1,'1','chaine',0,'','2013-02-27 18:12:24'),(3886,'MAIN_REMOVE_INSTALL_WARNING',1,'1','chaine',1,'','2013-03-02 18:32:50'),(4013,'MAIN_DELAY_ACTIONS_TODO',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4014,'MAIN_DELAY_PROPALS_TO_CLOSE',1,'31','chaine',0,'','2013-03-06 08:59:12'),(4015,'MAIN_DELAY_PROPALS_TO_BILL',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4016,'MAIN_DELAY_ORDERS_TO_PROCESS',1,'2','chaine',0,'','2013-03-06 08:59:12'),(4017,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',1,'31','chaine',0,'','2013-03-06 08:59:12'),(4018,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',1,'7','chaine',0,'','2013-03-06 08:59:12'),(4019,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',1,'2','chaine',0,'','2013-03-06 08:59:12'),(4020,'MAIN_DELAY_RUNNING_SERVICES',1,'-15','chaine',0,'','2013-03-06 08:59:12'),(4021,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',1,'62','chaine',0,'','2013-03-06 08:59:13'),(4022,'MAIN_DELAY_MEMBERS',1,'31','chaine',0,'','2013-03-06 08:59:13'),(4023,'MAIN_DISABLE_METEO',1,'0','chaine',0,'','2013-03-06 08:59:13'),(4044,'ADHERENT_VAT_FOR_SUBSCRIPTIONS',1,'0','',0,'','2013-03-06 16:06:38'),(4047,'ADHERENT_BANK_USE',1,'bankviainvoice','',0,'','2013-03-06 16:12:30'),(4049,'PHPSANE_SCANIMAGE',1,'/usr/bin/scanimage','chaine',0,'','2013-03-06 21:54:13'),(4050,'PHPSANE_PNMTOJPEG',1,'/usr/bin/pnmtojpeg','chaine',0,'','2013-03-06 21:54:13'),(4051,'PHPSANE_PNMTOTIFF',1,'/usr/bin/pnmtotiff','chaine',0,'','2013-03-06 21:54:13'),(4052,'PHPSANE_OCR',1,'/usr/bin/gocr','chaine',0,'','2013-03-06 21:54:13'),(4548,'ECM_AUTO_TREE_ENABLED',1,'1','chaine',0,'','2013-03-10 15:57:21'),(4579,'MAIN_MODULE_AGENDA',2,'1',NULL,0,NULL,'2013-03-13 15:29:19'),(4580,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4581,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4582,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4583,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4584,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4585,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4586,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4587,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4588,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4589,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4590,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4591,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4592,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4593,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4594,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',2,'1','chaine',0,NULL,'2013-03-13 15:29:19'),(4595,'MAIN_MODULE_GOOGLE',2,'1',NULL,0,NULL,'2013-03-13 15:29:47'),(4596,'MAIN_MODULE_GOOGLE_TABS_0',2,'agenda:+gcal:MenuAgendaGoogle:google@google:$conf->google->enabled && $conf->global->GOOGLE_ENABLE_AGENDA:/google/index.php','chaine',0,NULL,'2013-03-13 15:29:47'),(4597,'MAIN_MODULE_GOOGLE_TABS_1',2,'user:+gsetup:GoogleUserConf:google@google:$conf->google->enabled && $conf->global->GOOGLE_DUPLICATE_INTO_GCAL:/google/admin/google_calsync_user.php?id=__ID__','chaine',0,NULL,'2013-03-13 15:29:47'),(4598,'MAIN_MODULE_GOOGLE_TRIGGERS',2,'1','chaine',0,NULL,'2013-03-13 15:29:47'),(4599,'MAIN_MODULE_GOOGLE_HOOKS',2,'[\"toprightmenu\"]','chaine',0,NULL,'2013-03-13 15:29:47'),(4688,'GOOGLE_ENABLE_AGENDA',2,'1','chaine',0,'','2013-03-13 15:36:29'),(4689,'GOOGLE_AGENDA_NAME1',2,'eldy','chaine',0,'','2013-03-13 15:36:29'),(4690,'GOOGLE_AGENDA_SRC1',2,'eldy10@mail.com','chaine',0,'','2013-03-13 15:36:29'),(4691,'GOOGLE_AGENDA_COLOR1',2,'BE6D00','chaine',0,'','2013-03-13 15:36:29'),(4692,'GOOGLE_AGENDA_COLOR2',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4693,'GOOGLE_AGENDA_COLOR3',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4694,'GOOGLE_AGENDA_COLOR4',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4695,'GOOGLE_AGENDA_COLOR5',2,'7A367A','chaine',0,'','2013-03-13 15:36:29'),(4696,'GOOGLE_AGENDA_TIMEZONE',2,'Europe/Paris','chaine',0,'','2013-03-13 15:36:29'),(4697,'GOOGLE_AGENDA_NB',2,'5','chaine',0,'','2013-03-13 15:36:29'),(4711,'GOOGLE_ENABLE_AGENDA',1,'1','chaine',0,'','2013-03-13 19:37:38'),(4712,'GOOGLE_AGENDA_NAME1',1,'asso master','chaine',0,'','2013-03-13 19:37:38'),(4713,'GOOGLE_AGENDA_SRC1',1,'assodolibarr@mail.com','chaine',0,'','2013-03-13 19:37:38'),(4714,'GOOGLE_AGENDA_COLOR1',1,'1B887A','chaine',0,'','2013-03-13 19:37:38'),(4715,'GOOGLE_AGENDA_COLOR2',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4716,'GOOGLE_AGENDA_COLOR3',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4717,'GOOGLE_AGENDA_COLOR4',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4718,'GOOGLE_AGENDA_COLOR5',1,'7A367A','chaine',0,'','2013-03-13 19:37:38'),(4719,'GOOGLE_AGENDA_TIMEZONE',1,'Europe/Paris','chaine',0,'','2013-03-13 19:37:38'),(4720,'GOOGLE_AGENDA_NB',1,'5','chaine',0,'','2013-03-13 19:37:38'),(4725,'SOCIETE_CODECLIENT_ADDON',2,'mod_codeclient_leopard','chaine',0,'Module to control third parties codes','2013-03-13 20:21:35'),(4726,'SOCIETE_CODECOMPTA_ADDON',2,'mod_codecompta_panicum','chaine',0,'Module to control third parties codes','2013-03-13 20:21:35'),(4727,'SOCIETE_FISCAL_MONTH_START',2,'','chaine',0,'Mettre le numero du mois du debut d\\\'annee fiscale, ex: 9 pour septembre','2013-03-13 20:21:35'),(4728,'MAIN_SEARCHFORM_SOCIETE',2,'1','yesno',0,'Show form for quick company search','2013-03-13 20:21:35'),(4729,'MAIN_SEARCHFORM_CONTACT',2,'1','yesno',0,'Show form for quick contact search','2013-03-13 20:21:35'),(4730,'COMPANY_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2013-03-13 20:21:35'),(4743,'MAIN_MODULE_CLICKTODIAL',2,'1',NULL,0,NULL,'2013-03-13 20:30:28'),(4744,'MAIN_MODULE_NOTIFICATION',2,'1',NULL,0,NULL,'2013-03-13 20:30:34'),(4745,'MAIN_MODULE_WEBSERVICES',2,'1',NULL,0,NULL,'2013-03-13 20:30:41'),(4746,'MAIN_MODULE_PROPALE',2,'1',NULL,0,NULL,'2013-03-13 20:32:38'),(4747,'PROPALE_ADDON_PDF',2,'azur','chaine',0,'Nom du gestionnaire de generation des propales en PDF','2013-03-13 20:32:38'),(4748,'PROPALE_ADDON',2,'mod_propale_marbre','chaine',0,'Nom du gestionnaire de numerotation des propales','2013-03-13 20:32:38'),(4749,'PROPALE_VALIDITY_DURATION',2,'15','chaine',0,'Duration of validity of business proposals','2013-03-13 20:32:38'),(4750,'PROPALE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2013-03-13 20:32:38'),(4752,'MAIN_MODULE_TAX',2,'1',NULL,0,NULL,'2013-03-13 20:32:47'),(4753,'MAIN_MODULE_DON',2,'1',NULL,0,NULL,'2013-03-13 20:32:54'),(4754,'DON_ADDON_MODEL',2,'html_cerfafr','chaine',0,'Nom du gestionnaire de generation de recu de dons','2013-03-13 20:32:54'),(4755,'POS_USE_TICKETS',2,'1','chaine',0,'','2013-03-13 20:33:09'),(4756,'POS_MAX_TTC',2,'100','chaine',0,'','2013-03-13 20:33:09'),(4757,'MAIN_MODULE_POS',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4758,'TICKET_ADDON',2,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2013-03-13 20:33:09'),(4759,'MAIN_MODULE_BANQUE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4760,'MAIN_MODULE_FACTURE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4761,'FACTURE_ADDON_PDF',2,'crabe','chaine',0,'Name of PDF model of invoice','2013-03-13 20:33:09'),(4762,'FACTURE_ADDON',2,'mod_facture_terre','chaine',0,'Name of numbering numerotation rules of invoice','2013-03-13 20:33:09'),(4763,'FACTURE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2013-03-13 20:33:09'),(4764,'MAIN_MODULE_SOCIETE',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4765,'MAIN_MODULE_PRODUCT',2,'1',NULL,0,NULL,'2013-03-13 20:33:09'),(4766,'PRODUCT_CODEPRODUCT_ADDON',2,'mod_codeproduct_leopard','chaine',0,'Module to control product codes','2013-03-13 20:33:09'),(4767,'MAIN_SEARCHFORM_PRODUITSERVICE',2,'1','yesno',0,'Show form for quick product search','2013-03-13 20:33:09'),(4772,'FACSIM_ADDON',2,'mod_facsim_alcoy','chaine',0,'','2013-03-13 20:33:32'),(4773,'MAIN_MODULE_MAILING',2,'1',NULL,0,NULL,'2013-03-13 20:33:37'),(4774,'MAIN_MODULE_OPENSURVEY',2,'1',NULL,0,NULL,'2013-03-13 20:33:42'),(4782,'AGENDA_USE_EVENT_TYPE',2,'1','chaine',0,'','2013-03-13 20:53:36'),(4884,'AGENDA_DISABLE_EXT',2,'1','chaine',0,'','2013-03-13 22:03:40'),(4928,'COMMANDE_SUPPLIER_ADDON_NUMBER',1,'mod_commande_fournisseur_muguet','chaine',0,'Nom du gestionnaire de numerotation des commandes fournisseur','2013-03-22 09:24:29'),(4929,'INVOICE_SUPPLIER_ADDON_NUMBER',1,'mod_facture_fournisseur_cactus','chaine',0,'Nom du gestionnaire de numerotation des factures fournisseur','2013-03-22 09:24:29'),(5001,'MAIN_CRON_KEY',0,'bc54582fe30d5d4a830c6f582ec28810','chaine',0,'','2013-03-23 17:54:53'),(5009,'CRON_KEY',0,'2c2e755c20be2014098f629865598006','chaine',0,'','2013-03-23 18:06:24'),(5075,'MAIN_MENU_STANDARD',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5076,'MAIN_MENU_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5077,'MAIN_MENUFRONT_STANDARD',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5078,'MAIN_MENUFRONT_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2013-03-24 02:51:13'),(5139,'SOCIETE_ADD_REF_IN_LIST',1,'','yesno',0,'Display customer ref into select list','2013-09-08 23:06:08'),(5150,'PROJECT_TASK_ADDON_PDF',1,'','chaine',0,'Name of PDF/ODT tasks manager class','2013-09-08 23:06:14'),(5151,'PROJECT_TASK_ADDON',1,'mod_task_simple','chaine',0,'Name of Numbering Rule task manager class','2013-09-08 23:06:14'),(5152,'PROJECT_TASK_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/tasks','chaine',0,'','2013-09-08 23:06:14'),(5195,'GOOGLE_DUPLICATE_INTO_THIRDPARTIES',1,'1','chaine',0,'','2013-11-07 00:02:34'),(5196,'GOOGLE_DUPLICATE_INTO_CONTACTS',1,'0','chaine',0,'','2013-11-07 00:02:34'),(5197,'GOOGLE_DUPLICATE_INTO_MEMBERS',1,'0','chaine',0,'','2013-11-07 00:02:34'),(5198,'GOOGLE_CONTACT_LOGIN',1,'eldy10@mail.com','chaine',0,'','2013-11-07 00:02:34'),(5199,'GOOGLE_CONTACT_PASSWORD',1,'bidonge','chaine',0,'','2013-11-07 00:02:34'),(5200,'GOOGLE_TAG_PREFIX',1,'Dolibarr (Thirdparties)','chaine',0,'','2013-11-07 00:02:34'),(5201,'GOOGLE_TAG_PREFIX_CONTACTS',1,'Dolibarr (Contacts/Addresses)','chaine',0,'','2013-11-07 00:02:34'),(5202,'GOOGLE_TAG_PREFIX_MEMBERS',1,'Dolibarr (Members)','chaine',0,'','2013-11-07 00:02:34'),(5239,'BOOKMARKS_SHOW_IN_MENU',1,'10','chaine',0,'','2014-03-02 15:42:26'),(5271,'DONATION_ART200',1,'','yesno',0,'Option Française - Eligibilité Art200 du CGI','2014-12-21 12:51:28'),(5272,'DONATION_ART238',1,'','yesno',0,'Option Française - Eligibilité Art238 bis du CGI','2014-12-21 12:51:28'),(5273,'DONATION_ART885',1,'','yesno',0,'Option Française - Eligibilité Art885-0 V bis du CGI','2014-12-21 12:51:28'),(5274,'DONATION_MESSAGE',1,'Thank you','chaine',0,'Message affiché sur le récépissé de versements ou dons','2014-12-21 12:51:28'),(5288,'DONATION_ACCOUNTINGACCOUNT',1,'7581','chaine',0,'Compte comptable de remise des versements ou dons','2015-07-19 13:41:21'),(5339,'MAIN_MULTILANGS',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5340,'MAIN_SIZE_LISTE_LIMIT',1,'25','chaine',0,'','2015-10-03 10:11:33'),(5341,'MAIN_DISABLE_JAVASCRIPT',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5342,'MAIN_BUTTON_HIDE_UNAUTHORIZED',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5343,'MAIN_START_WEEK',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5344,'MAIN_DEFAULT_WORKING_DAYS',1,'1-5','chaine',0,'','2015-10-03 10:11:33'),(5345,'MAIN_DEFAULT_WORKING_HOURS',1,'9-18','chaine',0,'','2015-10-03 10:11:33'),(5346,'MAIN_SHOW_LOGO',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5347,'MAIN_FIRSTNAME_NAME_POSITION',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5348,'MAIN_THEME',1,'eldy','chaine',0,'','2015-10-03 10:11:33'),(5349,'MAIN_SEARCHFORM_CONTACT',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5351,'MAIN_SEARCHFORM_PRODUITSERVICE',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5352,'MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5353,'MAIN_SEARCHFORM_ADHERENT',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5354,'MAIN_SEARCHFORM_PROJECT',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5355,'MAIN_HELPCENTER_DISABLELINK',0,'1','chaine',0,'','2015-10-03 10:11:33'),(5356,'MAIN_HOME',1,'__(NoteSomeFeaturesAreDisabled)__
        \r\n
        \r\n__(SomeTranslationAreUncomplete)__
        ','chaine',0,'','2015-10-03 10:11:33'),(5357,'MAIN_HELP_DISABLELINK',0,'0','chaine',0,'','2015-10-03 10:11:33'),(5358,'MAIN_BUGTRACK_ENABLELINK',1,'0','chaine',0,'','2015-10-03 10:11:33'),(5359,'THEME_ELDY_USE_HOVER',1,'1','chaine',0,'','2015-10-03 10:11:33'),(5394,'FCKEDITOR_ENABLE_DETAILS',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2015-11-04 15:27:44'),(5395,'FCKEDITOR_ENABLE_USERSIGN',1,'1','yesno',0,'WYSIWIG for user signature','2015-11-04 15:27:44'),(5396,'FCKEDITOR_ENABLE_MAIL',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2015-11-04 15:27:44'),(5398,'CATEGORIE_RECURSIV_ADD',1,'','yesno',0,'Affect parent categories','2015-11-04 15:27:46'),(5403,'MAIN_MODULE_FCKEDITOR',1,'1',NULL,0,NULL,'2015-11-04 15:41:40'),(5404,'MAIN_MODULE_CATEGORIE',1,'1',NULL,0,NULL,'2015-11-04 15:41:43'),(5415,'EXPEDITION_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/shipment','chaine',0,NULL,'2015-11-15 22:38:28'),(5416,'LIVRAISON_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/delivery','chaine',0,NULL,'2015-11-15 22:38:28'),(5419,'MAIN_MODULE_CASHDESK',1,'1',NULL,0,NULL,'2015-11-15 22:38:33'),(5426,'MAIN_MODULE_PROJET',1,'1',NULL,0,NULL,'2015-11-15 22:38:44'),(5427,'PROJECT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/projects','chaine',0,NULL,'2015-11-15 22:38:44'),(5428,'PROJECT_USE_OPPORTUNIES',1,'1','chaine',0,NULL,'2015-11-15 22:38:44'),(5430,'MAIN_MODULE_EXPORT',1,'1',NULL,0,NULL,'2015-11-15 22:38:56'),(5431,'MAIN_MODULE_IMPORT',1,'1',NULL,0,NULL,'2015-11-15 22:38:58'),(5432,'MAIN_MODULE_MAILING',1,'1',NULL,0,NULL,'2015-11-15 22:39:00'),(5434,'EXPENSEREPORT_ADDON_PDF',1,'standard','chaine',0,'Name of manager to build PDF expense reports documents','2015-11-15 22:39:05'),(5435,'MAIN_MODULE_SALARIES',1,'1',NULL,0,NULL,'2015-11-15 22:39:08'),(5436,'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',1,'421','chaine',0,NULL,'2015-11-15 22:39:08'),(5437,'SALARIES_ACCOUNTING_ACCOUNT_CHARGE',1,'641','chaine',0,NULL,'2015-11-15 22:39:08'),(5441,'ADHERENT_ETIQUETTE_TEXT',1,'%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%','texte',0,'Text to print on member address sheets','2015-11-15 22:39:17'),(5443,'MAIN_MODULE_PRELEVEMENT',1,'1',NULL,0,NULL,'2015-11-15 22:39:33'),(5453,'MAIN_MODULE_CONTRAT',1,'1',NULL,0,NULL,'2015-11-15 22:39:52'),(5455,'MAIN_MODULE_FICHEINTER',1,'1',NULL,0,NULL,'2015-11-15 22:39:56'),(5459,'MAIN_MODULE_PAYPAL',1,'1',NULL,0,NULL,'2015-11-15 22:41:02'),(5460,'MAIN_MODULE_MARGIN',1,'1',NULL,0,NULL,'2015-11-15 22:41:47'),(5461,'MAIN_MODULE_MARGIN_TABS_0',1,'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__','chaine',0,NULL,'2015-11-15 22:41:47'),(5462,'MAIN_MODULE_MARGIN_TABS_1',1,'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($object->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__','chaine',0,NULL,'2015-11-15 22:41:47'),(5463,'MAIN_MODULE_PROPALE',1,'1',NULL,0,NULL,'2015-11-15 22:41:47'),(5483,'GENBARCODE_BARCODETYPE_THIRDPARTY',1,'6','chaine',0,'','2016-01-16 15:49:43'),(5484,'PRODUIT_DEFAULT_BARCODE_TYPE',1,'2','chaine',0,'','2016-01-16 15:49:46'),(5539,'PRODUCT_USE_OLD_PATH_FOR_PHOTO',0,'0','chaine',1,'Use old path for products images','2016-01-22 13:34:23'),(5541,'MODULE_GOOGLE_DEBUG',1,'0','chaine',1,'','2016-01-22 13:34:57'),(5586,'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',1,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur les notes de frais impayées','2016-01-22 17:28:18'),(5587,'MAIN_FIX_FOR_BUGGED_MTA',1,'1','chaine',1,'Set constant to fix email ending from PHP with some linux ike system','2016-01-22 17:28:18'),(5590,'MAIN_VERSION_LAST_INSTALL',0,'3.8.3','chaine',0,'Dolibarr version when install','2016-01-22 17:28:42'),(5604,'MAIN_INFO_SOCIETE_LOGO',1,'mybigcompany.png','chaine',0,'','2016-01-22 17:33:49'),(5605,'MAIN_INFO_SOCIETE_LOGO_SMALL',1,'mybigcompany_small.png','chaine',0,'','2016-01-22 17:33:49'),(5606,'MAIN_INFO_SOCIETE_LOGO_MINI',1,'mybigcompany_mini.png','chaine',0,'','2016-01-22 17:33:49'),(5612,'MAIN_ENABLE_LOG_TO_HTML',0,'0','chaine',1,'If this option is set to 1, it is possible to see log output at end of HTML sources by adding paramater logtohtml=1 on URL','2016-03-13 10:54:45'),(5614,'MAIN_SIZE_SHORTLISTE_LIMIT',1,'4','chaine',0,'Longueur maximum des listes courtes (fiche client)','2016-03-13 10:54:46'),(5626,'MAIN_MODULE_SUPPLIERPROPOSAL',1,'1',NULL,0,NULL,'2016-07-30 11:13:20'),(5627,'SUPPLIER_PROPOSAL_ADDON_PDF',1,'aurore','chaine',0,'Name of submodule to generate PDF for supplier quotation request','2016-07-30 11:13:20'),(5628,'SUPPLIER_PROPOSAL_ADDON',1,'mod_supplier_proposal_marbre','chaine',0,'Name of submodule to number supplier quotation request','2016-07-30 11:13:20'),(5629,'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/supplier_proposal','chaine',0,NULL,'2016-07-30 11:13:20'),(5632,'MAIN_MODULE_RESOURCE',1,'1',NULL,0,NULL,'2016-07-30 11:13:32'),(5633,'MAIN_MODULE_API',1,'1',NULL,0,NULL,'2016-07-30 11:13:54'),(5634,'MAIN_MODULE_WEBSERVICES',1,'1',NULL,0,NULL,'2016-07-30 11:13:56'),(5635,'WEBSERVICES_KEY',1,'dolibarrkey','chaine',0,'','2016-07-30 11:14:04'),(5638,'MAIN_MODULE_EXTERNALRSS',1,'1',NULL,0,NULL,'2016-07-30 11:15:04'),(5639,'EXTERNAL_RSS_TITLE_1',1,'Dolibarr.org News','chaine',0,'','2016-07-30 11:15:25'),(5640,'EXTERNAL_RSS_URLRSS_1',1,'https://www.dolibarr.org/rss','chaine',0,'','2016-07-30 11:15:25'),(5642,'SOCIETE_CODECOMPTA_ADDON',1,'mod_codecompta_aquarium','chaine',0,'','2016-07-30 11:16:42'),(5707,'CASHDESK_NO_DECREASE_STOCK',1,'1','chaine',0,'','2016-07-30 13:38:11'),(5708,'MAIN_MODULE_PRODUCTBATCH',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5710,'MAIN_MODULE_STOCK',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5711,'MAIN_MODULE_PRODUCT',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5712,'MAIN_MODULE_EXPEDITION',1,'1',NULL,0,NULL,'2016-07-30 13:38:11'),(5808,'MARGIN_TYPE',1,'costprice','chaine',0,'','2016-07-30 16:32:18'),(5809,'DISPLAY_MARGIN_RATES',1,'1','chaine',0,'','2016-07-30 16:32:20'),(5810,'MAIN_FEATURES_LEVEL',0,'0','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development','2016-07-30 18:36:15'),(5813,'USER_PASSWORD_PATTERN',1,'8;1;1;1;3;1','chaine',0,'','2016-07-31 16:04:58'),(5814,'MAIN_MODULE_EXPENSEREPORT',1,'1',NULL,0,NULL,'2016-07-31 21:14:32'),(5817,'MAIN_SIZE_SHORTLIST_LIMIT',1,'3','chaine',0,'Max length for small lists (tabs)','2016-12-12 10:54:09'),(5830,'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',1,'164','chaine',0,NULL,'2017-01-29 15:11:51'),(5831,'LOAN_ACCOUNTING_ACCOUNT_INSURANCE',1,'6162','chaine',0,NULL,'2017-01-29 15:11:51'),(5833,'ACCOUNTING_EXPORT_SEPARATORCSV',1,',','string',0,NULL,'2017-01-29 15:11:56'),(5834,'ACCOUNTING_ACCOUNT_SUSPENSE',1,'471','chaine',0,NULL,'2017-01-29 15:11:56'),(5835,'ACCOUNTING_SELL_JOURNAL',1,'VTE','chaine',0,NULL,'2017-01-29 15:11:56'),(5836,'ACCOUNTING_PURCHASE_JOURNAL',1,'ACH','chaine',0,NULL,'2017-01-29 15:11:56'),(5837,'ACCOUNTING_SOCIAL_JOURNAL',1,'SOC','chaine',0,NULL,'2017-01-29 15:11:56'),(5838,'ACCOUNTING_MISCELLANEOUS_JOURNAL',1,'OD','chaine',0,NULL,'2017-01-29 15:11:56'),(5839,'ACCOUNTING_ACCOUNT_TRANSFER_CASH',1,'58','chaine',0,NULL,'2017-01-29 15:11:56'),(5840,'CHARTOFACCOUNTS',1,'2','chaine',0,NULL,'2017-01-29 15:11:56'),(5841,'ACCOUNTING_EXPORT_MODELCSV',1,'1','chaine',0,NULL,'2017-01-29 15:11:56'),(5842,'ACCOUNTING_LENGTH_GACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5843,'ACCOUNTING_LENGTH_AACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5844,'ACCOUNTING_LIST_SORT_VENTILATION_TODO',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5845,'ACCOUNTING_LIST_SORT_VENTILATION_DONE',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5846,'ACCOUNTING_EXPORT_DATE',1,'%d%m%Y','chaine',0,NULL,'2017-01-29 15:11:56'),(5847,'ACCOUNTING_EXPENSEREPORT_JOURNAL',1,'ER','chaine',0,NULL,'2017-01-29 15:11:56'),(5848,'ACCOUNTING_EXPORT_FORMAT',1,'csv','chaine',0,NULL,'2017-01-29 15:11:56'),(5853,'MAIN_MODULE_WORKFLOW',1,'1',NULL,0,NULL,'2017-01-29 15:12:12'),(5854,'MAIN_MODULE_NOTIFICATION',1,'1',NULL,0,NULL,'2017-01-29 15:12:35'),(5855,'MAIN_MODULE_OAUTH',1,'1',NULL,0,NULL,'2017-01-29 15:12:41'),(5856,'MAIN_MODULE_PRINTING',1,'1',NULL,0,NULL,'2017-01-29 15:12:44'),(5864,'MAIN_INFO_SOCIETE_TEL',1,'09123123','chaine',0,'','2017-01-29 15:13:51'),(5865,'MAIN_INFO_SOCIETE_FAX',1,'09123124','chaine',0,'','2017-01-29 15:13:51'),(5866,'MAIN_INFO_SOCIETE_MAIL',1,'myemail@mybigcompany.com','chaine',0,'','2017-01-29 15:13:51'),(5867,'MAIN_INFO_SOCIETE_WEB',1,'https://www.dolibarr.org','chaine',0,'','2017-01-29 15:13:51'),(5868,'MAIN_INFO_SOCIETE_NOTE',1,'This is note about my company','chaine',0,'','2017-01-29 15:13:51'),(5869,'MAIN_INFO_SOCIETE_GENCOD',1,'1234567890','chaine',0,'','2017-01-29 15:13:51'),(5870,'MAIN_INFO_SOCIETE_MANAGERS',1,'Zack Zeceo','chaine',0,'','2017-01-29 15:13:51'),(5871,'MAIN_INFO_CAPITAL',1,'10000','chaine',0,'','2017-01-29 15:13:51'),(5872,'MAIN_INFO_SOCIETE_FORME_JURIDIQUE',1,'0','chaine',0,'','2017-01-29 15:13:51'),(5873,'MAIN_INFO_SIREN',1,'123456','chaine',0,'','2017-01-29 15:13:51'),(5874,'MAIN_INFO_TVAINTRA',1,'FR1234567','chaine',0,'','2017-01-29 15:13:51'),(5875,'MAIN_INFO_SOCIETE_OBJECT',1,'A company demo to show how Dolibarr ERP CRM is wonderfull','chaine',0,'','2017-01-29 15:13:51'),(5876,'SOCIETE_FISCAL_MONTH_START',1,'1','chaine',0,'','2017-01-29 15:13:51'),(5877,'FACTURE_TVAOPTION',1,'1','chaine',0,'','2017-01-29 15:13:51'),(5878,'FACTURE_LOCAL_TAX1_OPTION',1,'localtax1on','chaine',0,'','2017-01-29 15:13:51'),(5879,'MAIN_INFO_VALUE_LOCALTAX1',1,'0','chaine',0,'','2017-01-29 15:13:51'),(5880,'MAIN_INFO_LOCALTAX_CALC1',1,'0','chaine',0,'','2017-01-29 15:13:51'),(5883,'MAILING_LIMIT_SENDBYWEB',0,'15','chaine',1,'Number of targets to defined packet size when sending mass email','2017-01-29 17:36:33'),(5884,'MAIN_MAIL_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5885,'MAIN_SOAP_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5887,'PROJECT_USE_OPPORTUNITIES',1,'1','chaine',0,'','2017-02-01 12:23:56'),(5888,'PROJECT_HIDE_TASKS',1,'1','chaine',0,'','2017-02-01 12:23:56'),(5889,'MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5890,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5891,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_REFUSED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5892,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_SIGNED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5893,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLASSIFY_BILLED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5894,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5895,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5896,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5897,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLOSE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5898,'MAIN_AGENDA_ACTIONAUTO_ORDER_CANCEL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5899,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5900,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLASSIFY_BILLED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5901,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5902,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5903,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5904,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5905,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5906,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5907,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_APPROVE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5908,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_RECEIVE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5909,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SUBMIT',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5910,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_REFUSE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5911,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CLASSIFY_BILLED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5912,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5913,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_UNVALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5914,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5915,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_PAYED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5916,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5917,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_CANCELED',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5918,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5919,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_REOPEN',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5920,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5921,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5922,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5923,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5924,'MAIN_AGENDA_ACTIONAUTO_MEMBER_VALIDATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5925,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5926,'MAIN_AGENDA_ACTIONAUTO_MEMBER_MODIFY',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5927,'MAIN_AGENDA_ACTIONAUTO_MEMBER_RESILIATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5928,'MAIN_AGENDA_ACTIONAUTO_MEMBER_DELETE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5929,'MAIN_AGENDA_ACTIONAUTO_PROJECT_CREATE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5930,'MAIN_AGENDA_ACTIONAUTO_PROJECT_DELETE',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5931,'DATABASE_PWD_ENCRYPTED',1,'1','chaine',0,'','2017-02-01 15:06:04'),(5932,'MAIN_DISABLE_ALL_MAILS',1,'0','chaine',0,'','2017-02-01 15:09:09'),(5933,'MAIN_MAIL_SENDMODE',1,'mail','chaine',0,'','2017-02-01 15:09:09'),(5934,'MAIN_MAIL_SMTP_PORT',1,'465','chaine',0,'','2017-02-01 15:09:09'),(5935,'MAIN_MAIL_SMTP_SERVER',1,'smtp.mail.com','chaine',0,'','2017-02-01 15:09:09'),(5936,'MAIN_MAIL_SMTPS_ID',1,'eldy10@mail.com','chaine',0,'','2017-02-01 15:09:09'),(5937,'MAIN_MAIL_SMTPS_PW',1,'bidonge','chaine',0,'','2017-02-01 15:09:09'),(5938,'MAIN_MAIL_EMAIL_FROM',1,'robot@example.com','chaine',0,'','2017-02-01 15:09:09'),(5939,'MAIN_MAIL_DEFAULT_FROMTYPE',1,'user','chaine',0,'','2017-02-01 15:09:09'),(5940,'PRELEVEMENT_ID_BANKACCOUNT',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5941,'PRELEVEMENT_ICS',1,'ICS123456','chaine',0,'','2017-02-06 04:04:47'),(5942,'PRELEVEMENT_USER',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5943,'BANKADDON_PDF',1,'sepamandate','chaine',0,'','2017-02-06 04:13:52'),(5947,'CHEQUERECEIPTS_THYME_MASK',1,'CHK{yy}{mm}-{0000@1}','chaine',0,'','2017-02-06 04:16:27'),(5948,'MAIN_MODULE_LOAN',1,'1',NULL,0,NULL,'2017-02-06 19:19:05'),(5954,'MAIN_SUBMODULE_EXPEDITION',1,'1','chaine',0,'','2017-02-06 23:57:37'),(5963,'MAIN_MODULE_BANQUE',1,'1',NULL,0,NULL,'2017-02-07 18:56:12'),(5964,'MAIN_MODULE_TAX',1,'1',NULL,0,NULL,'2017-02-07 18:56:12'),(5996,'CABINETMED_RHEUMATOLOGY_ON',1,'0','texte',0,'','2017-02-12 19:20:04'),(5999,'MAIN_SEARCHFORM_SOCIETE',1,'1','texte',0,'','2017-02-12 19:20:04'),(6000,'CABINETMED_BANK_PATIENT_REQUIRED',1,'0','texte',0,'','2017-02-12 19:20:04'),(6004,'MAIN_MODULE_MULTICOMPANY_CSS',1,'[\"\\/multicompany\\/css\\/multicompany.css.php\"]','chaine',0,NULL,'2017-02-15 17:17:11'),(6019,'MAIN_INFO_SOCIETE_COUNTRY',2,'1:FR:France','chaine',0,'','2017-02-15 17:18:22'),(6020,'MAIN_INFO_SOCIETE_NOM',2,'MySecondCompany','chaine',0,'','2017-02-15 17:18:22'),(6021,'MAIN_INFO_SOCIETE_STATE',2,'0','chaine',0,'','2017-02-15 17:18:22'),(6022,'MAIN_MONNAIE',2,'EUR','chaine',0,'','2017-02-15 17:18:22'),(6023,'MAIN_LANG_DEFAULT',2,'auto','chaine',0,'','2017-02-15 17:18:22'),(6024,'MAIN_INFO_SOCIETE_COUNTRY',1,'14:CA:Canada','chaine',0,'','2017-02-15 17:18:41'),(6025,'MAIN_INFO_SOCIETE_NOM',1,'MyBigCompany','chaine',0,'','2017-02-15 17:18:41'),(6026,'MAIN_INFO_SOCIETE_ADDRESS',1,'21 Jump street','chaine',0,'','2017-02-15 17:18:41'),(6027,'MAIN_INFO_SOCIETE_TOWN',1,'MyTown','chaine',0,'','2017-02-15 17:18:41'),(6028,'MAIN_INFO_SOCIETE_ZIP',1,'75500','chaine',0,'','2017-02-15 17:18:41'),(6029,'MAIN_INFO_SOCIETE_STATE',1,'1514','chaine',0,'','2017-02-15 17:18:41'),(6030,'MAIN_MONNAIE',1,'EUR','chaine',0,'','2017-02-15 17:18:41'),(6031,'MAIN_LANG_DEFAULT',1,'auto','chaine',0,'','2017-02-15 17:18:41'),(6032,'MAIN_MODULE_MULTICURRENCY',1,'1',NULL,0,NULL,'2017-02-15 17:29:59'),(6047,'MAIN_MODULE_SYSLOG',0,'1',NULL,0,NULL,'2017-02-15 22:36:58'),(6048,'SYSLOG_FACILITY',0,'LOG_USER','chaine',0,'','2017-02-15 22:37:01'),(6049,'SYSLOG_FIREPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/firephp/firephp-core/lib/','chaine',0,'','2017-02-15 22:37:01'),(6050,'SYSLOG_FILE',0,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2017-02-15 22:37:01'),(6051,'SYSLOG_CHROMEPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/ccampbell/chromephp/','chaine',0,'','2017-02-15 22:37:01'),(6052,'SYSLOG_HANDLERS',0,'[\"mod_syslog_file\"]','chaine',0,'','2017-02-15 22:37:01'),(6054,'SYSLOG_LEVEL',0,'7','chaine',0,'','2017-02-15 22:37:21'),(6074,'CABINETMED_DELAY_TO_LOCK_RECORD',1,'','chaine',1,'Number of days before locking edit of consultation','2017-02-21 00:04:15'),(6092,'MAIN_SIZE_SHORTLIST_LIMIT',0,'3','chaine',0,'Max length for small lists (tabs)','2017-05-12 09:02:38'),(6099,'MAIN_MODULE_SKYPE',1,'1',NULL,0,NULL,'2017-05-12 09:03:51'),(6100,'MAIN_MODULE_GRAVATAR',1,'1',NULL,0,NULL,'2017-05-12 09:03:54'),(6101,'MAIN_MODULE_ACCOUNTING',1,'1',NULL,0,NULL,'2017-05-12 09:14:30'),(6102,'PRODUCT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/products','chaine',0,'','2017-08-27 13:29:07'),(6103,'CONTRACT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/contracts','chaine',0,'','2017-08-27 13:29:07'),(6104,'USERGROUP_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/usergroups','chaine',0,'','2017-08-27 13:29:07'),(6105,'USER_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/users','chaine',0,'','2017-08-27 13:29:07'),(6106,'MAIN_ENABLE_OVERWRITE_TRANSLATION',1,'1','chaine',0,'Enable overwrote of translation','2017-08-27 13:29:07'),(6107,'MAIN_MODULE_AGENDA',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6108,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6109,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_CLASSIFY_BILLED',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6110,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_CLASSIFY_UNBILLED',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6111,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6112,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_MODIFY',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6113,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_DELETE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6114,'MAIN_AGENDA_ACTIONAUTO_PROJECT_MODIFY',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6115,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6116,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_VALIDATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6117,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_APPROVE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6118,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_PAYED',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6119,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_CREATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6120,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_VALIDATE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6121,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_APPROVE',1,'1','chaine',0,NULL,'2017-08-27 13:29:14'),(6122,'MAIN_MODULE_BARCODE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6123,'MAIN_MODULE_CRON',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6124,'MAIN_MODULE_COMMANDE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6125,'MAIN_MODULE_DON',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6126,'MAIN_MODULE_ECM',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6127,'MAIN_MODULE_FACTURE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6128,'MAIN_MODULE_FOURNISSEUR',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6129,'MAIN_MODULE_HOLIDAY',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6130,'MAIN_MODULE_HOLIDAY_TABS_0',1,'user:+paidholidays:CPTitreMenu:holiday:$user->rights->holiday->read:/holiday/list.php?mainmenu=hrm&id=__ID__','chaine',0,NULL,'2017-08-27 13:29:14'),(6131,'MAIN_MODULE_OPENSURVEY',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6132,'MAIN_MODULE_SOCIETE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6133,'MAIN_MODULE_SERVICE',1,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6134,'MAIN_MODULE_USER',0,'1',NULL,0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2017-08-27 13:29:14'),(6135,'MAIN_VERSION_LAST_UPGRADE',0,'6.0.0','chaine',0,'Dolibarr version for last upgrade','2017-08-27 13:29:15'); +/*!40000 ALTER TABLE `llx_const` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contrat` +-- + +DROP TABLE IF EXISTS `llx_contrat`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contrat` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_supplier` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_contrat` datetime DEFAULT NULL, + `statut` smallint(6) DEFAULT '0', + `mise_en_service` datetime DEFAULT NULL, + `fin_validite` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_commercial_signature` int(11) DEFAULT NULL, + `fk_commercial_suivi` int(11) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL DEFAULT '0', + `fk_user_mise_en_service` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `ref_customer` varchar(30) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_contrat_ref` (`ref`,`entity`), + KEY `idx_contrat_fk_soc` (`fk_soc`), + KEY `idx_contrat_fk_user_author` (`fk_user_author`), + CONSTRAINT `fk_contrat_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_contrat_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contrat` +-- + +LOCK TABLES `llx_contrat` WRITE; +/*!40000 ALTER TABLE `llx_contrat` DISABLE KEYS */; +INSERT INTO `llx_contrat` VALUES (1,'CONTRACT1',NULL,NULL,1,'2010-07-08 23:53:55','2010-07-09 01:53:25','2010-07-09 00:00:00',1,NULL,NULL,NULL,3,NULL,2,2,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'CONTRAT1',NULL,NULL,1,'2010-07-10 16:18:16','2010-07-10 18:13:37','2010-07-10 00:00:00',1,NULL,NULL,NULL,2,NULL,2,2,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'CT1303-0001',NULL,NULL,1,'2013-03-06 09:05:07','2013-03-06 10:04:57','2013-03-06 00:00:00',1,NULL,NULL,NULL,19,NULL,1,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_contrat` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contrat_extrafields` +-- + +DROP TABLE IF EXISTS `llx_contrat_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contrat_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_contrat_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contrat_extrafields` +-- + +LOCK TABLES `llx_contrat_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_contrat_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contrat_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet` +-- + +DROP TABLE IF EXISTS `llx_contratdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_contrat` int(11) NOT NULL, + `fk_product` int(11) DEFAULT NULL, + `statut` smallint(6) DEFAULT '0', + `label` text, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `date_commande` datetime DEFAULT NULL, + `date_ouverture_prevue` datetime DEFAULT NULL, + `date_ouverture` datetime DEFAULT NULL, + `date_fin_validite` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double NOT NULL, + `remise_percent` double DEFAULT '0', + `subprice` double(24,8) DEFAULT '0.00000000', + `price_ht` double DEFAULT NULL, + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '1', + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_user_author` int(11) NOT NULL DEFAULT '0', + `fk_user_ouverture` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `commentaire` text, + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_fk_contrat` (`fk_contrat`), + KEY `idx_contratdet_fk_product` (`fk_product`), + KEY `idx_contratdet_date_ouverture_prevue` (`date_ouverture_prevue`), + KEY `idx_contratdet_date_ouverture` (`date_ouverture`), + KEY `idx_contratdet_date_fin_validite` (`date_fin_validite`), + KEY `fk_contratdet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_contratdet_fk_contrat` FOREIGN KEY (`fk_contrat`) REFERENCES `llx_contrat` (`rowid`), + CONSTRAINT `fk_contratdet_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_contratdet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet` +-- + +LOCK TABLES `llx_contratdet` WRITE; +/*!40000 ALTER TABLE `llx_contratdet` DISABLE KEYS */; +INSERT INTO `llx_contratdet` VALUES (1,'2013-03-06 09:00:00',1,3,4,'','',NULL,NULL,'2010-07-09 00:00:00','2010-07-09 12:00:00','2013-03-15 00:00:00',NULL,0.000,'',0.000,'',0.000,'',1,0,0.00000000,0,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,0,0,0.00000000,0,1,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,'2010-07-10 16:14:14',2,NULL,0,'','Abonnement annuel assurance',NULL,NULL,'2010-07-10 00:00:00',NULL,'2011-07-10 00:00:00',NULL,1.000,'',0.000,'',0.000,'',1,0,10.00000000,10,0,10.00000000,0.10000000,0.00000000,0.00000000,10.10000000,1,0,NULL,0.00000000,0,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,'2013-03-05 10:20:58',2,3,5,'','gdfg',NULL,NULL,'2010-07-10 00:00:00','2010-07-10 12:00:00','2011-07-09 00:00:00','2013-03-06 12:00:00',4.000,'',0.000,'',0.000,'',1,0,0.00000000,0,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,1,0,0,0.00000000,0,1,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,'2012-12-08 13:11:17',2,3,0,'','',NULL,NULL,'2010-07-10 00:00:00',NULL,NULL,NULL,0.000,'',0.000,'',0.000,'',1,10,40.00000000,40,NULL,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,0,NULL,0.00000000,0,NULL,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(5,'2013-03-06 09:05:40',3,NULL,4,'','gfdg',NULL,NULL,NULL,'2013-03-06 12:00:00','2013-03-07 12:00:00',NULL,0.000,'',0.000,'',0.000,'',1,0,10.00000000,10,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,0,0,0.00000000,0,1,1,'',NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_contratdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_contratdet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet_extrafields` +-- + +LOCK TABLES `llx_contratdet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_contratdet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contratdet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_contratdet_log` +-- + +DROP TABLE IF EXISTS `llx_contratdet_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_contratdet_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_contratdet` int(11) NOT NULL, + `date` datetime NOT NULL, + `statut` smallint(6) NOT NULL, + `fk_user_author` int(11) NOT NULL, + `commentaire` text, + PRIMARY KEY (`rowid`), + KEY `idx_contratdet_log_fk_contratdet` (`fk_contratdet`), + KEY `idx_contratdet_log_date` (`date`), + CONSTRAINT `fk_contratdet_log_fk_contratdet` FOREIGN KEY (`fk_contratdet`) REFERENCES `llx_contratdet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_contratdet_log` +-- + +LOCK TABLES `llx_contratdet_log` WRITE; +/*!40000 ALTER TABLE `llx_contratdet_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_contratdet_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cotisation` +-- + +DROP TABLE IF EXISTS `llx_cotisation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cotisation` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `dateadh` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `cotisation` double DEFAULT NULL, + `fk_bank` int(11) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_cotisation` (`fk_adherent`,`dateadh`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cotisation` +-- + +LOCK TABLES `llx_cotisation` WRITE; +/*!40000 ALTER TABLE `llx_cotisation` DISABLE KEYS */; +INSERT INTO `llx_cotisation` VALUES (1,'2010-07-10 13:05:30','2010-07-10 15:05:30',2,'2010-07-10 00:00:00','2011-07-10',20,NULL,'Adhésion/cotisation 2010'),(2,'2010-07-11 14:20:00','2010-07-11 16:20:00',2,'2011-07-11 00:00:00','2012-07-10',10,NULL,'Adhésion/cotisation 2011'),(3,'2010-07-18 10:20:33','2010-07-18 12:20:33',2,'2012-07-11 00:00:00','2013-07-17',10,NULL,'Adhésion/cotisation 2012'),(4,'2013-03-06 15:43:37','2013-03-06 16:43:37',2,'2013-07-18 00:00:00','2014-07-17',10,NULL,'Adhésion/cotisation 2013'),(5,'2013-03-06 15:44:12','2013-03-06 16:44:12',2,'2014-07-18 00:00:00','2015-07-17',11,NULL,'Adhésion/cotisation 2014'),(6,'2013-03-06 15:47:48','2013-03-06 16:47:48',2,'2015-07-18 00:00:00','2016-07-17',10,NULL,'Adhésion/cotisation 2015'),(7,'2013-03-06 15:48:16','2013-03-06 16:48:16',2,'2016-07-18 00:00:00','2017-07-17',20,22,'Adhésion/cotisation 2016'),(8,'2013-03-20 13:17:57','2013-03-20 14:17:57',1,'2010-07-10 00:00:00','2011-07-09',10,NULL,'Adhésion/cotisation 2010'),(10,'2013-03-20 13:30:11','2013-03-20 14:30:11',1,'2011-07-10 00:00:00','2012-07-09',10,23,'Adhésion/cotisation 2011'); +/*!40000 ALTER TABLE `llx_cotisation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_cronjob` +-- + +DROP TABLE IF EXISTS `llx_cronjob`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_cronjob` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `jobtype` varchar(10) NOT NULL, + `label` text NOT NULL, + `command` varchar(255) DEFAULT NULL, + `classesname` varchar(255) DEFAULT NULL, + `objectname` varchar(255) DEFAULT NULL, + `methodename` varchar(255) DEFAULT NULL, + `params` text, + `md5params` varchar(32) DEFAULT NULL, + `module_name` varchar(255) DEFAULT NULL, + `priority` int(11) DEFAULT '0', + `datelastrun` datetime DEFAULT NULL, + `datenextrun` datetime DEFAULT NULL, + `datestart` datetime DEFAULT NULL, + `dateend` datetime DEFAULT NULL, + `datelastresult` datetime DEFAULT NULL, + `lastresult` text, + `lastoutput` text, + `unitfrequency` varchar(255) NOT NULL DEFAULT '3600', + `frequency` int(11) NOT NULL DEFAULT '0', + `nbrun` int(11) DEFAULT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `note` text, + `libname` varchar(255) DEFAULT NULL, + `entity` int(11) DEFAULT '0', + `maxrun` int(11) NOT NULL DEFAULT '0', + `autodelete` int(11) DEFAULT '0', + `fk_mailing` int(11) DEFAULT NULL, + `test` varchar(255) DEFAULT '1', + `processing` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_cronjob` +-- + +LOCK TABLES `llx_cronjob` WRITE; +/*!40000 ALTER TABLE `llx_cronjob` DISABLE KEYS */; +INSERT INTO `llx_cronjob` VALUES (1,'2013-03-23 18:18:39','2013-03-23 19:18:39','command','aaa','aaaa','','','','','','',0,NULL,NULL,'2013-03-23 19:18:00',NULL,NULL,NULL,NULL,'3600',3600,0,0,1,1,'',NULL,0,0,0,NULL,'1',0),(22,'2017-08-27 13:29:14','2017-08-27 17:29:14','method','PurgeDeleteTemporaryFilesShort',NULL,'core/class/utils.class.php','Utils','purgeFiles',NULL,NULL,'cron',10,NULL,NULL,'2017-08-27 17:29:14',NULL,NULL,NULL,NULL,'604800',2,NULL,1,NULL,NULL,'PurgeDeleteTemporaryFiles',NULL,1,0,0,NULL,'1',0),(23,'2017-08-27 13:29:14','2017-08-27 17:29:14','method','MakeLocalDatabaseDumpShort',NULL,'core/class/utils.class.php','Utils','dumpDatabase','none,auto,1,auto,10',NULL,'cron',20,NULL,NULL,'2017-08-27 17:29:14',NULL,NULL,NULL,NULL,'604800',1,NULL,0,NULL,NULL,'MakeLocalDatabaseDump',NULL,1,0,0,NULL,'1',0),(24,'2017-08-27 13:29:14','2017-08-27 17:29:14','method','RecurringInvoices',NULL,'compta/facture/class/facture-rec.class.php','FactureRec','createRecurringInvoices',NULL,NULL,'facture',0,NULL,NULL,'2017-08-27 17:29:14',NULL,NULL,NULL,NULL,'86400',1,NULL,1,NULL,NULL,'Generate recurring invoices',NULL,1,0,0,NULL,'',0); +/*!40000 ALTER TABLE `llx_cronjob` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_default_values` +-- + +DROP TABLE IF EXISTS `llx_default_values`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_default_values` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `type` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, + `user_id` int(11) NOT NULL DEFAULT '0', + `page` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `param` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `value` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_default_values` (`type`,`entity`,`user_id`,`page`,`param`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_default_values` +-- + +LOCK TABLES `llx_default_values` WRITE; +/*!40000 ALTER TABLE `llx_default_values` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_default_values` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_deplacement` +-- + +DROP TABLE IF EXISTS `llx_deplacement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_deplacement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dated` datetime DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `type` varchar(12) NOT NULL, + `fk_statut` int(11) NOT NULL DEFAULT '1', + `km` double DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT '0', + `note_private` text, + `note_public` text, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_deplacement` +-- + +LOCK TABLES `llx_deplacement` WRITE; +/*!40000 ALTER TABLE `llx_deplacement` DISABLE KEYS */; +INSERT INTO `llx_deplacement` VALUES (1,NULL,1,'2010-07-09 01:58:04','2010-07-08 23:58:18','2010-07-09 12:00:00',2,1,NULL,'TF_LUNCH',1,10,2,1,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_deplacement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_document_model` +-- + +DROP TABLE IF EXISTS `llx_document_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_document_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `type` varchar(20) NOT NULL, + `libelle` varchar(255) DEFAULT NULL, + `description` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_document_model` (`nom`,`type`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=290 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_document_model` +-- + +LOCK TABLES `llx_document_model` WRITE; +/*!40000 ALTER TABLE `llx_document_model` DISABLE KEYS */; +INSERT INTO `llx_document_model` VALUES (9,'merou',1,'shipping',NULL,NULL),(15,'fsfe.fr.php',1,'donation',NULL,NULL),(181,'generic_invoice_odt',1,'invoice','ODT templates','FACTURE_ADDON_PDF_ODT_PATH'),(193,'canelle2',1,'invoice_supplier','canelle2',NULL),(195,'canelle',1,'invoice_supplier','canelle',NULL),(198,'azur',2,'propal',NULL,NULL),(199,'html_cerfafr',2,'donation',NULL,NULL),(200,'crabe',2,'invoice',NULL,NULL),(201,'generic_odt',1,'company','ODT templates','COMPANY_ADDON_PDF_ODT_PATH'),(250,'baleine',1,'project',NULL,NULL),(255,'soleil',1,'ficheinter',NULL,NULL),(256,'azur',1,'propal',NULL,NULL),(270,'aurore',1,'supplier_proposal',NULL,NULL),(273,'beluga',1,'project','beluga',NULL),(274,'rouget',1,'shipping',NULL,NULL),(275,'typhon',1,'delivery',NULL,NULL),(278,'standard',1,'expensereport',NULL,NULL),(281,'sepamandate',1,'bankaccount','sepamandate',NULL),(286,'einstein',1,'order',NULL,NULL),(287,'html_cerfafr',1,'donation',NULL,NULL),(288,'crabe',1,'invoice',NULL,NULL),(289,'muscadet',1,'order_supplier',NULL,NULL); +/*!40000 ALTER TABLE `llx_document_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_don` +-- + +DROP TABLE IF EXISTS `llx_don`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_don` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `datec` datetime DEFAULT NULL, + `datedon` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_payment` int(11) DEFAULT NULL, + `paid` smallint(6) NOT NULL DEFAULT '0', + `firstname` varchar(50) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `societe` varchar(50) DEFAULT NULL, + `address` text, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `country` varchar(50) DEFAULT NULL, + `fk_country` int(11) NOT NULL, + `email` varchar(255) DEFAULT NULL, + `phone` varchar(24) DEFAULT NULL, + `phone_mobile` varchar(24) DEFAULT NULL, + `public` smallint(6) NOT NULL DEFAULT '1', + `fk_projet` int(11) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_don` +-- + +LOCK TABLES `llx_don` WRITE; +/*!40000 ALTER TABLE `llx_don` DISABLE KEYS */; +INSERT INTO `llx_don` VALUES (1,NULL,1,'2010-07-08 23:57:17',1,'2010-07-09 01:55:33','2010-07-09 12:00:00',10,1,0,'Donator','','Guest company','','','','France',0,'',NULL,NULL,1,1,1,1,'',NULL,'html_cerfafr',NULL,NULL),(2,NULL,1,'2017-02-06 04:05:29',0,'2017-02-06 08:05:29','2017-02-06 12:00:00',100,NULL,0,'','','','','','',NULL,0,'','','',1,NULL,12,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_don` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_don_extrafields` +-- + +DROP TABLE IF EXISTS `llx_don_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_don_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_don_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_don_extrafields` +-- + +LOCK TABLES `llx_don_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_don_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_don_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecm_directories` +-- + +DROP TABLE IF EXISTS `llx_ecm_directories`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecm_directories` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_parent` int(11) DEFAULT NULL, + `description` varchar(255) NOT NULL, + `cachenbofdoc` int(11) NOT NULL DEFAULT '0', + `fullpath` varchar(750) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_c` datetime DEFAULT NULL, + `date_m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_c` int(11) DEFAULT NULL, + `fk_user_m` int(11) DEFAULT NULL, + `acl` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ecm_directories` (`label`,`fk_parent`,`entity`), + KEY `idx_ecm_directories_fk_user_c` (`fk_user_c`), + KEY `idx_ecm_directories_fk_user_m` (`fk_user_m`), + CONSTRAINT `fk_ecm_directories_fk_user_c` FOREIGN KEY (`fk_user_c`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_ecm_directories_fk_user_m` FOREIGN KEY (`fk_user_m`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecm_directories` +-- + +LOCK TABLES `llx_ecm_directories` WRITE; +/*!40000 ALTER TABLE `llx_ecm_directories` DISABLE KEYS */; +INSERT INTO `llx_ecm_directories` VALUES (8,'Administrative documents',1,0,'Directory to store administrative contacts',0,NULL,NULL,'2016-07-30 16:54:41','2016-07-30 12:54:41',12,NULL,NULL),(9,'Images',1,0,'',34,NULL,NULL,'2016-07-30 16:55:33','2016-07-30 13:24:41',12,NULL,NULL); +/*!40000 ALTER TABLE `llx_ecm_directories` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecm_files` +-- + +DROP TABLE IF EXISTS `llx_ecm_files`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecm_files` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(128) DEFAULT NULL, + `label` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `filename` varchar(255) NOT NULL, + `filepath` varchar(255) DEFAULT NULL, + `fullpath_orig` varchar(750) DEFAULT NULL, + `description` text, + `keywords` text, + `cover` text, + `gen_or_uploaded` varchar(12) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `date_c` datetime DEFAULT NULL, + `date_m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_c` int(11) DEFAULT NULL, + `fk_user_m` int(11) DEFAULT NULL, + `acl` text, + `position` int(11) DEFAULT NULL, + `keyword` varchar(750) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ecm_files` (`filepath`,`filename`,`entity`), + KEY `idx_ecm_files_label` (`label`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecm_files` +-- + +LOCK TABLES `llx_ecm_files` WRITE; +/*!40000 ALTER TABLE `llx_ecm_files` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_ecm_files` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_ecommerce_category` +-- + +DROP TABLE IF EXISTS `llx_ecommerce_category`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_ecommerce_category` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `type` tinyint(4) NOT NULL DEFAULT '1', + `description` text COLLATE utf8_unicode_ci, + `fk_category` int(11) NOT NULL, + `fk_site` int(11) NOT NULL, + `remote_id` int(11) NOT NULL, + `remote_parent_id` int(11) DEFAULT NULL, + `last_update` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_ecommerce_category_fk_site_fk_category` (`fk_site`,`fk_category`), + KEY `idx_ecommerce_category_fk_category` (`fk_category`), + KEY `idx_ecommerce_category_fk_site` (`fk_site`) +) ENGINE=InnoDB AUTO_INCREMENT=2260 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table transition remote site - Dolibarr'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_ecommerce_category` +-- + +LOCK TABLES `llx_ecommerce_category` WRITE; +/*!40000 ALTER TABLE `llx_ecommerce_category` DISABLE KEYS */; +INSERT INTO `llx_ecommerce_category` VALUES (1951,'Root Catalog',0,'',1750,1,3,1,'2007-12-05 04:38:59'),(1952,'Parquets',0,'',1751,1,35,3,'2016-01-19 09:35:20'),(1953,'Parquets massifs exotiques',0,'',1752,1,36,35,'2016-01-19 09:35:44'),(1954,'Parquets massifs salle de bain',0,'',1753,1,135,35,'2016-01-19 09:36:03'),(1955,'Parquets massifs bruts',0,'',1754,1,43,35,'2016-01-19 09:36:24'),(1956,'Parquets massifs naturels',0,'',1755,1,46,35,'2016-01-19 09:36:47'),(1957,'Parquets massifs tendances',0,'',1756,1,136,35,'2016-01-19 09:37:04'),(1958,'Parquets massifs vieillis',0,'',1757,1,227,35,'2016-01-19 09:37:23'),(1959,'Parquets contrecollés classiques',0,'',1758,1,51,35,'2016-01-19 09:37:49'),(1960,'Parquets contrecollés tendance',0,'',1759,1,54,35,'2016-01-19 09:38:09'),(1961,'Parquets contrecollés sols chauffants & rafraîchissants',0,'',1760,1,57,35,'2016-01-19 09:38:35'),(1962,'Parquets contrecollés vieillis',0,'',1761,1,279,35,'2016-01-19 09:38:57'),(1963,'Terrasses',0,'',1762,1,80,3,'2017-03-15 09:46:37'),(1964,'Lames terrasse Bois Exotique',0,'',1763,1,81,80,'2017-03-15 15:34:21'),(1965,'Ipé',0,'',1764,1,461,81,'2017-03-15 09:55:42'),(1966,'Cumaru',0,'',1765,1,462,81,'2017-03-15 09:57:55'),(1967,'Terrasses bois français',0,'',1766,1,84,80,'2015-10-07 15:51:30'),(1968,'Lames Terrasse Bois Composite',0,'',1767,1,86,80,'2017-03-15 14:33:51'),(1969,'Lames Bois Composite',0,'',1768,1,463,86,'2017-03-15 10:24:30'),(1970,'Fixations Lames Composites',0,'',1769,1,464,86,'2017-03-15 10:26:53'),(1971,'Accessoires terrasses',0,'',1770,1,286,80,'2017-03-15 10:58:40'),(1972,'FORET ÉTAGÉ SPAX',0,'',1771,1,396,286,'2017-03-15 10:57:07'),(1973,'CALES ET FEUTRES POUR LAMBOURDE',0,'',1772,1,459,286,'2017-03-15 10:55:50'),(1974,'Feutre Géotextile',0,'',1773,1,466,80,'2017-03-20 15:15:32'),(1975,'Cales pour Lambourdes',0,'',1774,1,394,80,'2017-03-16 13:47:30'),(1976,'Lambourdes Pour Terrasse',0,'',1775,1,465,80,'2017-03-15 10:36:30'),(1977,'Vis Terrasse Inox SPAX',0,'',1776,1,366,80,'2017-03-15 14:26:33'),(1978,'Fixations Terrasse',0,'',1777,1,365,80,'2017-03-20 09:18:10'),(1979,'Plots Pour Terrasse',0,'',1778,1,367,80,'2017-03-16 13:09:09'),(1980,'Redresseur De Lames',0,'',1779,1,368,80,'2017-03-16 13:26:27'),(1981,'Espaceur et gabarit',0,'',1780,1,370,80,'2017-03-16 13:37:38'),(1982,'Forets et Embouts',0,'',1781,1,369,80,'2017-03-16 13:53:06'),(1983,'BANDE D\'ÉTANCHÉITÉ',0,'',1782,1,395,80,'2017-03-15 14:15:22'),(1984,'Luminaires extérieurs terrasses et jardins',0,'',1783,1,290,80,'2017-03-16 13:58:11'),(1985,'ÉCLAIRAGE Á POSER AU SOL',0,'',1784,1,374,290,'2017-03-15 10:59:39'),(1986,'ÉCLAIRAGE MURAL',0,'',1785,1,375,290,'2017-03-15 10:59:44'),(1987,'ÉCLAIRAGE D\'ORIENTATION',0,'',1786,1,376,290,'2017-03-15 11:00:02'),(1988,'Eclairage Design Collection',0,'',1787,1,377,290,'2015-03-05 18:25:35'),(1989,'SPOTS',0,'',1788,1,378,290,'2017-03-15 11:00:08'),(1990,'TRANSFORMATEURS',0,'',1789,1,372,290,'2017-03-15 11:00:14'),(1991,'CÂBLES ET RALLONGES',0,'',1790,1,373,290,'2017-03-15 11:00:24'),(1992,'PROGRAMMATEURS, DÉTECTEURS, TÉLÉCOMMANDES',0,'',1791,1,379,290,'2017-03-15 11:00:31'),(1993,'Revêtements sol & mur',0,'',1792,1,60,3,'2017-02-01 10:13:13'),(1994,'Dalles (cuir, béton ciré...)',0,'',1793,1,63,60,'2017-02-01 13:50:13'),(1995,'Dalles/lames plombantes',0,'',1794,1,401,60,'2017-02-01 13:50:20'),(1996,'Sols en bois',0,'',1795,1,61,60,'2017-02-01 13:50:59'),(1997,'Sols en liège',0,'',1796,1,294,60,'2017-02-01 13:50:52'),(1998,'Stratifiés classiques',0,'',1797,1,68,60,'2016-01-18 17:43:44'),(1999,'Stratifiés tendances',0,'',1798,1,72,60,'2016-01-18 17:44:37'),(2000,'Stratifiés salles de bain',0,'',1799,1,76,60,'2016-01-18 17:45:57'),(2001,'Stratifiés économiques',0,'',1800,1,78,60,'2016-01-18 17:45:32'),(2002,'Stratifiés colle intégrée',0,'',1801,1,421,60,'2016-03-24 10:36:21'),(2003,'Vinyles Click',0,'',1802,1,400,60,'2016-01-18 17:46:15'),(2004,'Vinyles',0,'',1803,1,283,60,'2015-10-29 16:09:39'),(2005,'Lambris',0,'',1804,1,89,60,'2017-02-01 10:13:57'),(2006,'Lambris massifs pin',0,'',1805,1,90,89,'2017-02-01 10:15:07'),(2007,'Accessoires lambris',0,'',1806,1,302,89,'2017-02-01 10:15:13'),(2008,'Entretien',0,'',1807,1,323,3,'2016-01-18 17:08:34'),(2009,'Toutes surfaces',0,'',1808,1,335,323,'2016-03-31 12:14:59'),(2010,'Parquet ciré',0,'',1809,1,359,323,'2016-03-31 12:21:35'),(2011,'Parquet huilé',0,'',1810,1,337,323,'2016-03-31 12:26:55'),(2012,'Parquet vitrifié',0,'',1811,1,339,323,'2016-03-31 12:31:26'),(2013,'Sols stratifié - Vinyl',0,'',1812,1,340,323,'2016-03-31 12:40:36'),(2014,'Terrasse',0,'',1813,1,341,323,'2016-01-18 17:10:11'),(2015,'SATURATEURS ENVIRONNEMENT',0,'',1814,1,342,341,'2017-02-01 14:30:22'),(2016,'SATURATEURS BOIS',0,'',1815,1,343,341,'2017-02-01 14:30:30'),(2017,'SATURATEURS MONOCOUCHE',0,'',1816,1,344,341,'2017-02-01 14:30:41'),(2018,'SATURATEURS OPAQUES',0,'',1817,1,345,341,'2017-02-01 14:33:53'),(2019,'NETTOYANTS - DÉGRISEURS',0,'',1818,1,346,341,'2017-02-01 14:31:20'),(2020,'RÉNOVATEURS COMPOSITES',0,'',1819,1,347,341,'2017-02-01 14:31:33'),(2021,'SYSTÈME ANTI UV',0,'',1820,1,348,341,'2017-02-01 14:32:02'),(2022,'Bardage',0,'',1821,1,349,323,'2016-01-18 17:20:26'),(2023,'HUILES BARDAGES',0,'',1822,1,350,349,'2017-02-01 14:32:18'),(2024,'LASURES OPTEM',0,'',1823,1,352,349,'2017-02-01 14:32:25'),(2025,'LASURES HPS',0,'',1824,1,353,349,'2017-02-01 14:32:32'),(2026,'LASURES ENVIRONNEMENT',0,'',1825,1,354,349,'2017-02-01 14:32:42'),(2027,'PEINTURES ENVIRONNEMENT',0,'',1826,1,355,349,'2017-02-01 14:32:51'),(2028,'SYSTÈME ANTI UV BARDAGE',0,'',1827,1,356,349,'2017-07-04 22:36:49'),(2029,'HUILES POUR TECK',0,'',1828,1,413,349,'2017-02-01 14:33:13'),(2030,'Décapants',0,'',1829,1,357,323,'2016-03-31 12:46:26'),(2031,'Décireurs',0,'',1830,1,361,323,'2016-03-31 12:52:31'),(2032,'Traitements',0,'',1831,1,358,323,'2016-03-31 12:54:22'),(2033,'Pose',0,'',1832,1,128,3,'2015-01-22 14:40:40'),(2034,'Finition',0,'',1833,1,319,3,'2016-01-18 17:25:47'),(2035,'HUILES POUR PARQUETS',0,'',1834,1,239,319,'2017-02-01 13:54:09'),(2036,'HUILES ENVIRONNEMENT',0,'',1835,1,334,239,'2017-02-01 13:55:03'),(2037,'HUILES CIRE',0,'',1836,1,241,239,'2017-02-01 13:55:42'),(2038,'HUILES TRADITIONNELLES',0,'',1837,1,321,239,'2017-02-01 13:55:53'),(2039,'HUILES DURES',0,'',1838,1,322,239,'2017-02-01 13:56:00'),(2040,'LASURES',0,'',1839,1,255,319,'2017-02-01 13:54:17'),(2041,'PEINTURES ENVIRONNEMENT LASURE',0,'',1840,1,325,255,'2017-07-04 22:37:25'),(2042,'LASURES BOIS ENVIRONNEMENT',0,'',1841,1,326,255,'2017-02-01 13:56:35'),(2043,'LASURES OPTEM',0,'',1842,1,327,255,'2017-02-01 13:56:42'),(2044,'LASURES TRADITIONNELLES',0,'',1843,1,328,255,'2017-02-01 13:56:51'),(2045,'PRÉPARATION BOIS EXTERIEUR',0,'',1844,1,329,255,'2017-02-01 13:57:12'),(2046,'VITRIFICATEURS',0,'',1845,1,240,319,'2017-02-01 13:54:27'),(2047,'VITRIFICATEURS TRADITIONNELS',0,'',1846,1,330,240,'2017-02-01 13:57:45'),(2048,'VITRIFICATEURS ENVIRONNEMENT',0,'',1847,1,331,240,'2017-02-01 13:58:00'),(2049,'VITRIFICATEURS OCÉANIC®',0,'',1848,1,332,240,'2017-02-01 13:59:10'),(2050,'VITRIFICATEURS ESCALIERS',0,'',1849,1,333,240,'2017-02-01 13:59:40'),(2051,'VITRIFICATEURS BI COMPOSANTS',0,'',1850,1,404,240,'2017-02-01 13:59:51'),(2052,'Béton - Pavés briques',0,'',1851,1,300,319,'2016-03-25 09:44:34'),(2053,'Peintures sol',0,'',1852,1,271,319,'2016-03-25 09:47:36'),(2054,'Peintures tableau d\'école',0,'',1853,1,360,319,'2016-03-25 09:59:01'),(2055,'Peinture décorative aqua',0,'',1854,1,426,319,'2016-03-25 10:08:28'),(2056,'Primaire fond dur',0,'',1855,1,320,319,'2016-03-25 10:10:34'),(2057,'Teintes parquets - boiseries',0,'',1856,1,324,319,'2016-03-25 10:14:55'),(2058,'Vernis bois',0,'',1857,1,296,319,'2016-03-25 10:16:20'),(2059,'Parquet ciré',0,'',1858,1,414,319,'2016-03-31 12:57:15'),(2060,'Peinture rénovation multi supports',0,'',1859,1,435,319,'2016-10-17 15:33:29'),(2061,'Accessoires disabled',0,'',1860,1,98,3,'2017-07-04 23:32:02'),(2062,'Produits de finitions',0,'',1861,1,108,98,'2015-01-21 11:05:10'),(2063,'Ventes flash',0,'',1862,1,129,3,'2017-02-17 11:21:37'),(2064,'Marques',0,'',1863,1,151,3,'2015-10-16 09:15:18'),(2065,'Blanchon',0,'',1864,1,161,151,'2015-12-14 17:42:03'),(2066,'Colles',0,'',1865,1,263,161,'2015-10-14 17:04:55'),(2067,'Décapants',0,'',1866,1,268,161,'2016-01-18 14:33:19'),(2068,'Décireurs',0,'',1867,1,303,161,'2016-01-18 14:33:39'),(2069,'Dégriseurs bois',0,'',1868,1,250,161,'2016-01-18 14:34:12'),(2070,'Diluants',0,'',1869,1,298,161,'2016-01-22 15:03:39'),(2071,'Encaustique et Cire',0,'',1870,1,416,161,'2016-01-21 09:21:28'),(2072,'Fonds durs',0,'',1871,1,257,161,'2016-01-22 15:04:00'),(2073,'Huiles bardage',0,'',1872,1,351,161,'2016-01-18 14:35:20'),(2074,'Huile-cire dure : Solid\'Oil',0,'',1873,1,249,161,'2016-01-22 15:04:58'),(2075,'Huiles cires',0,'',1874,1,264,161,'2016-01-22 15:05:27'),(2076,'Huile cire béton',0,'',1875,1,254,161,'2016-01-18 14:36:33'),(2077,'Huiles environnement pour parquet',0,'',1876,1,244,161,'2016-01-22 15:06:30'),(2078,'Huile d\'entretien',0,'',1877,1,248,161,'2016-01-11 16:55:17'),(2079,'Huile pour Teck',0,'',1878,1,259,161,'2016-01-18 14:37:06'),(2080,'Lasures bois très longue durée',0,'',1879,1,256,161,'2016-01-18 14:37:20'),(2081,'Lasures OPTEM',0,'',1880,1,316,161,'2016-01-18 14:37:37'),(2082,'Liant mastic à bois',0,'',1881,1,308,161,'2016-01-18 14:37:54'),(2083,'Nettoyants et rénovateurs',0,'',1882,1,253,161,'2016-01-18 14:38:18'),(2084,'Peinture bois très longue durée',0,'',1883,1,315,161,'2016-01-13 10:25:14'),(2085,'Peinture ciment bois',0,'',1884,1,270,161,'2016-01-18 14:38:40'),(2086,'Préparation bois extérieur',0,'',1885,1,317,161,'2016-01-18 14:39:05'),(2087,'Peinture décorative aqua',0,'',1886,1,425,161,'2016-03-01 14:36:39'),(2088,'Prim\' Huile',0,'',1887,1,246,161,'2016-01-18 14:39:19'),(2089,'Saturateur pour terrasse',0,'',1888,1,247,161,'2016-02-24 17:24:11'),(2090,'Savon Naturel des parquets huilés',0,'',1889,1,245,161,'2016-01-18 14:40:23'),(2091,'Système incolore anti-UV',0,'',1890,1,260,161,'2016-01-18 14:41:09'),(2092,'Teintes',0,'',1891,1,258,161,'2016-01-18 14:41:34'),(2093,'Traitement des bois - Trait\'plus -Trait\'découp',0,'',1892,1,251,161,'2016-01-18 14:42:00'),(2094,'Vitrificateurs environnement Blanchon',0,'',1893,1,243,161,'2016-01-18 14:42:24'),(2095,'Vitrificateurs parquet (VP)',0,'',1894,1,261,161,'2016-02-02 14:00:59'),(2096,'Vitrificateurs parquet Océanic®',0,'',1895,1,265,161,'2016-01-19 11:00:23'),(2097,'Vitrificateurs parquet SVP aqua',0,'',1896,1,405,161,'2015-12-04 13:49:33'),(2098,'Vernis bois',0,'',1897,1,297,161,'2016-02-02 14:02:02'),(2099,'Peinture rénovation',0,'',1898,1,436,161,'2016-10-18 14:49:46'),(2100,'Bugal',0,'',1899,1,280,151,'2016-03-26 10:23:08'),(2101,'Bona',0,'',1900,1,269,151,'2016-03-26 10:24:58'),(2102,'Balai Bona spay mop parquet',0,'',1901,1,312,269,'2016-01-18 14:46:36'),(2103,'Balai Bona spay mop sol dur',0,'',1902,1,311,269,'2016-01-18 14:46:56'),(2104,'Entretien parquet vitrifié',0,'',1903,1,306,269,'2016-01-18 14:47:20'),(2105,'Entretien parquet huilé',0,'',1904,1,307,269,'2015-12-01 11:03:24'),(2106,'Savon pour parquet huilé',0,'',1905,1,406,269,'2015-12-02 14:06:24'),(2107,'Huile d\'entretien parquet huilé',0,'',1906,1,407,269,'2015-12-02 15:45:26'),(2108,'Bostik',0,'',1907,1,162,151,'2011-04-08 13:05:04'),(2109,'Chêne de l\'Est',0,'',1908,1,155,151,'2016-03-26 10:25:53'),(2110,'Poussière d\'argile',0,'',1909,1,164,155,'2016-01-18 14:47:59'),(2111,'Plancher d\'autrefois',0,'',1910,1,165,155,'2016-01-18 14:48:11'),(2112,'Privilège Café',0,'',1911,1,166,155,'2016-01-18 14:48:31'),(2113,'Gamme Initiale',0,'',1912,1,423,155,'2016-11-02 11:30:10'),(2114,'Gamme Nature',0,'',1913,1,437,155,'2016-11-02 11:30:22'),(2115,'Cepam',0,'',1914,1,158,151,'2015-07-30 14:04:49'),(2116,'Natural',0,'',1915,1,187,158,'2014-07-02 13:42:36'),(2117,'Grand large',0,'',1916,1,188,158,'2014-07-02 13:42:46'),(2118,'Bord à bord',0,'',1917,1,189,158,'2014-07-02 13:42:57'),(2119,'Clean green',0,'',1918,1,288,151,'2016-03-26 10:28:14'),(2120,'Design by BP',0,'',1919,1,152,151,'2016-03-26 10:28:19'),(2121,'Massif brut',0,'',1920,1,228,152,'2016-01-18 14:49:17'),(2122,'Massif huilé naturel',0,'',1921,1,229,152,'2016-01-18 14:49:33'),(2123,'Lambris',0,'',1922,1,231,152,'2016-01-18 14:49:42'),(2124,'Massifs exotiques',0,'',1923,1,232,152,'2015-12-15 14:03:23'),(2125,'Massifs salle de bain',0,'',1924,1,233,152,'2016-01-18 14:50:01'),(2126,'Médoc 5G',0,'',1925,1,234,152,'2014-04-09 10:25:52'),(2127,'Colosse 5G',0,'',1926,1,235,152,'2014-04-09 10:27:24'),(2128,'Terrasses bois composite',0,'',1927,1,236,152,'2016-01-18 14:50:24'),(2129,'Terrasses bois',0,'',1928,1,237,152,'2016-01-18 14:50:42'),(2130,'Stratifié',0,'',1929,1,238,152,'2016-01-18 14:50:56'),(2131,'Emfi',0,'',1930,1,224,151,'2016-02-05 10:16:51'),(2132,'Cabbani',0,'',1931,1,156,151,'2017-02-21 14:18:31'),(2133,'Collection 02 (Finition Huilée)',0,'',1932,1,192,156,'2017-02-21 15:20:28'),(2134,'Collection 01 (Finition Vernie)',0,'',1933,1,193,156,'2017-02-21 14:58:31'),(2135,'Collection 03 (Finition Vernie)',0,'',1934,1,412,156,'2017-02-22 13:14:49'),(2136,'Garden lights',0,'',1935,1,289,151,'2016-03-26 10:32:34'),(2137,'Transformateurs',0,'',1936,1,380,289,'2015-03-11 16:43:54'),(2138,'Câbles et rallonges',0,'',1937,1,381,289,'2015-03-11 16:44:02'),(2139,'Programmateurs, détecteurs, télécommandes',0,'',1938,1,382,289,'2015-03-11 16:44:09'),(2140,'Eclairage à poser au sol',0,'',1939,1,383,289,'2015-03-11 16:44:17'),(2141,'Eclairage mural',0,'',1940,1,384,289,'2015-03-11 16:44:24'),(2142,'Eclairage d\'orientation',0,'',1941,1,385,289,'2015-03-11 16:44:31'),(2143,'SPOTS',0,'',1942,1,386,289,'2015-03-11 16:44:38'),(2144,'Eclairage Design Collection',0,'',1943,1,387,289,'2015-03-11 16:46:51'),(2145,'Pièces détachées',0,'',1944,1,388,289,'2015-03-11 16:48:03'),(2146,'Hapax',0,'',1945,1,273,151,'2016-02-05 13:14:38'),(2147,'Haro',0,'',1946,1,163,151,'2016-01-14 16:39:17'),(2148,'A l\'Anglaise Série 4000',0,'',1947,1,217,163,'2016-02-25 10:30:24'),(2149,'Toscana Série 3000',0,'',1948,1,218,163,'2016-02-25 10:32:27'),(2150,'Planche large à l\'ancienne - Série 4000',0,'',1949,1,287,163,'2016-01-18 14:58:07'),(2151,'Planche large à l\'ancienne - Série 3000',0,'',1950,1,219,163,'2017-03-21 16:19:37'),(2152,'Célénio Papyrus',0,'',1951,1,222,163,'2016-01-18 14:58:53'),(2153,'Célénio Athos',0,'',1952,1,223,163,'2016-01-18 14:59:06'),(2154,'Célénio Atrium',0,'',1953,1,226,163,'2016-01-18 14:59:19'),(2155,'Gran Via',0,'',1954,1,424,163,'2016-02-25 10:06:45'),(2156,'Tritty 100',0,'',1955,1,242,163,'2016-02-23 15:24:42'),(2157,'Tritty 100 - Silent CT',0,'',1956,1,422,163,'2016-02-01 17:23:41'),(2158,'Tritty 75',0,'',1957,1,285,163,'2016-01-11 16:47:33'),(2159,'Tritty 75 - Silent CT',0,'',1958,1,420,163,'2016-02-01 15:22:18'),(2160,'Haro Sols en liège',0,'',1959,1,293,163,'2017-07-04 22:35:39'),(2161,'Tritty 90',0,'',1960,1,448,163,'2017-01-09 10:28:29'),(2162,'Tritty 90 - Silent CT',0,'',1961,1,449,163,'2017-01-09 10:33:13'),(2163,'Tritty 90 - Silent Pro',0,'',1962,1,450,163,'2017-01-09 10:34:36'),(2164,'A l\'anglaise Série 3500',0,'',1963,1,451,163,'2017-01-10 08:50:28'),(2165,'Planche large à l\'ancienne - Série 3500',0,'',1964,1,469,163,'2017-03-22 16:43:12'),(2166,'Lamett',0,'',1965,1,272,151,'2016-03-26 10:44:05'),(2167,'Atlanta',0,'',1966,1,274,272,'2015-03-04 17:24:47'),(2168,'Cézanne',0,'',1967,1,362,272,'2016-01-27 10:27:55'),(2169,'Cuba',0,'',1968,1,364,272,'2016-01-18 17:01:24'),(2170,'Dijon',0,'',1969,1,313,272,'2016-01-27 13:14:13'),(2171,'New york',0,'',1970,1,275,272,'2014-07-02 13:23:40'),(2172,'Oslo',0,'',1971,1,276,272,'2016-01-27 14:26:50'),(2173,'Country',0,'',1972,1,277,272,'2014-07-02 13:26:51'),(2174,'Farm',0,'',1973,1,278,272,'2015-11-18 16:38:07'),(2175,'Impérial',0,'',1974,1,230,272,'2016-01-18 17:02:26'),(2176,'Nature',0,'',1975,1,282,272,'2014-07-02 13:27:21'),(2177,'Brussels',0,'',1976,1,284,272,'2017-02-15 09:14:11'),(2178,'Palace',0,'',1977,1,363,272,'2016-01-18 17:02:52'),(2179,'Royal',0,'',1978,1,371,272,'2016-01-18 17:03:06'),(2180,'Classica',0,'',1979,1,391,272,'2017-02-15 09:14:07'),(2181,'Sapphire',0,'',1980,1,392,272,'2017-02-15 09:14:00'),(2182,'Bolero',0,'',1981,1,393,272,'2017-02-15 09:13:47'),(2183,'Listone Giordano',0,'',1982,1,154,151,'2016-01-18 14:31:31'),(2184,'Linéa 70',0,'',1983,1,195,154,'2016-01-18 17:04:34'),(2185,'Piano 90',0,'',1984,1,196,154,'2016-01-18 17:04:55'),(2186,'Makita',0,'',1985,1,403,151,'2015-11-04 13:40:24'),(2187,'Objectflor',0,'',1986,1,402,151,'2015-11-02 17:45:40'),(2188,'Parqueterie Berrichonne',0,'',1987,1,153,151,'2016-01-26 16:54:20'),(2189,'Confluence 90',0,'',1988,1,211,153,'2017-03-03 16:30:22'),(2190,'Terrasse',0,'',1989,1,214,153,'2016-01-14 14:58:31'),(2191,'Nativ 11',0,'',1990,1,215,153,'2017-02-22 16:43:16'),(2192,'Class clic 140',0,'',1991,1,216,153,'2017-03-03 16:29:58'),(2193,'Confluence 140',0,'',1992,1,417,153,'2017-03-03 16:30:06'),(2194,'Confluence 170',0,'',1993,1,418,153,'2017-03-03 16:30:12'),(2195,'Confluence 190',0,'',1994,1,419,153,'2017-03-03 16:30:17'),(2196,'Nativ 14',0,'',1995,1,460,153,'2017-03-01 10:42:26'),(2197,'Quick Step',0,'',1996,1,157,151,'2016-01-18 14:32:33'),(2198,'Ambient Click',0,'',1997,1,399,157,'2017-01-24 14:15:35'),(2199,'Arte',0,'',1998,1,184,157,'2016-03-26 11:03:17'),(2200,'Balance Click',0,'',1999,1,398,157,'2015-12-14 13:51:44'),(2201,'Classic',0,'',2000,1,181,157,'2016-01-18 17:06:14'),(2202,'Creo',0,'',2001,1,309,157,'2016-01-18 17:06:24'),(2203,'Vogue',0,'',2002,1,175,157,'2015-04-07 12:47:45'),(2204,'Eligna',0,'',2003,1,177,157,'2016-01-18 17:06:36'),(2205,'Eligna Wide',0,'',2004,1,262,157,'2016-01-18 17:06:46'),(2206,'Elite',0,'',2005,1,179,157,'2016-01-18 17:06:57'),(2207,'Impressive',0,'',2006,1,304,157,'2017-04-10 14:14:08'),(2208,'Impressive Ultra',0,'',2007,1,305,157,'2017-04-10 14:13:54'),(2209,'Lagune',0,'',2008,1,180,157,'2016-01-18 17:07:29'),(2210,'Largo',0,'',2009,1,174,157,'2016-01-18 17:07:39'),(2211,'Perspective',0,'',2010,1,178,157,'2016-01-18 17:07:47'),(2212,'Perspective Wide',0,'',2011,1,310,157,'2016-01-18 17:07:58'),(2213,'Imperio',0,'',2012,1,438,157,'2016-11-16 10:56:09'),(2214,'Palazzo',0,'',2013,1,439,157,'2016-11-16 10:58:35'),(2215,'Castello',0,'',2014,1,441,157,'2016-11-16 11:04:00'),(2216,'Villa',0,'',2015,1,442,157,'2016-11-16 11:03:35'),(2217,'Compact',0,'',2016,1,444,157,'2016-11-16 11:06:42'),(2218,'Balance Click Plus',0,'',2017,1,452,157,'2017-01-23 16:58:07'),(2219,'Ambient Click Plus',0,'',2018,1,453,157,'2017-01-24 14:15:57'),(2220,'Pulse Click',0,'',2019,1,454,157,'2017-01-24 16:18:34'),(2221,'Pulse Click Plus',0,'',2020,1,455,157,'2017-01-25 10:43:20'),(2222,'Majestic',0,'',2021,1,470,157,'2017-04-10 14:17:26'),(2223,'Solidfloor',0,'',2022,1,292,151,'2016-01-18 14:32:45'),(2224,'Spax',0,'',2023,1,281,151,'2016-11-30 10:04:04'),(2225,'Verniland',0,'',2024,1,160,151,'2015-11-04 13:38:41'),(2226,'Virginia',0,'',2025,1,167,160,'2014-07-02 13:41:49'),(2227,'Callao',0,'',2026,1,169,160,'2014-07-02 13:42:00'),(2228,'Sapin brossé large',0,'',2027,1,170,160,'2014-07-02 13:42:10'),(2229,'Duo color',0,'',2028,1,173,160,'2014-07-02 13:42:23'),(2230,'Accessoires lambris',0,'',2029,1,301,160,'2014-07-25 09:30:55'),(2231,'Woca',0,'',2030,1,427,151,'2016-04-14 12:24:43'),(2232,'Box d\'entretien des parquets huilés',0,'',2031,1,432,427,'2016-03-14 17:33:10'),(2233,'Détachant',0,'',2032,1,430,427,'2016-03-14 17:27:05'),(2234,'Huile d\'entretien',0,'',2033,1,429,427,'2016-03-15 17:01:35'),(2235,'Huile d\'extérieur',0,'',2034,1,433,427,'2016-03-14 17:58:24'),(2236,'Nettoyant intensif',0,'',2035,1,431,427,'2016-03-14 17:30:25'),(2237,'Oil Care',0,'',2036,1,434,427,'2016-04-01 14:54:00'),(2238,'Savon naturel des parquets huilés',0,'',2037,1,428,427,'2016-04-01 15:38:07'),(2239,'L\'outil parfait',0,'',2038,1,446,151,'2016-11-30 10:44:20'),(2240,'Lalegno',0,'',2039,1,456,151,'2017-02-01 13:14:31'),(2241,'Fiberdeck',0,'',2040,1,458,151,'2017-02-15 10:16:05'),(2242,'Dressing',0,'',2041,1,447,3,'2016-11-30 15:52:29'),(2243,'Kendoors',0,'',2042,1,471,447,'2017-05-31 08:03:58'),(2244,'Accessoires',0,'',2043,1,457,3,'2017-02-01 14:25:08'),(2245,'LAMBOURDES & TASSEAUX',0,'',2044,1,99,457,'2017-03-21 17:03:37'),(2246,'COLLES & MASTICS',0,'',2045,1,107,457,'2017-03-21 17:03:42'),(2247,'SOUS-COUCHES',0,'',2046,1,100,457,'2017-02-01 14:26:19'),(2248,'BARRES DE SEUIL',0,'',2047,1,225,457,'2017-02-01 14:26:26'),(2249,'PLINTHES',0,'',2048,1,103,457,'2017-02-01 14:26:33'),(2250,'SOUS-PROFILÉ INCIZO',0,'',2049,1,397,457,'2017-02-01 14:27:04'),(2251,'ACCESSOIRES TERRASSES',0,'',2050,1,140,457,'2017-02-01 14:27:16'),(2252,'ACCESSOIRES LUMINAIRES',0,'',2051,1,291,457,'2017-02-01 14:27:24'),(2253,'CONTRES PLINTHES',0,'',2052,1,408,457,'2017-02-01 14:27:56'),(2254,'CHAMPLATS',0,'',2053,1,409,457,'2017-02-01 14:27:41'),(2255,'QUARTS DE ROND',0,'',2054,1,410,457,'2017-02-01 14:27:50'),(2256,'NEZ DE MARCHE',0,'',2055,1,411,457,'2017-02-01 14:28:02'),(2257,'OUTILLAGE PARQUET',0,'',2056,1,116,457,'2017-02-01 14:28:13'),(2258,'Brosses & Spalters',0,'',2057,1,467,457,'2017-03-21 16:54:05'),(2259,'Rouleaux & Montures',0,'',2058,1,468,457,'2017-03-21 17:03:14'); +/*!40000 ALTER TABLE `llx_ecommerce_category` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_contact` +-- + +DROP TABLE IF EXISTS `llx_element_contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_contact` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datecreate` datetime DEFAULT NULL, + `statut` smallint(6) DEFAULT '5', + `element_id` int(11) NOT NULL, + `fk_c_type_contact` int(11) NOT NULL, + `fk_socpeople` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_contact_idx1` (`element_id`,`fk_c_type_contact`,`fk_socpeople`), + KEY `fk_element_contact_fk_c_type_contact` (`fk_c_type_contact`), + KEY `idx_element_contact_fk_socpeople` (`fk_socpeople`), + CONSTRAINT `fk_element_contact_fk_c_type_contact` FOREIGN KEY (`fk_c_type_contact`) REFERENCES `llx_c_type_contact` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_contact` +-- + +LOCK TABLES `llx_element_contact` WRITE; +/*!40000 ALTER TABLE `llx_element_contact` DISABLE KEYS */; +INSERT INTO `llx_element_contact` VALUES (1,'2010-07-09 00:49:43',4,1,160,1),(2,'2010-07-09 00:49:56',4,2,160,1),(3,'2010-07-09 00:50:19',4,3,160,1),(4,'2010-07-09 00:50:42',4,4,160,1),(5,'2010-07-09 01:52:36',4,1,120,1),(6,'2010-07-09 01:53:25',4,1,10,2),(7,'2010-07-09 01:53:25',4,1,11,2),(8,'2010-07-10 18:13:37',4,2,10,2),(9,'2010-07-10 18:13:37',4,2,11,2),(11,'2010-07-11 16:22:36',4,5,160,1),(12,'2010-07-11 16:23:53',4,2,180,1),(13,'2013-01-23 15:04:27',4,19,200,5),(14,'2013-01-23 16:06:37',4,19,210,2),(15,'2013-01-23 16:12:43',4,19,220,2),(16,'2013-03-06 10:04:57',4,3,10,1),(17,'2013-03-06 10:04:57',4,3,11,1),(18,'2014-12-21 13:52:41',4,3,180,1),(19,'2014-12-21 13:55:39',4,4,180,1),(20,'2014-12-21 14:16:58',4,5,180,1),(21,'2016-07-30 15:29:07',4,6,160,12),(22,'2016-07-30 15:29:48',4,7,160,12),(23,'2016-07-30 15:30:25',4,8,160,12),(24,'2016-07-30 15:33:27',4,6,180,12),(25,'2016-07-30 15:33:39',4,7,180,12),(26,'2016-07-30 15:33:54',4,8,180,12),(27,'2016-07-30 15:34:09',4,9,180,12),(28,'2016-07-31 18:27:20',4,9,160,12); +/*!40000 ALTER TABLE `llx_element_contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_element` +-- + +DROP TABLE IF EXISTS `llx_element_element`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_element` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_source` int(11) NOT NULL, + `sourcetype` varchar(32) NOT NULL, + `fk_target` int(11) NOT NULL, + `targettype` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_element_idx1` (`fk_source`,`sourcetype`,`fk_target`,`targettype`), + KEY `idx_element_element_fk_target` (`fk_target`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_element` +-- + +LOCK TABLES `llx_element_element` WRITE; +/*!40000 ALTER TABLE `llx_element_element` DISABLE KEYS */; +INSERT INTO `llx_element_element` VALUES (4,1,'order_supplier',20,'invoice_supplier'),(5,2,'cabinetmed_cabinetmedcons',216,'facture'),(1,2,'contrat',2,'facture'),(2,2,'propal',1,'commande'),(3,5,'commande',1,'shipping'),(11,25,'propal',92,'commande'),(9,28,'propal',90,'commande'),(10,29,'propal',91,'commande'),(6,75,'commande',2,'shipping'); +/*!40000 ALTER TABLE `llx_element_element` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_resources` +-- + +DROP TABLE IF EXISTS `llx_element_resources`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_resources` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `element_id` int(11) DEFAULT NULL, + `element_type` varchar(64) DEFAULT NULL, + `resource_id` int(11) DEFAULT NULL, + `resource_type` varchar(64) DEFAULT NULL, + `busy` int(11) DEFAULT NULL, + `mandatory` int(11) DEFAULT NULL, + `fk_user_create` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `duree` double DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_element_resources_idx1` (`resource_id`,`resource_type`,`element_id`,`element_type`), + KEY `idx_element_element_element_id` (`element_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_resources` +-- + +LOCK TABLES `llx_element_resources` WRITE; +/*!40000 ALTER TABLE `llx_element_resources` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_resources` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_element_tag` +-- + +DROP TABLE IF EXISTS `llx_element_tag`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_element_tag` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `lang` varchar(5) NOT NULL, + `tag` varchar(255) NOT NULL, + `fk_element` int(11) NOT NULL, + `element` varchar(64) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_element_tag` (`entity`,`lang`,`tag`,`fk_element`,`element`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_element_tag` +-- + +LOCK TABLES `llx_element_tag` WRITE; +/*!40000 ALTER TABLE `llx_element_tag` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_element_tag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_entity_extrafields` +-- + +DROP TABLE IF EXISTS `llx_entity_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_entity_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_entity_extrafields` +-- + +LOCK TABLES `llx_entity_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_entity_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_entity_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_entrepot` +-- + +DROP TABLE IF EXISTS `llx_entrepot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_entrepot` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `description` text, + `lieu` varchar(64) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_departement` int(11) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `statut` tinyint(4) DEFAULT '1', + `fk_user_author` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_parent` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_entrepot_label` (`label`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_entrepot` +-- + +LOCK TABLES `llx_entrepot` WRITE; +/*!40000 ALTER TABLE `llx_entrepot` DISABLE KEYS */; +INSERT INTO `llx_entrepot` VALUES (1,'2010-07-09 00:31:22','2010-07-08 22:40:36','WAREHOUSEHOUSTON',1,'Warehouse located at Houston','Warehouse houston','','','Houston',NULL,11,1,1,NULL,0),(2,'2010-07-09 00:41:03','2010-07-08 22:41:03','WAREHOUSEPARIS',1,'
        ','Warehouse Paris','','75000','Paris',NULL,1,1,1,NULL,0),(3,'2010-07-11 16:18:59','2016-07-30 13:52:08','Stock personnel Dupont',1,'Cet entrepôt représente le stock personnel de Alain Dupont','','','','',NULL,2,1,1,NULL,0),(9,'2015-10-03 11:47:41','2015-10-03 09:47:41','Personal stock Marie Curie',1,'This warehouse represents personal stock of Marie Curie','','','','',NULL,1,1,1,NULL,0),(10,'2015-10-05 09:07:52','2016-07-30 13:52:24','Personal stock Alex Theceo',1,'This warehouse represents personal stock of Alex Theceo','','','','',NULL,3,1,1,NULL,0),(12,'2015-10-05 21:29:35','2015-10-05 19:29:35','Personal stock Charly Commery',1,'This warehouse represents personal stock of Charly Commery','','','','',NULL,1,1,11,NULL,0),(13,'2015-10-05 21:33:33','2016-07-30 13:51:38','Personal stock Sam Scientol',1,'This warehouse represents personal stock of Sam Scientol','','','7500','Paris',NULL,1,0,11,NULL,0),(18,'2016-01-22 17:27:02','2016-01-22 16:27:02','Personal stock Laurent Destailleur',1,'This warehouse represents personal stock of Laurent Destailleur','','','','',NULL,1,1,12,NULL,0),(19,'2016-07-30 16:50:23','2016-07-30 12:50:23','Personal stock Eldy',1,'This warehouse represents personal stock of Eldy','','','','',NULL,14,1,12,NULL,0),(20,'2017-02-02 03:55:45','2017-02-01 23:55:45','Personal stock Alex Boston',1,'This warehouse represents personal stock of Alex Boston','','','','',NULL,14,1,12,NULL,NULL); +/*!40000 ALTER TABLE `llx_entrepot` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_establishment` +-- + +DROP TABLE IF EXISTS `llx_establishment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_establishment` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `name` varchar(50) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_state` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT '0', + `profid1` varchar(20) DEFAULT NULL, + `profid2` varchar(20) DEFAULT NULL, + `profid3` varchar(20) DEFAULT NULL, + `phone` varchar(20) DEFAULT NULL, + `fk_user_author` int(11) NOT NULL, + `fk_user_mod` int(11) DEFAULT NULL, + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `status` tinyint(4) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_establishment` +-- + +LOCK TABLES `llx_establishment` WRITE; +/*!40000 ALTER TABLE `llx_establishment` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_establishment` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_event_element` +-- + +DROP TABLE IF EXISTS `llx_event_element`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_event_element` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_source` int(11) NOT NULL, + `fk_target` int(11) NOT NULL, + `targettype` varchar(32) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_event_element` +-- + +LOCK TABLES `llx_event_element` WRITE; +/*!40000 ALTER TABLE `llx_event_element` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_event_element` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_events` +-- + +DROP TABLE IF EXISTS `llx_events`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_events` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `type` varchar(32) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `dateevent` datetime DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `description` varchar(250) NOT NULL, + `ip` varchar(250) DEFAULT NULL, + `user_agent` varchar(255) DEFAULT NULL, + `fk_object` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_events_dateevent` (`dateevent`) +) ENGINE=InnoDB AUTO_INCREMENT=844 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_events` +-- + +LOCK TABLES `llx_events` WRITE; +/*!40000 ALTER TABLE `llx_events` DISABLE KEYS */; +INSERT INTO `llx_events` VALUES (30,'2011-07-18 18:23:06','USER_LOGOUT',1,'2011-07-18 20:23:06',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(31,'2011-07-18 18:23:12','USER_LOGIN_FAILED',1,'2011-07-18 20:23:12',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(32,'2011-07-18 18:23:17','USER_LOGIN',1,'2011-07-18 20:23:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(33,'2011-07-18 20:10:51','USER_LOGIN_FAILED',1,'2011-07-18 22:10:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(34,'2011-07-18 20:10:55','USER_LOGIN',1,'2011-07-18 22:10:55',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(35,'2011-07-18 21:18:57','USER_LOGIN',1,'2011-07-18 23:18:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(36,'2011-07-20 10:34:10','USER_LOGIN',1,'2011-07-20 12:34:10',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(37,'2011-07-20 12:36:44','USER_LOGIN',1,'2011-07-20 14:36:44',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(38,'2011-07-20 13:20:51','USER_LOGIN_FAILED',1,'2011-07-20 15:20:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(39,'2011-07-20 13:20:54','USER_LOGIN',1,'2011-07-20 15:20:54',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(40,'2011-07-20 15:03:46','USER_LOGIN_FAILED',1,'2011-07-20 17:03:46',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(41,'2011-07-20 15:03:55','USER_LOGIN',1,'2011-07-20 17:03:55',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(42,'2011-07-20 18:05:05','USER_LOGIN_FAILED',1,'2011-07-20 20:05:05',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(43,'2011-07-20 18:05:08','USER_LOGIN',1,'2011-07-20 20:05:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(44,'2011-07-20 21:08:53','USER_LOGIN_FAILED',1,'2011-07-20 23:08:53',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(45,'2011-07-20 21:08:56','USER_LOGIN',1,'2011-07-20 23:08:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(46,'2011-07-21 01:26:12','USER_LOGIN',1,'2011-07-21 03:26:12',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(47,'2011-07-21 22:35:45','USER_LOGIN_FAILED',1,'2011-07-22 00:35:45',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(48,'2011-07-21 22:35:49','USER_LOGIN',1,'2011-07-22 00:35:49',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(49,'2011-07-26 23:09:47','USER_LOGIN_FAILED',1,'2011-07-27 01:09:47',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(50,'2011-07-26 23:09:50','USER_LOGIN',1,'2011-07-27 01:09:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(51,'2011-07-27 17:02:27','USER_LOGIN_FAILED',1,'2011-07-27 19:02:27',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(52,'2011-07-27 17:02:32','USER_LOGIN',1,'2011-07-27 19:02:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(53,'2011-07-27 23:33:37','USER_LOGIN_FAILED',1,'2011-07-28 01:33:37',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(54,'2011-07-27 23:33:41','USER_LOGIN',1,'2011-07-28 01:33:41',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(55,'2011-07-28 18:20:36','USER_LOGIN_FAILED',1,'2011-07-28 20:20:36',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(56,'2011-07-28 18:20:38','USER_LOGIN',1,'2011-07-28 20:20:38',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(57,'2011-07-28 20:13:30','USER_LOGIN_FAILED',1,'2011-07-28 22:13:30',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(58,'2011-07-28 20:13:34','USER_LOGIN',1,'2011-07-28 22:13:34',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(59,'2011-07-28 20:22:51','USER_LOGIN',1,'2011-07-28 22:22:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(60,'2011-07-28 23:05:06','USER_LOGIN',1,'2011-07-29 01:05:06',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(61,'2011-07-29 20:15:50','USER_LOGIN_FAILED',1,'2011-07-29 22:15:50',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(62,'2011-07-29 20:15:53','USER_LOGIN',1,'2011-07-29 22:15:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(68,'2011-07-29 20:51:01','USER_LOGOUT',1,'2011-07-29 22:51:01',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(69,'2011-07-29 20:51:05','USER_LOGIN',1,'2011-07-29 22:51:05',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(70,'2011-07-30 08:46:20','USER_LOGIN_FAILED',1,'2011-07-30 10:46:20',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(71,'2011-07-30 08:46:38','USER_LOGIN_FAILED',1,'2011-07-30 10:46:38',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(72,'2011-07-30 08:46:42','USER_LOGIN',1,'2011-07-30 10:46:42',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(73,'2011-07-30 10:05:12','USER_LOGIN_FAILED',1,'2011-07-30 12:05:12',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(74,'2011-07-30 10:05:15','USER_LOGIN',1,'2011-07-30 12:05:15',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(75,'2011-07-30 12:15:46','USER_LOGIN',1,'2011-07-30 14:15:46',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(76,'2011-07-31 22:19:30','USER_LOGIN',1,'2011-08-01 00:19:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(77,'2011-07-31 23:32:52','USER_LOGIN',1,'2011-08-01 01:32:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(78,'2011-08-01 01:24:50','USER_LOGIN_FAILED',1,'2011-08-01 03:24:50',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(79,'2011-08-01 01:24:54','USER_LOGIN',1,'2011-08-01 03:24:54',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(80,'2011-08-01 19:31:36','USER_LOGIN_FAILED',1,'2011-08-01 21:31:35',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(81,'2011-08-01 19:31:39','USER_LOGIN',1,'2011-08-01 21:31:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(82,'2011-08-01 20:01:36','USER_LOGIN',1,'2011-08-01 22:01:36',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(83,'2011-08-01 20:52:54','USER_LOGIN_FAILED',1,'2011-08-01 22:52:54',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(84,'2011-08-01 20:52:58','USER_LOGIN',1,'2011-08-01 22:52:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(85,'2011-08-01 21:17:28','USER_LOGIN_FAILED',1,'2011-08-01 23:17:28',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(86,'2011-08-01 21:17:31','USER_LOGIN',1,'2011-08-01 23:17:31',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(87,'2011-08-04 11:55:17','USER_LOGIN',1,'2011-08-04 13:55:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(88,'2011-08-04 20:19:03','USER_LOGIN_FAILED',1,'2011-08-04 22:19:03',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(89,'2011-08-04 20:19:07','USER_LOGIN',1,'2011-08-04 22:19:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(90,'2011-08-05 17:51:42','USER_LOGIN_FAILED',1,'2011-08-05 19:51:42',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(91,'2011-08-05 17:51:47','USER_LOGIN',1,'2011-08-05 19:51:47',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(92,'2011-08-05 17:56:03','USER_LOGIN',1,'2011-08-05 19:56:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(93,'2011-08-05 17:59:10','USER_LOGIN',1,'2011-08-05 19:59:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30',NULL),(94,'2011-08-05 18:01:58','USER_LOGIN',1,'2011-08-05 20:01:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30',NULL),(95,'2011-08-05 19:59:56','USER_LOGIN',1,'2011-08-05 21:59:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(96,'2011-08-06 18:33:22','USER_LOGIN',1,'2011-08-06 20:33:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(97,'2011-08-07 00:56:59','USER_LOGIN',1,'2011-08-07 02:56:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(98,'2011-08-07 22:49:14','USER_LOGIN',1,'2011-08-08 00:49:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(99,'2011-08-07 23:05:18','USER_LOGOUT',1,'2011-08-08 01:05:18',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(105,'2011-08-08 00:41:09','USER_LOGIN',1,'2011-08-08 02:41:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(106,'2011-08-08 11:58:55','USER_LOGIN',1,'2011-08-08 13:58:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(107,'2011-08-08 14:35:48','USER_LOGIN',1,'2011-08-08 16:35:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(108,'2011-08-08 14:36:31','USER_LOGOUT',1,'2011-08-08 16:36:31',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(109,'2011-08-08 14:38:28','USER_LOGIN',1,'2011-08-08 16:38:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(110,'2011-08-08 14:39:02','USER_LOGOUT',1,'2011-08-08 16:39:02',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(111,'2011-08-08 14:39:10','USER_LOGIN',1,'2011-08-08 16:39:10',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(112,'2011-08-08 14:39:28','USER_LOGOUT',1,'2011-08-08 16:39:28',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(113,'2011-08-08 14:39:37','USER_LOGIN',1,'2011-08-08 16:39:37',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(114,'2011-08-08 14:50:02','USER_LOGOUT',1,'2011-08-08 16:50:02',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(115,'2011-08-08 14:51:45','USER_LOGIN_FAILED',1,'2011-08-08 16:51:45',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(116,'2011-08-08 14:51:52','USER_LOGIN',1,'2011-08-08 16:51:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(117,'2011-08-08 15:09:54','USER_LOGOUT',1,'2011-08-08 17:09:54',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(118,'2011-08-08 15:10:19','USER_LOGIN_FAILED',1,'2011-08-08 17:10:19',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(119,'2011-08-08 15:10:28','USER_LOGIN',1,'2011-08-08 17:10:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(121,'2011-08-08 15:14:58','USER_LOGOUT',1,'2011-08-08 17:14:58',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(122,'2011-08-08 15:15:00','USER_LOGIN_FAILED',1,'2011-08-08 17:15:00',NULL,'Identifiants login ou mot de passe incorrects - login=','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(123,'2011-08-08 15:17:57','USER_LOGIN',1,'2011-08-08 17:17:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(124,'2011-08-08 15:35:56','USER_LOGOUT',1,'2011-08-08 17:35:56',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(125,'2011-08-08 15:36:05','USER_LOGIN',1,'2011-08-08 17:36:05',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(126,'2011-08-08 17:32:42','USER_LOGIN',1,'2011-08-08 19:32:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0',NULL),(127,'2012-12-08 13:49:37','USER_LOGOUT',1,'2012-12-08 14:49:37',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(128,'2012-12-08 13:49:42','USER_LOGIN',1,'2012-12-08 14:49:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(129,'2012-12-08 13:50:12','USER_LOGOUT',1,'2012-12-08 14:50:12',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(130,'2012-12-08 13:50:14','USER_LOGIN',1,'2012-12-08 14:50:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(131,'2012-12-08 13:50:17','USER_LOGOUT',1,'2012-12-08 14:50:17',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(132,'2012-12-08 13:52:47','USER_LOGIN',1,'2012-12-08 14:52:47',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(133,'2012-12-08 13:53:08','USER_MODIFY',1,'2012-12-08 14:53:08',1,'User admin modified','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(134,'2012-12-08 14:08:45','USER_LOGOUT',1,'2012-12-08 15:08:45',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(135,'2012-12-08 14:09:09','USER_LOGIN',1,'2012-12-08 15:09:09',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(136,'2012-12-08 14:11:43','USER_LOGOUT',1,'2012-12-08 15:11:43',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(137,'2012-12-08 14:11:45','USER_LOGIN',1,'2012-12-08 15:11:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(138,'2012-12-08 14:22:53','USER_LOGOUT',1,'2012-12-08 15:22:53',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(139,'2012-12-08 14:22:54','USER_LOGIN',1,'2012-12-08 15:22:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(140,'2012-12-08 14:23:10','USER_LOGOUT',1,'2012-12-08 15:23:10',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(141,'2012-12-08 14:23:11','USER_LOGIN',1,'2012-12-08 15:23:11',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(142,'2012-12-08 14:23:49','USER_LOGOUT',1,'2012-12-08 15:23:49',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(143,'2012-12-08 14:23:50','USER_LOGIN',1,'2012-12-08 15:23:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(144,'2012-12-08 14:28:08','USER_LOGOUT',1,'2012-12-08 15:28:08',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(145,'2012-12-08 14:35:15','USER_LOGIN',1,'2012-12-08 15:35:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(146,'2012-12-08 14:35:18','USER_LOGOUT',1,'2012-12-08 15:35:18',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(147,'2012-12-08 14:36:07','USER_LOGIN',1,'2012-12-08 15:36:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(148,'2012-12-08 14:36:09','USER_LOGOUT',1,'2012-12-08 15:36:09',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(149,'2012-12-08 14:36:41','USER_LOGIN',1,'2012-12-08 15:36:41',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(150,'2012-12-08 15:59:13','USER_LOGIN',1,'2012-12-08 16:59:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(151,'2012-12-09 11:49:52','USER_LOGIN',1,'2012-12-09 12:49:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(152,'2012-12-09 13:46:31','USER_LOGIN',1,'2012-12-09 14:46:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(153,'2012-12-09 19:03:14','USER_LOGIN',1,'2012-12-09 20:03:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(154,'2012-12-10 00:16:31','USER_LOGIN',1,'2012-12-10 01:16:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(170,'2012-12-11 22:03:31','USER_LOGIN',1,'2012-12-11 23:03:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(171,'2012-12-12 00:32:39','USER_LOGIN',1,'2012-12-12 01:32:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(172,'2012-12-12 10:49:59','USER_LOGIN',1,'2012-12-12 11:49:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(175,'2012-12-12 10:57:40','USER_MODIFY',1,'2012-12-12 11:57:40',1,'Modification utilisateur admin','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(176,'2012-12-12 13:29:15','USER_LOGIN',1,'2012-12-12 14:29:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(177,'2012-12-12 13:30:15','USER_LOGIN',1,'2012-12-12 14:30:15',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(178,'2012-12-12 13:40:08','USER_LOGOUT',1,'2012-12-12 14:40:08',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(179,'2012-12-12 13:40:10','USER_LOGIN',1,'2012-12-12 14:40:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(180,'2012-12-12 13:40:26','USER_MODIFY',1,'2012-12-12 14:40:26',1,'Modification utilisateur admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(181,'2012-12-12 13:40:34','USER_LOGOUT',1,'2012-12-12 14:40:34',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(182,'2012-12-12 13:42:23','USER_LOGIN',1,'2012-12-12 14:42:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(183,'2012-12-12 13:43:02','USER_NEW_PASSWORD',1,'2012-12-12 14:43:02',NULL,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(184,'2012-12-12 13:43:25','USER_LOGOUT',1,'2012-12-12 14:43:25',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(185,'2012-12-12 13:43:27','USER_LOGIN_FAILED',1,'2012-12-12 14:43:27',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(186,'2012-12-12 13:43:30','USER_LOGIN',1,'2012-12-12 14:43:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(187,'2012-12-12 14:52:11','USER_LOGIN',1,'2012-12-12 15:52:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11',NULL),(188,'2012-12-12 17:53:00','USER_LOGIN_FAILED',1,'2012-12-12 18:53:00',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(189,'2012-12-12 17:53:07','USER_LOGIN_FAILED',1,'2012-12-12 18:53:07',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(190,'2012-12-12 17:53:51','USER_NEW_PASSWORD',1,'2012-12-12 18:53:51',NULL,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(191,'2012-12-12 17:54:00','USER_LOGIN',1,'2012-12-12 18:54:00',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(192,'2012-12-12 17:54:10','USER_NEW_PASSWORD',1,'2012-12-12 18:54:10',1,'Changement mot de passe de admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(193,'2012-12-12 17:54:10','USER_MODIFY',1,'2012-12-12 18:54:10',1,'Modification utilisateur admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(194,'2012-12-12 18:57:09','USER_LOGIN',1,'2012-12-12 19:57:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(195,'2012-12-12 23:04:08','USER_LOGIN',1,'2012-12-13 00:04:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(196,'2012-12-17 20:03:14','USER_LOGIN',1,'2012-12-17 21:03:14',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(197,'2012-12-17 21:18:45','USER_LOGIN',1,'2012-12-17 22:18:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(198,'2012-12-17 22:30:08','USER_LOGIN',1,'2012-12-17 23:30:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(199,'2012-12-18 23:32:03','USER_LOGIN',1,'2012-12-19 00:32:03',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(200,'2012-12-19 09:38:03','USER_LOGIN',1,'2012-12-19 10:38:03',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(201,'2012-12-19 11:23:35','USER_LOGIN',1,'2012-12-19 12:23:35',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(202,'2012-12-19 12:46:22','USER_LOGIN',1,'2012-12-19 13:46:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(214,'2012-12-19 19:11:31','USER_LOGIN',1,'2012-12-19 20:11:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(215,'2012-12-21 16:36:57','USER_LOGIN',1,'2012-12-21 17:36:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(216,'2012-12-21 16:38:43','USER_NEW_PASSWORD',1,'2012-12-21 17:38:43',1,'Changement mot de passe de adupont','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(217,'2012-12-21 16:38:43','USER_MODIFY',1,'2012-12-21 17:38:43',1,'Modification utilisateur adupont','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(218,'2012-12-21 16:38:51','USER_LOGOUT',1,'2012-12-21 17:38:51',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(219,'2012-12-21 16:38:55','USER_LOGIN',1,'2012-12-21 17:38:55',3,'(UserLogged,adupont)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(220,'2012-12-21 16:48:18','USER_LOGOUT',1,'2012-12-21 17:48:18',3,'(UserLogoff,adupont)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(221,'2012-12-21 16:48:20','USER_LOGIN',1,'2012-12-21 17:48:20',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(222,'2012-12-26 18:28:18','USER_LOGIN',1,'2012-12-26 19:28:18',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(223,'2012-12-26 20:00:24','USER_LOGIN',1,'2012-12-26 21:00:24',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(224,'2012-12-27 01:10:27','USER_LOGIN',1,'2012-12-27 02:10:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(225,'2012-12-28 19:12:08','USER_LOGIN',1,'2012-12-28 20:12:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(226,'2012-12-28 20:16:58','USER_LOGIN',1,'2012-12-28 21:16:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(227,'2012-12-29 14:35:46','USER_LOGIN',1,'2012-12-29 15:35:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(228,'2012-12-29 14:37:59','USER_LOGOUT',1,'2012-12-29 15:37:59',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(229,'2012-12-29 14:38:00','USER_LOGIN',1,'2012-12-29 15:38:00',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(230,'2012-12-29 17:16:48','USER_LOGIN',1,'2012-12-29 18:16:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(231,'2012-12-31 12:02:59','USER_LOGIN',1,'2012-12-31 13:02:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(232,'2013-01-02 20:32:51','USER_LOGIN',1,'2013-01-02 21:32:51',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0',NULL),(233,'2013-01-02 20:58:59','USER_LOGIN',1,'2013-01-02 21:58:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(234,'2013-01-03 09:25:07','USER_LOGIN',1,'2013-01-03 10:25:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(235,'2013-01-03 19:39:31','USER_LOGIN',1,'2013-01-03 20:39:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(236,'2013-01-04 22:40:19','USER_LOGIN',1,'2013-01-04 23:40:19',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(237,'2013-01-05 12:59:59','USER_LOGIN',1,'2013-01-05 13:59:59',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(238,'2013-01-05 15:28:52','USER_LOGIN',1,'2013-01-05 16:28:52',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(239,'2013-01-05 17:02:08','USER_LOGIN',1,'2013-01-05 18:02:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(240,'2013-01-06 12:13:33','USER_LOGIN',1,'2013-01-06 13:13:33',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(241,'2013-01-07 01:21:15','USER_LOGIN',1,'2013-01-07 02:21:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(242,'2013-01-07 01:46:31','USER_LOGOUT',1,'2013-01-07 02:46:31',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(243,'2013-01-07 19:54:50','USER_LOGIN',1,'2013-01-07 20:54:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(244,'2013-01-08 21:55:01','USER_LOGIN',1,'2013-01-08 22:55:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(245,'2013-01-09 11:13:28','USER_LOGIN',1,'2013-01-09 12:13:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(246,'2013-01-10 18:30:46','USER_LOGIN',1,'2013-01-10 19:30:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(247,'2013-01-11 18:03:26','USER_LOGIN',1,'2013-01-11 19:03:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(248,'2013-01-12 11:15:04','USER_LOGIN',1,'2013-01-12 12:15:04',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(249,'2013-01-12 14:42:44','USER_LOGIN',1,'2013-01-12 15:42:44',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(250,'2013-01-13 12:07:17','USER_LOGIN',1,'2013-01-13 13:07:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(251,'2013-01-13 17:37:58','USER_LOGIN',1,'2013-01-13 18:37:58',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(252,'2013-01-13 19:24:21','USER_LOGIN',1,'2013-01-13 20:24:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(253,'2013-01-13 19:29:19','USER_LOGOUT',1,'2013-01-13 20:29:19',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(254,'2013-01-13 21:39:39','USER_LOGIN',1,'2013-01-13 22:39:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(255,'2013-01-14 00:52:21','USER_LOGIN',1,'2013-01-14 01:52:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',NULL),(256,'2013-01-16 11:34:31','USER_LOGIN',1,'2013-01-16 12:34:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(257,'2013-01-16 15:36:21','USER_LOGIN',1,'2013-01-16 16:36:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(258,'2013-01-16 19:17:36','USER_LOGIN',1,'2013-01-16 20:17:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(259,'2013-01-16 19:48:08','GROUP_CREATE',1,'2013-01-16 20:48:08',1,'Création groupe ggg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(260,'2013-01-16 21:48:53','USER_LOGIN',1,'2013-01-16 22:48:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(261,'2013-01-17 19:55:53','USER_LOGIN',1,'2013-01-17 20:55:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(262,'2013-01-18 09:48:01','USER_LOGIN',1,'2013-01-18 10:48:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(263,'2013-01-18 13:22:36','USER_LOGIN',1,'2013-01-18 14:22:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(264,'2013-01-18 16:10:23','USER_LOGIN',1,'2013-01-18 17:10:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(265,'2013-01-18 17:41:40','USER_LOGIN',1,'2013-01-18 18:41:40',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(266,'2013-01-19 14:33:48','USER_LOGIN',1,'2013-01-19 15:33:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(267,'2013-01-19 16:47:43','USER_LOGIN',1,'2013-01-19 17:47:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(268,'2013-01-19 16:59:43','USER_LOGIN',1,'2013-01-19 17:59:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(269,'2013-01-19 17:00:22','USER_LOGIN',1,'2013-01-19 18:00:22',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(270,'2013-01-19 17:04:16','USER_LOGOUT',1,'2013-01-19 18:04:16',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(271,'2013-01-19 17:04:18','USER_LOGIN',1,'2013-01-19 18:04:18',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(272,'2013-01-20 00:34:19','USER_LOGIN',1,'2013-01-20 01:34:19',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(273,'2013-01-21 11:54:17','USER_LOGIN',1,'2013-01-21 12:54:17',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(274,'2013-01-21 13:48:15','USER_LOGIN',1,'2013-01-21 14:48:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(275,'2013-01-21 14:30:22','USER_LOGIN',1,'2013-01-21 15:30:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(276,'2013-01-21 15:10:46','USER_LOGIN',1,'2013-01-21 16:10:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(277,'2013-01-21 17:27:43','USER_LOGIN',1,'2013-01-21 18:27:43',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(278,'2013-01-21 21:48:15','USER_LOGIN',1,'2013-01-21 22:48:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(279,'2013-01-21 21:50:42','USER_LOGIN',1,'2013-01-21 22:50:42',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17',NULL),(280,'2013-01-23 09:28:26','USER_LOGIN',1,'2013-01-23 10:28:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(281,'2013-01-23 13:21:57','USER_LOGIN',1,'2013-01-23 14:21:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(282,'2013-01-23 16:52:00','USER_LOGOUT',1,'2013-01-23 17:52:00',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(283,'2013-01-23 16:52:05','USER_LOGIN_FAILED',1,'2013-01-23 17:52:05',NULL,'Bad value for login or password - login=bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(284,'2013-01-23 16:52:09','USER_LOGIN',1,'2013-01-23 17:52:09',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(285,'2013-01-23 16:52:27','USER_CREATE',1,'2013-01-23 17:52:27',1,'Création utilisateur aaa','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(286,'2013-01-23 16:52:27','USER_NEW_PASSWORD',1,'2013-01-23 17:52:27',1,'Changement mot de passe de aaa','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(287,'2013-01-23 16:52:37','USER_CREATE',1,'2013-01-23 17:52:37',1,'Création utilisateur bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(288,'2013-01-23 16:52:37','USER_NEW_PASSWORD',1,'2013-01-23 17:52:37',1,'Changement mot de passe de bbb','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(289,'2013-01-23 16:53:15','USER_LOGOUT',1,'2013-01-23 17:53:15',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(290,'2013-01-23 16:53:20','USER_LOGIN',1,'2013-01-23 17:53:20',4,'(UserLogged,aaa)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(291,'2013-01-23 19:16:58','USER_LOGIN',1,'2013-01-23 20:16:58',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(292,'2013-01-26 10:54:07','USER_LOGIN',1,'2013-01-26 11:54:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(293,'2013-01-29 10:15:36','USER_LOGIN',1,'2013-01-29 11:15:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(294,'2013-01-30 17:42:50','USER_LOGIN',1,'2013-01-30 18:42:50',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17',NULL),(295,'2013-02-01 08:49:55','USER_LOGIN',1,'2013-02-01 09:49:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(296,'2013-02-01 08:51:57','USER_LOGOUT',1,'2013-02-01 09:51:57',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(297,'2013-02-01 08:52:39','USER_LOGIN',1,'2013-02-01 09:52:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(298,'2013-02-01 21:03:01','USER_LOGIN',1,'2013-02-01 22:03:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(299,'2013-02-10 19:48:39','USER_LOGIN',1,'2013-02-10 20:48:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(300,'2013-02-10 20:46:48','USER_LOGIN',1,'2013-02-10 21:46:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(301,'2013-02-10 21:39:23','USER_LOGIN',1,'2013-02-10 22:39:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(302,'2013-02-11 19:00:13','USER_LOGIN',1,'2013-02-11 20:00:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(303,'2013-02-11 19:43:44','USER_LOGIN_FAILED',1,'2013-02-11 20:43:44',NULL,'Unknown column \'u.fk_user\' in \'field list\'','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(304,'2013-02-11 19:44:01','USER_LOGIN',1,'2013-02-11 20:44:01',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(305,'2013-02-12 00:27:35','USER_LOGIN',1,'2013-02-12 01:27:35',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(306,'2013-02-12 00:27:38','USER_LOGOUT',1,'2013-02-12 01:27:38',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(307,'2013-02-12 00:28:07','USER_LOGIN',1,'2013-02-12 01:28:07',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(308,'2013-02-12 00:28:09','USER_LOGOUT',1,'2013-02-12 01:28:09',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(309,'2013-02-12 00:28:26','USER_LOGIN',1,'2013-02-12 01:28:26',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(310,'2013-02-12 00:28:30','USER_LOGOUT',1,'2013-02-12 01:28:30',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(311,'2013-02-12 12:42:15','USER_LOGIN',1,'2013-02-12 13:42:15',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17',NULL),(312,'2013-02-12 13:46:16','USER_LOGIN',1,'2013-02-12 14:46:16',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(313,'2013-02-12 14:54:28','USER_LOGIN',1,'2013-02-12 15:54:28',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(314,'2013-02-12 16:04:46','USER_LOGIN',1,'2013-02-12 17:04:46',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(315,'2013-02-13 14:02:43','USER_LOGIN',1,'2013-02-13 15:02:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(316,'2013-02-13 14:48:30','USER_LOGIN',1,'2013-02-13 15:48:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(317,'2013-02-13 17:44:53','USER_LOGIN',1,'2013-02-13 18:44:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(318,'2013-02-15 08:44:36','USER_LOGIN',1,'2013-02-15 09:44:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(319,'2013-02-15 08:53:20','USER_LOGIN',1,'2013-02-15 09:53:20',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(320,'2013-02-16 19:10:28','USER_LOGIN',1,'2013-02-16 20:10:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(321,'2013-02-16 19:22:40','USER_CREATE',1,'2013-02-16 20:22:40',1,'Création utilisateur aaab','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(322,'2013-02-16 19:22:40','USER_NEW_PASSWORD',1,'2013-02-16 20:22:40',1,'Changement mot de passe de aaab','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(323,'2013-02-16 19:48:15','USER_CREATE',1,'2013-02-16 20:48:15',1,'Création utilisateur zzz','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(324,'2013-02-16 19:48:15','USER_NEW_PASSWORD',1,'2013-02-16 20:48:15',1,'Changement mot de passe de zzz','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(325,'2013-02-16 19:50:08','USER_CREATE',1,'2013-02-16 20:50:08',1,'Création utilisateur zzzg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(326,'2013-02-16 19:50:08','USER_NEW_PASSWORD',1,'2013-02-16 20:50:08',1,'Changement mot de passe de zzzg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(327,'2013-02-16 21:20:03','USER_LOGIN',1,'2013-02-16 22:20:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(328,'2013-02-17 14:30:51','USER_LOGIN',1,'2013-02-17 15:30:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(329,'2013-02-17 17:21:22','USER_LOGIN',1,'2013-02-17 18:21:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(330,'2013-02-17 17:48:43','USER_MODIFY',1,'2013-02-17 18:48:43',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(331,'2013-02-17 17:48:47','USER_MODIFY',1,'2013-02-17 18:48:47',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(332,'2013-02-17 17:48:51','USER_MODIFY',1,'2013-02-17 18:48:51',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(333,'2013-02-17 17:48:56','USER_MODIFY',1,'2013-02-17 18:48:56',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(334,'2013-02-18 22:00:01','USER_LOGIN',1,'2013-02-18 23:00:01',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(335,'2013-02-19 08:19:52','USER_LOGIN',1,'2013-02-19 09:19:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(336,'2013-02-19 22:00:52','USER_LOGIN',1,'2013-02-19 23:00:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(337,'2013-02-20 09:34:52','USER_LOGIN',1,'2013-02-20 10:34:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(338,'2013-02-20 13:12:28','USER_LOGIN',1,'2013-02-20 14:12:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(339,'2013-02-20 17:19:44','USER_LOGIN',1,'2013-02-20 18:19:44',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(340,'2013-02-20 19:07:21','USER_MODIFY',1,'2013-02-20 20:07:21',1,'Modification utilisateur adupont','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(341,'2013-02-20 19:47:17','USER_LOGIN',1,'2013-02-20 20:47:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(342,'2013-02-20 19:48:01','USER_MODIFY',1,'2013-02-20 20:48:01',1,'Modification utilisateur aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(343,'2013-02-21 08:27:07','USER_LOGIN',1,'2013-02-21 09:27:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(344,'2013-02-23 13:34:13','USER_LOGIN',1,'2013-02-23 14:34:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.69 Safari/537.17',NULL),(345,'2013-02-24 01:06:41','USER_LOGIN_FAILED',1,'2013-02-24 02:06:41',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(346,'2013-02-24 01:06:45','USER_LOGIN_FAILED',1,'2013-02-24 02:06:45',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(347,'2013-02-24 01:06:55','USER_LOGIN_FAILED',1,'2013-02-24 02:06:55',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(348,'2013-02-24 01:07:03','USER_LOGIN_FAILED',1,'2013-02-24 02:07:03',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(349,'2013-02-24 01:07:21','USER_LOGIN_FAILED',1,'2013-02-24 02:07:21',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(350,'2013-02-24 01:08:12','USER_LOGIN_FAILED',1,'2013-02-24 02:08:12',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(351,'2013-02-24 01:08:42','USER_LOGIN_FAILED',1,'2013-02-24 02:08:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(352,'2013-02-24 01:08:50','USER_LOGIN_FAILED',1,'2013-02-24 02:08:50',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(353,'2013-02-24 01:09:08','USER_LOGIN_FAILED',1,'2013-02-24 02:09:08',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(354,'2013-02-24 01:09:42','USER_LOGIN_FAILED',1,'2013-02-24 02:09:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(355,'2013-02-24 01:09:50','USER_LOGIN_FAILED',1,'2013-02-24 02:09:50',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(356,'2013-02-24 01:10:05','USER_LOGIN_FAILED',1,'2013-02-24 02:10:05',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(357,'2013-02-24 01:10:22','USER_LOGIN_FAILED',1,'2013-02-24 02:10:22',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(358,'2013-02-24 01:10:30','USER_LOGIN_FAILED',1,'2013-02-24 02:10:30',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(359,'2013-02-24 01:10:56','USER_LOGIN_FAILED',1,'2013-02-24 02:10:56',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(360,'2013-02-24 01:11:26','USER_LOGIN_FAILED',1,'2013-02-24 02:11:26',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(361,'2013-02-24 01:12:06','USER_LOGIN_FAILED',1,'2013-02-24 02:12:06',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(362,'2013-02-24 01:21:14','USER_LOGIN_FAILED',1,'2013-02-24 02:21:14',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(363,'2013-02-24 01:21:25','USER_LOGIN_FAILED',1,'2013-02-24 02:21:25',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(364,'2013-02-24 01:21:54','USER_LOGIN_FAILED',1,'2013-02-24 02:21:54',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(365,'2013-02-24 01:22:14','USER_LOGIN_FAILED',1,'2013-02-24 02:22:14',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(366,'2013-02-24 01:22:37','USER_LOGIN_FAILED',1,'2013-02-24 02:22:37',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(367,'2013-02-24 01:23:01','USER_LOGIN_FAILED',1,'2013-02-24 02:23:01',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(368,'2013-02-24 01:23:39','USER_LOGIN_FAILED',1,'2013-02-24 02:23:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(369,'2013-02-24 01:24:04','USER_LOGIN_FAILED',1,'2013-02-24 02:24:04',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(370,'2013-02-24 01:24:39','USER_LOGIN_FAILED',1,'2013-02-24 02:24:39',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(371,'2013-02-24 01:25:01','USER_LOGIN_FAILED',1,'2013-02-24 02:25:01',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(372,'2013-02-24 01:25:12','USER_LOGIN_FAILED',1,'2013-02-24 02:25:12',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(373,'2013-02-24 01:27:30','USER_LOGIN_FAILED',1,'2013-02-24 02:27:30',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(374,'2013-02-24 01:28:00','USER_LOGIN_FAILED',1,'2013-02-24 02:28:00',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(375,'2013-02-24 01:28:35','USER_LOGIN_FAILED',1,'2013-02-24 02:28:35',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(376,'2013-02-24 01:29:03','USER_LOGIN_FAILED',1,'2013-02-24 02:29:03',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(377,'2013-02-24 01:29:55','USER_LOGIN_FAILED',1,'2013-02-24 02:29:55',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(378,'2013-02-24 01:32:40','USER_LOGIN_FAILED',1,'2013-02-24 02:32:40',NULL,'Bad value for login or password - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(379,'2013-02-24 01:39:33','USER_LOGIN_FAILED',1,'2013-02-24 02:39:33',NULL,'Identifiants login ou mot de passe incorrects - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(380,'2013-02-24 01:39:38','USER_LOGIN_FAILED',1,'2013-02-24 02:39:38',NULL,'Identifiants login ou mot de passe incorrects - login=aa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(381,'2013-02-24 01:39:47','USER_LOGIN_FAILED',1,'2013-02-24 02:39:47',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(382,'2013-02-24 01:40:54','USER_LOGIN_FAILED',1,'2013-02-24 02:40:54',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(383,'2013-02-24 01:47:57','USER_LOGIN_FAILED',1,'2013-02-24 02:47:57',NULL,'Identifiants login ou mot de passe incorrects - login=lmkm','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(384,'2013-02-24 01:48:05','USER_LOGIN_FAILED',1,'2013-02-24 02:48:05',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(385,'2013-02-24 01:48:07','USER_LOGIN_FAILED',1,'2013-02-24 02:48:07',NULL,'Unknown column \'u.lastname\' in \'field list\'','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(386,'2013-02-24 01:48:35','USER_LOGIN',1,'2013-02-24 02:48:35',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(387,'2013-02-24 01:56:32','USER_LOGIN',1,'2013-02-24 02:56:32',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(388,'2013-02-24 02:05:55','USER_LOGOUT',1,'2013-02-24 03:05:55',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(389,'2013-02-24 02:39:52','USER_LOGIN',1,'2013-02-24 03:39:52',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(390,'2013-02-24 02:51:10','USER_LOGOUT',1,'2013-02-24 03:51:10',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(391,'2013-02-24 12:46:41','USER_LOGIN',1,'2013-02-24 13:46:41',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(392,'2013-02-24 12:46:52','USER_LOGOUT',1,'2013-02-24 13:46:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(393,'2013-02-24 12:46:56','USER_LOGIN',1,'2013-02-24 13:46:56',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(394,'2013-02-24 12:47:56','USER_LOGOUT',1,'2013-02-24 13:47:56',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(395,'2013-02-24 12:48:00','USER_LOGIN',1,'2013-02-24 13:48:00',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(396,'2013-02-24 12:48:11','USER_LOGOUT',1,'2013-02-24 13:48:11',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(397,'2013-02-24 12:48:32','USER_LOGIN',1,'2013-02-24 13:48:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(398,'2013-02-24 12:52:22','USER_LOGOUT',1,'2013-02-24 13:52:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(399,'2013-02-24 12:52:27','USER_LOGIN',1,'2013-02-24 13:52:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(400,'2013-02-24 12:52:54','USER_LOGOUT',1,'2013-02-24 13:52:54',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(401,'2013-02-24 12:52:59','USER_LOGIN',1,'2013-02-24 13:52:59',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(402,'2013-02-24 12:55:39','USER_LOGOUT',1,'2013-02-24 13:55:39',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(403,'2013-02-24 12:55:59','USER_LOGIN',1,'2013-02-24 13:55:59',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(404,'2013-02-24 12:56:07','USER_LOGOUT',1,'2013-02-24 13:56:07',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(405,'2013-02-24 12:56:23','USER_LOGIN',1,'2013-02-24 13:56:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(406,'2013-02-24 12:56:46','USER_LOGOUT',1,'2013-02-24 13:56:46',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(407,'2013-02-24 12:58:30','USER_LOGIN',1,'2013-02-24 13:58:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(408,'2013-02-24 12:58:33','USER_LOGOUT',1,'2013-02-24 13:58:33',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(409,'2013-02-24 12:58:51','USER_LOGIN',1,'2013-02-24 13:58:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(410,'2013-02-24 12:58:58','USER_LOGOUT',1,'2013-02-24 13:58:58',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(411,'2013-02-24 13:18:53','USER_LOGIN',1,'2013-02-24 14:18:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(412,'2013-02-24 13:19:52','USER_LOGOUT',1,'2013-02-24 14:19:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(413,'2013-02-24 15:39:31','USER_LOGIN_FAILED',1,'2013-02-24 16:39:31',NULL,'ErrorBadValueForCode - login=admin','127.0.0.1',NULL,NULL),(414,'2013-02-24 15:42:07','USER_LOGIN',1,'2013-02-24 16:42:07',1,'(UserLogged,admin)','127.0.0.1',NULL,NULL),(415,'2013-02-24 15:42:52','USER_LOGOUT',1,'2013-02-24 16:42:52',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(416,'2013-02-24 16:04:21','USER_LOGIN',1,'2013-02-24 17:04:21',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(417,'2013-02-24 16:11:28','USER_LOGIN_FAILED',1,'2013-02-24 17:11:28',NULL,'ErrorBadValueForCode - login=admin','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(418,'2013-02-24 16:11:37','USER_LOGIN',1,'2013-02-24 17:11:37',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(419,'2013-02-24 16:36:52','USER_LOGOUT',1,'2013-02-24 17:36:52',1,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',NULL),(420,'2013-02-24 16:40:37','USER_LOGIN',1,'2013-02-24 17:40:37',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(421,'2013-02-24 16:57:16','USER_LOGIN',1,'2013-02-24 17:57:16',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(422,'2013-02-24 17:01:30','USER_LOGOUT',1,'2013-02-24 18:01:30',1,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(423,'2013-02-24 17:02:33','USER_LOGIN',1,'2013-02-24 18:02:33',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(424,'2013-02-24 17:14:22','USER_LOGOUT',1,'2013-02-24 18:14:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(425,'2013-02-24 17:15:07','USER_LOGIN_FAILED',1,'2013-02-24 18:15:07',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(426,'2013-02-24 17:15:20','USER_LOGIN',1,'2013-02-24 18:15:20',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(427,'2013-02-24 17:20:14','USER_LOGIN',1,'2013-02-24 18:20:14',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(428,'2013-02-24 17:20:51','USER_LOGIN',1,'2013-02-24 18:20:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(429,'2013-02-24 17:20:54','USER_LOGOUT',1,'2013-02-24 18:20:54',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(430,'2013-02-24 17:21:19','USER_LOGIN',1,'2013-02-24 18:21:19',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(431,'2013-02-24 17:32:35','USER_LOGIN',1,'2013-02-24 18:32:35',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 - 2131034114',NULL),(432,'2013-02-24 18:28:48','USER_LOGIN',1,'2013-02-24 19:28:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(433,'2013-02-24 18:29:27','USER_LOGOUT',1,'2013-02-24 19:29:27',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(434,'2013-02-24 18:29:32','USER_LOGIN',1,'2013-02-24 19:29:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7',NULL),(435,'2013-02-24 20:13:13','USER_LOGOUT',1,'2013-02-24 21:13:13',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(436,'2013-02-24 20:13:17','USER_LOGIN',1,'2013-02-24 21:13:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(437,'2013-02-25 08:57:16','USER_LOGIN',1,'2013-02-25 09:57:16',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(438,'2013-02-25 08:57:59','USER_LOGOUT',1,'2013-02-25 09:57:59',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(439,'2013-02-25 09:15:02','USER_LOGIN',1,'2013-02-25 10:15:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(440,'2013-02-25 09:15:50','USER_LOGOUT',1,'2013-02-25 10:15:50',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(441,'2013-02-25 09:15:57','USER_LOGIN',1,'2013-02-25 10:15:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(442,'2013-02-25 09:16:12','USER_LOGOUT',1,'2013-02-25 10:16:12',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(443,'2013-02-25 09:16:19','USER_LOGIN',1,'2013-02-25 10:16:19',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(444,'2013-02-25 09:16:25','USER_LOGOUT',1,'2013-02-25 10:16:25',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(445,'2013-02-25 09:16:39','USER_LOGIN_FAILED',1,'2013-02-25 10:16:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(446,'2013-02-25 09:16:42','USER_LOGIN_FAILED',1,'2013-02-25 10:16:42',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(447,'2013-02-25 09:16:54','USER_LOGIN_FAILED',1,'2013-02-25 10:16:54',NULL,'Identificadors d'usuari o contrasenya incorrectes - login=gfdg','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(448,'2013-02-25 09:17:53','USER_LOGIN',1,'2013-02-25 10:17:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(449,'2013-02-25 09:18:37','USER_LOGOUT',1,'2013-02-25 10:18:37',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(450,'2013-02-25 09:18:41','USER_LOGIN',1,'2013-02-25 10:18:41',4,'(UserLogged,aaa)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(451,'2013-02-25 09:18:47','USER_LOGOUT',1,'2013-02-25 10:18:47',4,'(UserLogoff,aaa)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(452,'2013-02-25 10:05:34','USER_LOGIN',1,'2013-02-25 11:05:34',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(453,'2013-02-26 21:51:40','USER_LOGIN',1,'2013-02-26 22:51:40',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(454,'2013-02-26 23:30:06','USER_LOGIN',1,'2013-02-27 00:30:06',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(455,'2013-02-27 14:13:11','USER_LOGIN',1,'2013-02-27 15:13:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(456,'2013-02-27 18:12:06','USER_LOGIN_FAILED',1,'2013-02-27 19:12:06',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(457,'2013-02-27 18:12:10','USER_LOGIN',1,'2013-02-27 19:12:10',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(458,'2013-02-27 20:20:08','USER_LOGIN',1,'2013-02-27 21:20:08',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(459,'2013-03-01 22:12:03','USER_LOGIN',1,'2013-03-01 23:12:03',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(460,'2013-03-02 11:45:50','USER_LOGIN',1,'2013-03-02 12:45:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(461,'2013-03-02 15:53:51','USER_LOGIN_FAILED',1,'2013-03-02 16:53:51',NULL,'Identifiants login ou mot de passe incorrects - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(462,'2013-03-02 15:53:53','USER_LOGIN',1,'2013-03-02 16:53:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(463,'2013-03-02 18:32:32','USER_LOGIN',1,'2013-03-02 19:32:32',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(464,'2013-03-02 22:59:36','USER_LOGIN',1,'2013-03-02 23:59:36',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(465,'2013-03-03 16:26:26','USER_LOGIN',1,'2013-03-03 17:26:26',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(466,'2013-03-03 22:50:27','USER_LOGIN',1,'2013-03-03 23:50:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(467,'2013-03-04 08:29:27','USER_LOGIN',1,'2013-03-04 09:29:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(468,'2013-03-04 18:27:28','USER_LOGIN',1,'2013-03-04 19:27:28',1,'(UserLogged,admin)','192.168.0.254','Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; NP06)',NULL),(469,'2013-03-04 19:27:23','USER_LOGIN',1,'2013-03-04 20:27:23',1,'(UserLogged,admin)','192.168.0.254','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',NULL),(470,'2013-03-04 19:35:14','USER_LOGIN',1,'2013-03-04 20:35:14',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(471,'2013-03-04 19:55:49','USER_LOGIN',1,'2013-03-04 20:55:49',1,'(UserLogged,admin)','192.168.0.254','Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)',NULL),(472,'2013-03-04 21:16:13','USER_LOGIN',1,'2013-03-04 22:16:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(473,'2013-03-05 10:17:30','USER_LOGIN',1,'2013-03-05 11:17:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(474,'2013-03-05 11:02:43','USER_LOGIN',1,'2013-03-05 12:02:43',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(475,'2013-03-05 23:14:39','USER_LOGIN',1,'2013-03-06 00:14:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(476,'2013-03-06 08:58:57','USER_LOGIN',1,'2013-03-06 09:58:57',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(477,'2013-03-06 14:29:40','USER_LOGIN',1,'2013-03-06 15:29:40',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(478,'2013-03-06 21:53:02','USER_LOGIN',1,'2013-03-06 22:53:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(479,'2013-03-07 21:14:39','USER_LOGIN',1,'2013-03-07 22:14:39',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(480,'2013-03-08 00:06:05','USER_LOGIN',1,'2013-03-08 01:06:05',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(481,'2013-03-08 01:38:13','USER_LOGIN',1,'2013-03-08 02:38:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(482,'2013-03-08 08:59:50','USER_LOGIN',1,'2013-03-08 09:59:50',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(483,'2013-03-09 12:08:51','USER_LOGIN',1,'2013-03-09 13:08:51',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(484,'2013-03-09 15:19:53','USER_LOGIN',1,'2013-03-09 16:19:53',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(495,'2013-03-09 18:06:21','USER_LOGIN',1,'2013-03-09 19:06:21',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(496,'2013-03-09 20:01:24','USER_LOGIN',1,'2013-03-09 21:01:24',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(497,'2013-03-09 23:36:45','USER_LOGIN',1,'2013-03-10 00:36:45',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(498,'2013-03-10 14:37:13','USER_LOGIN',1,'2013-03-10 15:37:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(499,'2013-03-10 17:54:12','USER_LOGIN',1,'2013-03-10 18:54:12',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(500,'2013-03-11 08:57:09','USER_LOGIN',1,'2013-03-11 09:57:09',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(501,'2013-03-11 22:05:13','USER_LOGIN',1,'2013-03-11 23:05:13',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(502,'2013-03-12 08:34:27','USER_LOGIN',1,'2013-03-12 09:34:27',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(503,'2013-03-13 09:11:02','USER_LOGIN',1,'2013-03-13 10:11:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(504,'2013-03-13 10:02:11','USER_LOGIN',1,'2013-03-13 11:02:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(505,'2013-03-13 13:20:58','USER_LOGIN',1,'2013-03-13 14:20:58',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(506,'2013-03-13 16:19:28','USER_LOGIN',1,'2013-03-13 17:19:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(507,'2013-03-13 18:34:30','USER_LOGIN',1,'2013-03-13 19:34:30',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(508,'2013-03-14 08:25:02','USER_LOGIN',1,'2013-03-14 09:25:02',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(509,'2013-03-14 19:15:22','USER_LOGIN',1,'2013-03-14 20:15:22',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(510,'2013-03-14 21:58:53','USER_LOGIN',1,'2013-03-14 22:58:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(511,'2013-03-14 21:58:59','USER_LOGOUT',1,'2013-03-14 22:58:59',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(512,'2013-03-14 21:59:07','USER_LOGIN',1,'2013-03-14 22:59:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(513,'2013-03-14 22:58:22','USER_LOGOUT',1,'2013-03-14 23:58:22',1,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(514,'2013-03-14 23:00:25','USER_LOGIN',1,'2013-03-15 00:00:25',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(515,'2013-03-16 12:14:28','USER_LOGIN',1,'2013-03-16 13:14:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(516,'2013-03-16 16:09:01','USER_LOGIN',1,'2013-03-16 17:09:01',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(517,'2013-03-16 16:57:11','USER_LOGIN',1,'2013-03-16 17:57:11',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(518,'2013-03-16 19:31:31','USER_LOGIN',1,'2013-03-16 20:31:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22',NULL),(519,'2013-03-17 17:44:39','USER_LOGIN',1,'2013-03-17 18:44:39',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(520,'2013-03-17 20:40:57','USER_LOGIN',1,'2013-03-17 21:40:57',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(521,'2013-03-17 23:14:05','USER_LOGIN',1,'2013-03-18 00:14:05',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(522,'2013-03-17 23:28:47','USER_LOGOUT',1,'2013-03-18 00:28:47',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(523,'2013-03-17 23:28:54','USER_LOGIN',1,'2013-03-18 00:28:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(524,'2013-03-18 17:37:30','USER_LOGIN',1,'2013-03-18 18:37:30',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(525,'2013-03-18 18:11:37','USER_LOGIN',1,'2013-03-18 19:11:37',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(526,'2013-03-19 08:35:08','USER_LOGIN',1,'2013-03-19 09:35:08',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(527,'2013-03-19 09:20:23','USER_LOGIN',1,'2013-03-19 10:20:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(528,'2013-03-20 13:17:13','USER_LOGIN',1,'2013-03-20 14:17:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(529,'2013-03-20 14:44:31','USER_LOGIN',1,'2013-03-20 15:44:31',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(530,'2013-03-20 18:24:25','USER_LOGIN',1,'2013-03-20 19:24:25',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(531,'2013-03-20 19:15:54','USER_LOGIN',1,'2013-03-20 20:15:54',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(532,'2013-03-21 18:40:47','USER_LOGIN',1,'2013-03-21 19:40:47',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(533,'2013-03-21 21:42:24','USER_LOGIN',1,'2013-03-21 22:42:24',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(534,'2013-03-22 08:39:23','USER_LOGIN',1,'2013-03-22 09:39:23',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(535,'2013-03-23 13:04:55','USER_LOGIN',1,'2013-03-23 14:04:55',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(536,'2013-03-23 15:47:43','USER_LOGIN',1,'2013-03-23 16:47:43',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(537,'2013-03-23 22:56:36','USER_LOGIN',1,'2013-03-23 23:56:36',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(538,'2013-03-24 01:22:32','USER_LOGIN',1,'2013-03-24 02:22:32',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(539,'2013-03-24 14:40:42','USER_LOGIN',1,'2013-03-24 15:40:42',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(540,'2013-03-24 15:30:26','USER_LOGOUT',1,'2013-03-24 16:30:26',1,'(UserLogoff,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(541,'2013-03-24 15:30:29','USER_LOGIN',1,'2013-03-24 16:30:29',2,'(UserLogged,demo)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(542,'2013-03-24 15:49:40','USER_LOGOUT',1,'2013-03-24 16:49:40',2,'(UserLogoff,demo)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(543,'2013-03-24 15:49:48','USER_LOGIN',1,'2013-03-24 16:49:48',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(544,'2013-03-24 15:52:35','USER_MODIFY',1,'2013-03-24 16:52:35',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(545,'2013-03-24 15:52:52','USER_MODIFY',1,'2013-03-24 16:52:52',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(546,'2013-03-24 15:53:09','USER_MODIFY',1,'2013-03-24 16:53:09',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(547,'2013-03-24 15:53:23','USER_MODIFY',1,'2013-03-24 16:53:23',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(548,'2013-03-24 16:00:04','USER_MODIFY',1,'2013-03-24 17:00:04',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(549,'2013-03-24 16:01:50','USER_MODIFY',1,'2013-03-24 17:01:50',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(550,'2013-03-24 16:10:14','USER_MODIFY',1,'2013-03-24 17:10:14',1,'Modification utilisateur zzzg','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(551,'2013-03-24 16:55:13','USER_LOGIN',1,'2013-03-24 17:55:13',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(552,'2013-03-24 17:44:29','USER_LOGIN',1,'2013-03-24 18:44:29',1,'(UserLogged,admin)','::1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',NULL),(553,'2013-09-08 23:06:26','USER_LOGIN',1,'2013-09-09 01:06:26',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36',NULL),(554,'2013-10-21 22:32:28','USER_LOGIN',1,'2013-10-22 00:32:28',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36',NULL),(555,'2013-10-21 22:32:48','USER_LOGIN',1,'2013-10-22 00:32:48',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36',NULL),(556,'2013-11-07 00:01:51','USER_LOGIN',1,'2013-11-07 01:01:51',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36',NULL),(557,'2014-03-02 15:21:07','USER_LOGIN',1,'2014-03-02 16:21:07',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(558,'2014-03-02 15:36:53','USER_LOGIN',1,'2014-03-02 16:36:53',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(559,'2014-03-02 18:54:23','USER_LOGIN',1,'2014-03-02 19:54:23',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(560,'2014-03-02 19:11:17','USER_LOGIN',1,'2014-03-02 20:11:17',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(561,'2014-03-03 18:19:24','USER_LOGIN',1,'2014-03-03 19:19:24',1,'(UserLogged,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36',NULL),(562,'2014-12-21 12:51:38','USER_LOGIN',1,'2014-12-21 13:51:38',1,'(UserLogged,admin) - TZ=1;TZString=CET;Screen=1920x969','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36',NULL),(563,'2014-12-21 19:52:09','USER_LOGIN',1,'2014-12-21 20:52:09',1,'(UserLogged,admin) - TZ=1;TZString=CET;Screen=1920x969','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36',NULL),(566,'2015-10-03 08:49:43','USER_NEW_PASSWORD',1,'2015-10-03 10:49:43',1,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(567,'2015-10-03 08:49:43','USER_MODIFY',1,'2015-10-03 10:49:43',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(568,'2015-10-03 09:03:12','USER_MODIFY',1,'2015-10-03 11:03:12',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(569,'2015-10-03 09:03:42','USER_MODIFY',1,'2015-10-03 11:03:42',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(570,'2015-10-03 09:07:36','USER_MODIFY',1,'2015-10-03 11:07:36',1,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(571,'2015-10-03 09:08:58','USER_NEW_PASSWORD',1,'2015-10-03 11:08:58',1,'Password change for pcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(572,'2015-10-03 09:08:58','USER_MODIFY',1,'2015-10-03 11:08:58',1,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(573,'2015-10-03 09:09:23','USER_MODIFY',1,'2015-10-03 11:09:23',1,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(574,'2015-10-03 09:11:04','USER_NEW_PASSWORD',1,'2015-10-03 11:11:04',1,'Password change for athestudent','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(575,'2015-10-03 09:11:04','USER_MODIFY',1,'2015-10-03 11:11:04',1,'User athestudent modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(576,'2015-10-03 09:11:53','USER_MODIFY',1,'2015-10-03 11:11:53',1,'User abookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(577,'2015-10-03 09:42:12','USER_LOGIN_FAILED',1,'2015-10-03 11:42:11',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(578,'2015-10-03 09:42:19','USER_LOGIN_FAILED',1,'2015-10-03 11:42:19',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(579,'2015-10-03 09:42:42','USER_LOGIN_FAILED',1,'2015-10-03 11:42:42',NULL,'Bad value for login or password - login=aeinstein','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(580,'2015-10-03 09:43:50','USER_LOGIN',1,'2015-10-03 11:43:50',1,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x788','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(581,'2015-10-03 09:44:44','GROUP_MODIFY',1,'2015-10-03 11:44:44',1,'Group Sale representatives modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(582,'2015-10-03 09:46:25','GROUP_CREATE',1,'2015-10-03 11:46:25',1,'Group Management created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(583,'2015-10-03 09:46:46','GROUP_CREATE',1,'2015-10-03 11:46:46',1,'Group Scientists created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(584,'2015-10-03 09:47:41','USER_CREATE',1,'2015-10-03 11:47:41',1,'User mcurie created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(585,'2015-10-03 09:47:41','USER_NEW_PASSWORD',1,'2015-10-03 11:47:41',1,'Password change for mcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(586,'2015-10-03 09:47:53','USER_MODIFY',1,'2015-10-03 11:47:53',1,'User mcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(587,'2015-10-03 09:48:32','USER_DELETE',1,'2015-10-03 11:48:32',1,'User bbb removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(588,'2015-10-03 09:48:52','USER_MODIFY',1,'2015-10-03 11:48:52',1,'User bookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(589,'2015-10-03 10:01:28','USER_MODIFY',1,'2015-10-03 12:01:28',1,'User bookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(590,'2015-10-03 10:01:39','USER_MODIFY',1,'2015-10-03 12:01:39',1,'User bookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(591,'2015-10-05 06:32:38','USER_LOGIN_FAILED',1,'2015-10-05 08:32:38',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(592,'2015-10-05 06:32:44','USER_LOGIN',1,'2015-10-05 08:32:44',1,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(593,'2015-10-05 07:07:52','USER_CREATE',1,'2015-10-05 09:07:52',1,'User atheceo created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(594,'2015-10-05 07:07:52','USER_NEW_PASSWORD',1,'2015-10-05 09:07:52',1,'Password change for atheceo','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(595,'2015-10-05 07:09:08','USER_NEW_PASSWORD',1,'2015-10-05 09:09:08',1,'Password change for aeinstein','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(596,'2015-10-05 07:09:08','USER_MODIFY',1,'2015-10-05 09:09:08',1,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(597,'2015-10-05 07:09:46','USER_CREATE',1,'2015-10-05 09:09:46',1,'User admin created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(598,'2015-10-05 07:09:46','USER_NEW_PASSWORD',1,'2015-10-05 09:09:46',1,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(599,'2015-10-05 07:10:20','USER_MODIFY',1,'2015-10-05 09:10:20',1,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(600,'2015-10-05 07:10:48','USER_MODIFY',1,'2015-10-05 09:10:48',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(601,'2015-10-05 07:11:22','USER_NEW_PASSWORD',1,'2015-10-05 09:11:22',1,'Password change for bbookkeeper','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(602,'2015-10-05 07:11:22','USER_MODIFY',1,'2015-10-05 09:11:22',1,'User bbookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(603,'2015-10-05 07:12:37','USER_MODIFY',1,'2015-10-05 09:12:37',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(604,'2015-10-05 07:13:27','USER_MODIFY',1,'2015-10-05 09:13:27',1,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(605,'2015-10-05 07:13:52','USER_MODIFY',1,'2015-10-05 09:13:52',1,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(606,'2015-10-05 07:14:35','USER_LOGOUT',1,'2015-10-05 09:14:35',1,'(UserLogoff,aeinstein)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(607,'2015-10-05 07:14:40','USER_LOGIN_FAILED',1,'2015-10-05 09:14:40',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(608,'2015-10-05 07:14:44','USER_LOGIN_FAILED',1,'2015-10-05 09:14:44',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(609,'2015-10-05 07:14:49','USER_LOGIN',1,'2015-10-05 09:14:49',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(610,'2015-10-05 07:57:18','USER_MODIFY',1,'2015-10-05 09:57:18',12,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(611,'2015-10-05 08:06:54','USER_LOGOUT',1,'2015-10-05 10:06:54',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(612,'2015-10-05 08:07:03','USER_LOGIN',1,'2015-10-05 10:07:03',11,'(UserLogged,atheceo) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(613,'2015-10-05 19:18:46','USER_LOGIN',1,'2015-10-05 21:18:46',11,'(UserLogged,atheceo) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(614,'2015-10-05 19:29:35','USER_CREATE',1,'2015-10-05 21:29:35',11,'User ccommercy created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(615,'2015-10-05 19:29:35','USER_NEW_PASSWORD',1,'2015-10-05 21:29:35',11,'Password change for ccommercy','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(616,'2015-10-05 19:30:13','GROUP_CREATE',1,'2015-10-05 21:30:13',11,'Group Commercial created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(617,'2015-10-05 19:31:37','USER_NEW_PASSWORD',1,'2015-10-05 21:31:37',11,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(618,'2015-10-05 19:31:37','USER_MODIFY',1,'2015-10-05 21:31:37',11,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(619,'2015-10-05 19:32:00','USER_MODIFY',1,'2015-10-05 21:32:00',11,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(620,'2015-10-05 19:33:33','USER_CREATE',1,'2015-10-05 21:33:33',11,'User sscientol created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(621,'2015-10-05 19:33:33','USER_NEW_PASSWORD',1,'2015-10-05 21:33:33',11,'Password change for sscientol','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(622,'2015-10-05 19:33:47','USER_NEW_PASSWORD',1,'2015-10-05 21:33:47',11,'Password change for mcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(623,'2015-10-05 19:33:47','USER_MODIFY',1,'2015-10-05 21:33:47',11,'User mcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(624,'2015-10-05 19:34:23','USER_NEW_PASSWORD',1,'2015-10-05 21:34:23',11,'Password change for pcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(625,'2015-10-05 19:34:23','USER_MODIFY',1,'2015-10-05 21:34:23',11,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(626,'2015-10-05 19:34:42','USER_MODIFY',1,'2015-10-05 21:34:42',11,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(627,'2015-10-05 19:36:06','USER_NEW_PASSWORD',1,'2015-10-05 21:36:06',11,'Password change for ccommercy','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(628,'2015-10-05 19:36:06','USER_MODIFY',1,'2015-10-05 21:36:06',11,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(629,'2015-10-05 19:36:57','USER_NEW_PASSWORD',1,'2015-10-05 21:36:57',11,'Password change for atheceo','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(630,'2015-10-05 19:36:57','USER_MODIFY',1,'2015-10-05 21:36:57',11,'User atheceo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(631,'2015-10-05 19:37:27','USER_LOGOUT',1,'2015-10-05 21:37:27',11,'(UserLogoff,atheceo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(632,'2015-10-05 19:37:35','USER_LOGIN_FAILED',1,'2015-10-05 21:37:35',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(633,'2015-10-05 19:37:39','USER_LOGIN_FAILED',1,'2015-10-05 21:37:39',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(634,'2015-10-05 19:37:44','USER_LOGIN_FAILED',1,'2015-10-05 21:37:44',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(635,'2015-10-05 19:37:49','USER_LOGIN_FAILED',1,'2015-10-05 21:37:49',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(636,'2015-10-05 19:38:12','USER_LOGIN_FAILED',1,'2015-10-05 21:38:12',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(637,'2015-10-05 19:40:48','USER_LOGIN_FAILED',1,'2015-10-05 21:40:48',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(638,'2015-10-05 19:40:55','USER_LOGIN',1,'2015-10-05 21:40:55',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(639,'2015-10-05 19:43:34','USER_MODIFY',1,'2015-10-05 21:43:34',12,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(640,'2015-10-05 19:45:43','USER_CREATE',1,'2015-10-05 21:45:43',12,'User aaa created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(641,'2015-10-05 19:45:43','USER_NEW_PASSWORD',1,'2015-10-05 21:45:43',12,'Password change for aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(642,'2015-10-05 19:46:18','USER_DELETE',1,'2015-10-05 21:46:18',12,'User aaa removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(643,'2015-10-05 19:47:09','USER_MODIFY',1,'2015-10-05 21:47:09',12,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(644,'2015-10-05 19:47:22','USER_MODIFY',1,'2015-10-05 21:47:22',12,'User demo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(645,'2015-10-05 19:52:05','USER_MODIFY',1,'2015-10-05 21:52:05',12,'User sscientol modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(646,'2015-10-05 19:52:23','USER_MODIFY',1,'2015-10-05 21:52:23',12,'User bbookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(647,'2015-10-05 19:54:54','USER_NEW_PASSWORD',1,'2015-10-05 21:54:54',12,'Password change for zzeceo','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(648,'2015-10-05 19:54:54','USER_MODIFY',1,'2015-10-05 21:54:54',12,'User zzeceo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(649,'2015-10-05 19:57:02','USER_MODIFY',1,'2015-10-05 21:57:02',12,'User zzeceo modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(650,'2015-10-05 19:57:57','USER_NEW_PASSWORD',1,'2015-10-05 21:57:57',12,'Password change for pcurie','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(651,'2015-10-05 19:57:57','USER_MODIFY',1,'2015-10-05 21:57:57',12,'User pcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(652,'2015-10-05 19:59:42','USER_NEW_PASSWORD',1,'2015-10-05 21:59:42',12,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(653,'2015-10-05 19:59:42','USER_MODIFY',1,'2015-10-05 21:59:42',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(654,'2015-10-05 20:00:21','USER_MODIFY',1,'2015-10-05 22:00:21',12,'User adminx modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(655,'2015-10-05 20:05:36','USER_MODIFY',1,'2015-10-05 22:05:36',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(656,'2015-10-05 20:06:25','USER_MODIFY',1,'2015-10-05 22:06:25',12,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(657,'2015-10-05 20:07:18','USER_MODIFY',1,'2015-10-05 22:07:18',12,'User mcurie modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(658,'2015-10-05 20:07:36','USER_MODIFY',1,'2015-10-05 22:07:36',12,'User aeinstein modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(659,'2015-10-05 20:08:34','USER_MODIFY',1,'2015-10-05 22:08:34',12,'User bbookkeeper modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(660,'2015-10-05 20:47:52','USER_CREATE',1,'2015-10-05 22:47:52',12,'User cc1 created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(661,'2015-10-05 20:47:52','USER_NEW_PASSWORD',1,'2015-10-05 22:47:52',12,'Password change for cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(662,'2015-10-05 20:47:55','USER_LOGOUT',1,'2015-10-05 22:47:55',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(663,'2015-10-05 20:48:08','USER_LOGIN',1,'2015-10-05 22:48:08',11,'(UserLogged,zzeceo) - TZ=1;TZString=Europe/Berlin;Screen=1590x434','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(664,'2015-10-05 20:48:39','USER_CREATE',1,'2015-10-05 22:48:39',11,'User cc2 created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(665,'2015-10-05 20:48:39','USER_NEW_PASSWORD',1,'2015-10-05 22:48:39',11,'Password change for cc2','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(666,'2015-10-05 20:48:59','USER_NEW_PASSWORD',1,'2015-10-05 22:48:59',11,'Password change for cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(667,'2015-10-05 20:48:59','USER_MODIFY',1,'2015-10-05 22:48:59',11,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(668,'2015-10-05 21:06:36','USER_LOGOUT',1,'2015-10-05 23:06:35',11,'(UserLogoff,zzeceo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(669,'2015-10-05 21:06:44','USER_LOGIN_FAILED',1,'2015-10-05 23:06:44',NULL,'Bad value for login or password - login=cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(670,'2015-10-05 21:07:12','USER_LOGIN_FAILED',1,'2015-10-05 23:07:12',NULL,'Bad value for login or password - login=cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(671,'2015-10-05 21:07:19','USER_LOGIN_FAILED',1,'2015-10-05 23:07:19',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(672,'2015-10-05 21:07:27','USER_LOGIN_FAILED',1,'2015-10-05 23:07:27',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(673,'2015-10-05 21:07:32','USER_LOGIN',1,'2015-10-05 23:07:32',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(674,'2015-10-05 21:12:28','USER_NEW_PASSWORD',1,'2015-10-05 23:12:28',12,'Password change for cc1','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(675,'2015-10-05 21:12:28','USER_MODIFY',1,'2015-10-05 23:12:28',12,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(676,'2015-10-05 21:13:00','USER_CREATE',1,'2015-10-05 23:13:00',12,'User aaa created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(677,'2015-10-05 21:13:00','USER_NEW_PASSWORD',1,'2015-10-05 23:13:00',12,'Password change for aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(678,'2015-10-05 21:13:40','USER_DELETE',1,'2015-10-05 23:13:40',12,'User aaa removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(679,'2015-10-05 21:14:47','USER_LOGOUT',1,'2015-10-05 23:14:47',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(680,'2015-10-05 21:14:56','USER_LOGIN',1,'2015-10-05 23:14:56',16,'(UserLogged,cc1) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(681,'2015-10-05 21:15:56','USER_LOGOUT',1,'2015-10-05 23:15:56',16,'(UserLogoff,cc1)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(682,'2015-10-05 21:16:06','USER_LOGIN',1,'2015-10-05 23:16:06',17,'(UserLogged,cc2) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(683,'2015-10-05 21:37:25','USER_LOGOUT',1,'2015-10-05 23:37:25',17,'(UserLogoff,cc2)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(684,'2015-10-05 21:37:31','USER_LOGIN',1,'2015-10-05 23:37:31',16,'(UserLogged,cc1) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(685,'2015-10-05 21:43:53','USER_LOGOUT',1,'2015-10-05 23:43:53',16,'(UserLogoff,cc1)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(686,'2015-10-05 21:44:00','USER_LOGIN',1,'2015-10-05 23:44:00',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(687,'2015-10-05 21:46:17','USER_LOGOUT',1,'2015-10-05 23:46:17',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(688,'2015-10-05 21:46:24','USER_LOGIN',1,'2015-10-05 23:46:24',16,'(UserLogged,cc1) - TZ=1;TZString=Europe/Berlin;Screen=1590x767','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',NULL),(689,'2015-11-04 15:17:06','USER_LOGIN',1,'2015-11-04 16:17:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(690,'2015-11-15 22:04:04','USER_LOGIN',1,'2015-11-15 23:04:04',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(691,'2015-11-15 22:23:45','USER_MODIFY',1,'2015-11-15 23:23:45',12,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(692,'2015-11-15 22:24:22','USER_MODIFY',1,'2015-11-15 23:24:22',12,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(693,'2015-11-15 22:24:53','USER_MODIFY',1,'2015-11-15 23:24:53',12,'User cc2 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(694,'2015-11-15 22:25:17','USER_MODIFY',1,'2015-11-15 23:25:17',12,'User cc1 modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(695,'2015-11-15 22:45:37','USER_LOGOUT',1,'2015-11-15 23:45:37',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(696,'2015-11-18 13:41:02','USER_LOGIN',1,'2015-11-18 14:41:02',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(697,'2015-11-18 14:23:35','USER_LOGIN',1,'2015-11-18 15:23:35',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(698,'2015-11-18 15:15:46','USER_LOGOUT',1,'2015-11-18 16:15:46',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(699,'2015-11-18 15:15:51','USER_LOGIN',1,'2015-11-18 16:15:51',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(700,'2015-11-30 17:52:08','USER_LOGIN',1,'2015-11-30 18:52:08',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(701,'2016-01-10 16:45:43','USER_LOGIN',1,'2016-01-10 17:45:43',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(702,'2016-01-10 16:45:52','USER_LOGOUT',1,'2016-01-10 17:45:52',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(703,'2016-01-10 16:46:06','USER_LOGIN',1,'2016-01-10 17:46:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(704,'2016-01-16 14:53:47','USER_LOGIN',1,'2016-01-16 15:53:47',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(705,'2016-01-16 15:04:29','USER_LOGOUT',1,'2016-01-16 16:04:29',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(706,'2016-01-16 15:04:40','USER_LOGIN',1,'2016-01-16 16:04:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(707,'2016-01-22 09:33:26','USER_LOGIN',1,'2016-01-22 10:33:26',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(708,'2016-01-22 09:35:19','USER_LOGOUT',1,'2016-01-22 10:35:19',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(709,'2016-01-22 09:35:29','USER_LOGIN',1,'2016-01-22 10:35:29',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(710,'2016-01-22 10:47:34','USER_CREATE',1,'2016-01-22 11:47:34',12,'User aaa created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(711,'2016-01-22 10:47:34','USER_NEW_PASSWORD',1,'2016-01-22 11:47:34',12,'Password change for aaa','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(712,'2016-01-22 12:07:56','USER_LOGIN',1,'2016-01-22 13:07:56',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(713,'2016-01-22 12:36:25','USER_NEW_PASSWORD',1,'2016-01-22 13:36:25',12,'Password change for admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(714,'2016-01-22 12:36:25','USER_MODIFY',1,'2016-01-22 13:36:25',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(715,'2016-01-22 12:56:32','USER_MODIFY',1,'2016-01-22 13:56:32',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(716,'2016-01-22 12:58:05','USER_MODIFY',1,'2016-01-22 13:58:05',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(717,'2016-01-22 13:01:02','USER_MODIFY',1,'2016-01-22 14:01:02',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(718,'2016-01-22 13:01:18','USER_MODIFY',1,'2016-01-22 14:01:18',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(719,'2016-01-22 13:13:42','USER_MODIFY',1,'2016-01-22 14:13:42',12,'User admin modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(720,'2016-01-22 13:15:20','USER_DELETE',1,'2016-01-22 14:15:20',12,'User aaa removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(721,'2016-01-22 13:19:21','USER_LOGOUT',1,'2016-01-22 14:19:21',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(722,'2016-01-22 13:19:32','USER_LOGIN',1,'2016-01-22 14:19:32',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(723,'2016-01-22 13:19:51','USER_LOGOUT',1,'2016-01-22 14:19:51',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(724,'2016-01-22 13:20:01','USER_LOGIN',1,'2016-01-22 14:20:01',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(725,'2016-01-22 13:28:22','USER_LOGOUT',1,'2016-01-22 14:28:22',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(726,'2016-01-22 13:28:35','USER_LOGIN',1,'2016-01-22 14:28:35',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(727,'2016-01-22 13:33:54','USER_LOGOUT',1,'2016-01-22 14:33:54',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(728,'2016-01-22 13:34:05','USER_LOGIN',1,'2016-01-22 14:34:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(729,'2016-01-22 13:51:46','USER_MODIFY',1,'2016-01-22 14:51:46',12,'User ccommercy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',NULL),(730,'2016-01-22 16:20:12','USER_LOGIN',1,'2016-01-22 17:20:12',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(731,'2016-01-22 16:20:22','USER_LOGOUT',1,'2016-01-22 17:20:22',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(732,'2016-01-22 16:20:36','USER_LOGIN',1,'2016-01-22 17:20:36',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(733,'2016-01-22 16:27:02','USER_CREATE',1,'2016-01-22 17:27:02',12,'User ldestailleur created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(734,'2016-01-22 16:27:02','USER_NEW_PASSWORD',1,'2016-01-22 17:27:02',12,'Password change for ldestailleur','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(735,'2016-01-22 16:28:34','USER_MODIFY',1,'2016-01-22 17:28:34',12,'User ldestailleur modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(736,'2016-01-22 16:30:01','USER_ENABLEDISABLE',1,'2016-01-22 17:30:01',12,'User cc2 activated','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(737,'2016-01-22 17:11:06','USER_LOGIN',1,'2016-01-22 18:11:06',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=1600x790','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(738,'2016-01-22 18:00:02','USER_DELETE',1,'2016-01-22 19:00:02',12,'User zzz removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(739,'2016-01-22 18:01:40','USER_DELETE',1,'2016-01-22 19:01:40',12,'User aaab removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(740,'2016-01-22 18:01:52','USER_DELETE',1,'2016-01-22 19:01:52',12,'User zzzg removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36',NULL),(741,'2016-03-13 10:54:59','USER_LOGIN',1,'2016-03-13 14:54:59',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x971','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36',NULL),(742,'2016-07-30 11:13:10','USER_LOGIN',1,'2016-07-30 15:13:10',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(743,'2016-07-30 12:50:23','USER_CREATE',1,'2016-07-30 16:50:23',12,'User eldy created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(744,'2016-07-30 12:50:23','USER_CREATE',1,'2016-07-30 16:50:23',12,'User eldy created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(745,'2016-07-30 12:50:23','USER_NEW_PASSWORD',1,'2016-07-30 16:50:23',12,'Password change for eldy','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(746,'2016-07-30 12:50:38','USER_MODIFY',1,'2016-07-30 16:50:38',12,'User eldy modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(747,'2016-07-30 12:50:54','USER_DELETE',1,'2016-07-30 16:50:54',12,'User eldy removed','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(748,'2016-07-30 12:51:23','USER_NEW_PASSWORD',1,'2016-07-30 16:51:23',12,'Password change for ldestailleur','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(749,'2016-07-30 12:51:23','USER_MODIFY',1,'2016-07-30 16:51:23',12,'User ldestailleur modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(750,'2016-07-30 18:26:58','USER_LOGIN',1,'2016-07-30 22:26:58',18,'(UserLogged,ldestailleur) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(751,'2016-07-30 18:27:40','USER_LOGOUT',1,'2016-07-30 22:27:40',18,'(UserLogoff,ldestailleur)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(752,'2016-07-30 18:27:47','USER_LOGIN',1,'2016-07-30 22:27:47',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(753,'2016-07-30 19:00:00','USER_LOGOUT',1,'2016-07-30 23:00:00',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(754,'2016-07-30 19:00:04','USER_LOGIN',1,'2016-07-30 23:00:04',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(755,'2016-07-30 19:00:14','USER_LOGOUT',1,'2016-07-30 23:00:14',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(756,'2016-07-30 19:00:19','USER_LOGIN',1,'2016-07-30 23:00:19',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(757,'2016-07-30 19:00:43','USER_LOGOUT',1,'2016-07-30 23:00:43',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(758,'2016-07-30 19:00:48','USER_LOGIN',1,'2016-07-30 23:00:48',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(759,'2016-07-30 19:03:52','USER_LOGOUT',1,'2016-07-30 23:03:52',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(760,'2016-07-30 19:03:57','USER_LOGIN_FAILED',1,'2016-07-30 23:03:57',NULL,'Bad value for login or password - login=admin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(761,'2016-07-30 19:03:59','USER_LOGIN',1,'2016-07-30 23:03:59',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(762,'2016-07-30 19:04:13','USER_LOGOUT',1,'2016-07-30 23:04:13',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(763,'2016-07-30 19:04:17','USER_LOGIN',1,'2016-07-30 23:04:17',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(764,'2016-07-30 19:04:26','USER_LOGOUT',1,'2016-07-30 23:04:26',2,'(UserLogoff,demo)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(765,'2016-07-30 19:04:31','USER_LOGIN',1,'2016-07-30 23:04:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(766,'2016-07-30 19:10:50','USER_LOGOUT',1,'2016-07-30 23:10:50',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(767,'2016-07-30 19:10:54','USER_LOGIN',1,'2016-07-30 23:10:54',2,'(UserLogged,demo) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(768,'2016-07-31 10:15:52','USER_LOGIN',1,'2016-07-31 14:15:52',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Lynx/2.8.8pre.4 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.23',NULL),(769,'2016-07-31 10:16:27','USER_LOGIN',1,'2016-07-31 14:16:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(770,'2016-07-31 10:32:14','USER_LOGIN',1,'2016-07-31 14:32:14',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Lynx/2.8.8pre.4 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.23',NULL),(771,'2016-07-31 10:36:28','USER_LOGIN',1,'2016-07-31 14:36:28',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Links (2.8; Linux 3.19.0-46-generic x86_64; GNU C 4.8.2; text)',NULL),(772,'2016-07-31 10:40:10','USER_LOGIN',1,'2016-07-31 14:40:10',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Links (2.8; Linux 3.19.0-46-generic x86_64; GNU C 4.8.2; text)',NULL),(773,'2016-07-31 10:54:16','USER_LOGIN',1,'2016-07-31 14:54:16',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Lynx/2.8.8pre.4 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.23',NULL),(774,'2016-07-31 12:52:52','USER_LOGIN',1,'2016-07-31 16:52:52',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x592','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(775,'2016-07-31 13:25:33','USER_LOGOUT',1,'2016-07-31 17:25:33',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(776,'2016-07-31 13:26:32','USER_LOGIN',1,'2016-07-31 17:26:32',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1280x751','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(777,'2016-07-31 14:13:57','USER_LOGOUT',1,'2016-07-31 18:13:57',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(778,'2016-07-31 14:14:04','USER_LOGIN',1,'2016-07-31 18:14:04',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(779,'2016-07-31 16:04:35','USER_LOGIN',1,'2016-07-31 20:04:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(780,'2016-07-31 21:14:14','USER_LOGIN',1,'2016-08-01 01:14:14',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36',NULL),(781,'2017-01-29 15:14:05','USER_LOGOUT',1,'2017-01-29 19:14:05',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(782,'2017-01-29 15:34:43','USER_LOGIN',1,'2017-01-29 19:34:43',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(783,'2017-01-29 15:35:04','USER_LOGOUT',1,'2017-01-29 19:35:04',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(784,'2017-01-29 15:35:12','USER_LOGIN',1,'2017-01-29 19:35:12',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(785,'2017-01-29 15:36:43','USER_LOGOUT',1,'2017-01-29 19:36:43',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(786,'2017-01-29 15:41:21','USER_LOGIN',1,'2017-01-29 19:41:21',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(787,'2017-01-29 15:41:41','USER_LOGOUT',1,'2017-01-29 19:41:41',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(788,'2017-01-29 15:42:43','USER_LOGIN',1,'2017-01-29 19:42:43',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(789,'2017-01-29 15:43:18','USER_LOGOUT',1,'2017-01-29 19:43:18',12,'(UserLogoff,admin)','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(790,'2017-01-29 15:46:31','USER_LOGIN',1,'2017-01-29 19:46:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x571','192.168.0.254','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(791,'2017-01-29 16:18:56','USER_LOGIN',1,'2017-01-29 20:18:56',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Berlin;Screen=360x526','192.168.0.254','Mozilla/5.0 (Linux; Android 6.0; LG-H818 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36 - DoliDroid - Android client pour Dolibarr ERP-CRM',NULL),(792,'2017-01-29 17:20:59','USER_LOGIN',1,'2017-01-29 21:20:59',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(793,'2017-01-30 11:19:40','USER_LOGIN',1,'2017-01-30 15:19:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(794,'2017-01-31 16:49:39','USER_LOGIN',1,'2017-01-31 20:49:39',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x520','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(795,'2017-02-01 10:55:23','USER_LOGIN',1,'2017-02-01 14:55:23',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(796,'2017-02-01 13:34:31','USER_LOGIN',1,'2017-02-01 17:34:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(797,'2017-02-01 14:41:26','USER_LOGIN',1,'2017-02-01 18:41:26',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(798,'2017-02-01 23:51:48','USER_LOGIN_FAILED',1,'2017-02-02 03:51:48',NULL,'Bad value for login or password - login=autologin','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(799,'2017-02-01 23:52:55','USER_LOGIN',1,'2017-02-02 03:52:55',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(800,'2017-02-01 23:55:45','USER_CREATE',1,'2017-02-02 03:55:45',12,'User aboston created','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(801,'2017-02-01 23:55:45','USER_NEW_PASSWORD',1,'2017-02-02 03:55:45',12,'Password change for aboston','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(802,'2017-02-01 23:56:38','USER_MODIFY',1,'2017-02-02 03:56:38',12,'User aboston modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(803,'2017-02-01 23:56:50','USER_MODIFY',1,'2017-02-02 03:56:50',12,'User aboston modified','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(804,'2017-02-02 01:14:44','USER_LOGIN',1,'2017-02-02 05:14:44',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',NULL),(805,'2017-02-03 10:27:18','USER_LOGIN',1,'2017-02-03 14:27:18',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(806,'2017-02-04 10:22:34','USER_LOGIN',1,'2017-02-04 14:22:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x489','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(807,'2017-02-06 04:01:31','USER_LOGIN',1,'2017-02-06 08:01:31',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(808,'2017-02-06 10:21:32','USER_LOGIN',1,'2017-02-06 14:21:32',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(809,'2017-02-06 19:09:27','USER_LOGIN',1,'2017-02-06 23:09:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(810,'2017-02-06 23:39:17','USER_LOGIN',1,'2017-02-07 03:39:17',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(811,'2017-02-07 11:36:34','USER_LOGIN',1,'2017-02-07 15:36:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x676','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(812,'2017-02-07 18:51:53','USER_LOGIN',1,'2017-02-07 22:51:53',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(813,'2017-02-07 23:13:40','USER_LOGIN',1,'2017-02-08 03:13:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(814,'2017-02-08 09:29:12','USER_LOGIN',1,'2017-02-08 13:29:12',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(815,'2017-02-08 17:33:12','USER_LOGIN',1,'2017-02-08 21:33:12',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(816,'2017-02-09 17:30:34','USER_LOGIN',1,'2017-02-09 21:30:34',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(817,'2017-02-10 09:30:02','USER_LOGIN',1,'2017-02-10 13:30:02',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(818,'2017-02-10 16:16:14','USER_LOGIN',1,'2017-02-10 20:16:14',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(819,'2017-02-10 17:28:15','USER_LOGIN',1,'2017-02-10 21:28:15',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(820,'2017-02-11 12:54:03','USER_LOGIN',1,'2017-02-11 16:54:03',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(821,'2017-02-11 17:23:52','USER_LOGIN',1,'2017-02-11 21:23:52',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(822,'2017-02-12 12:44:03','USER_LOGIN',1,'2017-02-12 16:44:03',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(823,'2017-02-12 16:42:13','USER_LOGIN',1,'2017-02-12 20:42:13',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(824,'2017-02-12 19:14:18','USER_LOGIN',1,'2017-02-12 23:14:18',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(825,'2017-02-15 17:17:00','USER_LOGIN',1,'2017-02-15 21:17:00',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(826,'2017-02-15 22:02:40','USER_LOGIN',1,'2017-02-16 02:02:40',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(827,'2017-02-16 22:13:27','USER_LOGIN',1,'2017-02-17 02:13:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x619','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(828,'2017-02-16 23:54:04','USER_LOGIN',1,'2017-02-17 03:54:04',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(829,'2017-02-17 09:14:27','USER_LOGIN',1,'2017-02-17 13:14:27',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(830,'2017-02-17 12:07:05','USER_LOGIN',1,'2017-02-17 16:07:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(831,'2017-02-19 21:22:20','USER_LOGIN',1,'2017-02-20 01:22:20',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(832,'2017-02-20 09:26:47','USER_LOGIN',1,'2017-02-20 13:26:47',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(833,'2017-02-20 16:39:55','USER_LOGIN',1,'2017-02-20 20:39:55',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(834,'2017-02-20 16:49:00','USER_MODIFY',1,'2017-02-20 20:49:00',12,'Modification utilisateur ccommerson','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(835,'2017-02-20 17:57:15','USER_LOGIN',1,'2017-02-20 21:57:14',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(836,'2017-02-20 19:43:48','USER_LOGIN',1,'2017-02-20 23:43:48',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(837,'2017-02-21 00:04:05','USER_LOGIN',1,'2017-02-21 04:04:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(838,'2017-02-21 10:23:13','USER_LOGIN',1,'2017-02-21 14:23:13',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(839,'2017-02-21 10:30:17','USER_LOGOUT',1,'2017-02-21 14:30:17',12,'(UserLogoff,admin)','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(840,'2017-02-21 10:30:22','USER_LOGIN',1,'2017-02-21 14:30:22',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(841,'2017-02-21 11:44:05','USER_LOGIN',1,'2017-02-21 15:44:05',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',NULL),(842,'2017-05-12 09:02:48','USER_LOGIN',1,'2017-05-12 13:02:48',12,'(UserLogged,admin) - TZ=1;TZString=Europe/Paris;Screen=1920x937','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36',NULL),(843,'2017-08-27 13:29:16','USER_LOGIN',1,'2017-08-27 17:29:16',12,'(UserLogged,admin) - TZ=;TZString=;Screen=x','127.0.0.1','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',NULL); +/*!40000 ALTER TABLE `llx_events` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition` +-- + +DROP TABLE IF EXISTS `llx_expedition`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_customer` varchar(30) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_int` varchar(30) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_expedition` datetime DEFAULT NULL, + `date_delivery` datetime DEFAULT NULL, + `fk_address` int(11) DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `tracking_number` varchar(50) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `height` float DEFAULT NULL, + `height_unit` int(11) DEFAULT NULL, + `width` float DEFAULT NULL, + `size_units` int(11) DEFAULT NULL, + `size` float DEFAULT NULL, + `weight_units` int(11) DEFAULT NULL, + `weight` float DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `billed` smallint(6) DEFAULT '0', + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_expedition_uk_ref` (`ref`,`entity`), + KEY `idx_expedition_fk_soc` (`fk_soc`), + KEY `idx_expedition_fk_user_author` (`fk_user_author`), + KEY `idx_expedition_fk_user_valid` (`fk_user_valid`), + KEY `idx_expedition_fk_shipping_method` (`fk_shipping_method`), + CONSTRAINT `fk_expedition_fk_shipping_method` FOREIGN KEY (`fk_shipping_method`) REFERENCES `llx_c_shipment_mode` (`rowid`), + CONSTRAINT `fk_expedition_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_expedition_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_expedition_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition` +-- + +LOCK TABLES `llx_expedition` WRITE; +/*!40000 ALTER TABLE `llx_expedition` DISABLE KEYS */; +INSERT INTO `llx_expedition` VALUES (1,'2016-01-22 17:33:03','SH1302-0001',1,NULL,1,NULL,NULL,NULL,'2011-08-08 03:05:34',1,'2013-02-17 18:22:51',1,NULL,'2011-08-09 00:00:00',NULL,NULL,'',1,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,'merou',NULL,NULL,NULL,NULL,0,NULL),(2,'2017-02-15 23:11:35','(PROV2)',1,NULL,4,NULL,NULL,NULL,'2017-02-16 03:11:35',12,NULL,NULL,NULL,NULL,NULL,1,'',0,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,'merou',0,'',NULL,NULL,0,NULL); +/*!40000 ALTER TABLE `llx_expedition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition_extrafields` +-- + +DROP TABLE IF EXISTS `llx_expedition_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_expedition_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition_extrafields` +-- + +LOCK TABLES `llx_expedition_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_expedition_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expedition_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expedition_methode` +-- + +DROP TABLE IF EXISTS `llx_expedition_methode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expedition_methode` ( + `rowid` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `code` varchar(30) NOT NULL, + `libelle` varchar(50) NOT NULL, + `description` text, + `active` tinyint(4) DEFAULT '0', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expedition_methode` +-- + +LOCK TABLES `llx_expedition_methode` WRITE; +/*!40000 ALTER TABLE `llx_expedition_methode` DISABLE KEYS */; +INSERT INTO `llx_expedition_methode` VALUES (1,'2010-07-08 11:18:00','CATCH','Catch','Catch by client',1),(2,'2010-07-08 11:18:00','TRANS','Transporter','Generic transporter',1),(3,'2010-07-08 11:18:01','COLSUI','Colissimo Suivi','Colissimo Suivi',0); +/*!40000 ALTER TABLE `llx_expedition_methode` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expedition` int(11) NOT NULL, + `fk_origin_line` int(11) DEFAULT NULL, + `fk_entrepot` int(11) DEFAULT NULL, + `qty` double DEFAULT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_expeditiondet_fk_expedition` (`fk_expedition`), + CONSTRAINT `fk_expeditiondet_fk_expedition` FOREIGN KEY (`fk_expedition`) REFERENCES `llx_expedition` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet` +-- + +LOCK TABLES `llx_expeditiondet` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet` DISABLE KEYS */; +INSERT INTO `llx_expeditiondet` VALUES (1,1,10,3,1,0),(2,2,226,19,2,0); +/*!40000 ALTER TABLE `llx_expeditiondet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet_batch` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet_batch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet_batch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expeditiondet` int(11) NOT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + `batch` varchar(30) DEFAULT NULL, + `qty` double NOT NULL DEFAULT '0', + `fk_origin_stock` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_fk_expeditiondet` (`fk_expeditiondet`), + CONSTRAINT `fk_expeditiondet_batch_fk_expeditiondet` FOREIGN KEY (`fk_expeditiondet`) REFERENCES `llx_expeditiondet` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet_batch` +-- + +LOCK TABLES `llx_expeditiondet_batch` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet_batch` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expeditiondet_batch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expeditiondet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_expeditiondet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expeditiondet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_expeditiondet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expeditiondet_extrafields` +-- + +LOCK TABLES `llx_expeditiondet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_expeditiondet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expeditiondet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expensereport` +-- + +DROP TABLE IF EXISTS `llx_expensereport`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expensereport` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(50) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_number_int` int(11) DEFAULT NULL, + `ref_ext` int(11) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `date_debut` date NOT NULL, + `date_fin` date NOT NULL, + `date_create` datetime NOT NULL, + `date_valid` datetime DEFAULT NULL, + `date_approve` datetime DEFAULT NULL, + `date_refuse` datetime DEFAULT NULL, + `date_cancel` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_author` int(11) NOT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_validator` int(11) DEFAULT NULL, + `fk_user_approve` int(11) DEFAULT NULL, + `fk_user_refuse` int(11) DEFAULT NULL, + `fk_user_cancel` int(11) DEFAULT NULL, + `fk_statut` int(11) NOT NULL, + `fk_c_paiement` int(11) DEFAULT NULL, + `paid` smallint(6) NOT NULL DEFAULT '0', + `note_public` text, + `note_private` text, + `detail_refuse` varchar(255) DEFAULT NULL, + `detail_cancel` varchar(255) DEFAULT NULL, + `integration_compta` int(11) DEFAULT NULL, + `fk_bank_account` int(11) DEFAULT NULL, + `model_pdf` varchar(50) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_expensereport_uk_ref` (`ref`,`entity`), + KEY `idx_expensereport_date_debut` (`date_debut`), + KEY `idx_expensereport_date_fin` (`date_fin`), + KEY `idx_expensereport_fk_statut` (`fk_statut`), + KEY `idx_expensereport_fk_user_author` (`fk_user_author`), + KEY `idx_expensereport_fk_user_valid` (`fk_user_valid`), + KEY `idx_expensereport_fk_user_approve` (`fk_user_approve`), + KEY `idx_expensereport_fk_refuse` (`fk_user_approve`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expensereport` +-- + +LOCK TABLES `llx_expensereport` WRITE; +/*!40000 ALTER TABLE `llx_expensereport` DISABLE KEYS */; +INSERT INTO `llx_expensereport` VALUES (1,'ADMIN-ER00002-150101',1,2,NULL,8.33000000,1.67000000,0.00000000,0.00000000,10.00000000,'2015-01-01','2015-01-03','2016-01-22 19:03:37','2016-01-22 19:06:50','2017-02-16 02:12:40',NULL,NULL,'2017-02-15 22:12:40',12,NULL,12,12,12,NULL,NULL,5,NULL,0,'Holidays',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL),(2,'(PROV2)',1,NULL,NULL,141.67000000,28.33000000,0.00000000,0.00000000,170.00000000,'2015-02-01','2015-02-28','2016-01-22 19:04:44',NULL,NULL,NULL,NULL,'2016-01-22 18:06:21',12,12,NULL,12,NULL,NULL,NULL,0,NULL,0,'Work on projet X','','',NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL),(3,'(PROV3)',1,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'2017-02-02','2017-02-02','2017-02-02 03:57:03',NULL,NULL,NULL,NULL,'2017-02-01 23:57:03',19,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL); +/*!40000 ALTER TABLE `llx_expensereport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expensereport_det` +-- + +DROP TABLE IF EXISTS `llx_expensereport_det`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expensereport_det` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expensereport` int(11) NOT NULL, + `fk_c_type_fees` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT NULL, + `comments` text NOT NULL, + `product_type` int(11) DEFAULT '-1', + `qty` double NOT NULL, + `value_unit` double NOT NULL, + `remise_percent` double DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT NULL, + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) DEFAULT NULL, + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) DEFAULT NULL, + `total_ht` double(24,8) NOT NULL DEFAULT '0.00000000', + `total_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `date` date NOT NULL, + `info_bits` int(11) DEFAULT '0', + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_facture` int(11) DEFAULT '0', + `fk_code_ventilation` int(11) DEFAULT '0', + `vat_src_code` varchar(10) DEFAULT '', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expensereport_det` +-- + +LOCK TABLES `llx_expensereport_det` WRITE; +/*!40000 ALTER TABLE `llx_expensereport_det` DISABLE KEYS */; +INSERT INTO `llx_expensereport_det` VALUES (1,1,3,1,'',-1,1,10,NULL,20.000,0.000,NULL,0.000,NULL,8.33000000,1.67000000,0.00000000,0.00000000,10.00000000,'2015-01-01',0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0,0,''),(2,2,3,4,'',-1,1,20,NULL,20.000,0.000,NULL,0.000,NULL,16.67000000,3.33000000,0.00000000,0.00000000,20.00000000,'2015-01-07',0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0,0,''),(3,2,2,5,'Train',-1,1,150,NULL,20.000,0.000,NULL,0.000,NULL,125.00000000,25.00000000,0.00000000,0.00000000,150.00000000,'2015-02-05',0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0,0,''); +/*!40000 ALTER TABLE `llx_expensereport_det` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_expensereport_extrafields` +-- + +DROP TABLE IF EXISTS `llx_expensereport_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_expensereport_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_expensereport_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_expensereport_extrafields` +-- + +LOCK TABLES `llx_expensereport_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_expensereport_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_expensereport_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_export_compta` +-- + +DROP TABLE IF EXISTS `llx_export_compta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_export_compta` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(12) NOT NULL, + `date_export` datetime NOT NULL, + `fk_user` int(11) NOT NULL, + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_export_compta` +-- + +LOCK TABLES `llx_export_compta` WRITE; +/*!40000 ALTER TABLE `llx_export_compta` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_export_compta` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_export_model` +-- + +DROP TABLE IF EXISTS `llx_export_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_export_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL DEFAULT '0', + `label` varchar(50) NOT NULL, + `type` varchar(20) NOT NULL, + `field` text NOT NULL, + `filter` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_export_model` (`label`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_export_model` +-- + +LOCK TABLES `llx_export_model` WRITE; +/*!40000 ALTER TABLE `llx_export_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_export_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_extrafields` +-- + +DROP TABLE IF EXISTS `llx_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `elementtype` varchar(64) NOT NULL DEFAULT 'member', + `name` varchar(64) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(255) NOT NULL, + `type` varchar(8) DEFAULT NULL, + `size` varchar(8) DEFAULT NULL, + `pos` int(11) DEFAULT '0', + `alwayseditable` int(11) DEFAULT '0', + `param` text, + `fieldunique` int(11) DEFAULT '0', + `fieldrequired` int(11) DEFAULT '0', + `perms` varchar(255) DEFAULT NULL, + `list` int(11) DEFAULT '0', + `ishidden` int(11) DEFAULT '0', + `fieldcomputed` text, + `fielddefault` varchar(255) DEFAULT NULL, + `langs` varchar(24) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_extrafields_name` (`name`,`entity`,`elementtype`) +) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_extrafields` +-- + +LOCK TABLES `llx_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_extrafields` DISABLE KEYS */; +INSERT INTO `llx_extrafields` VALUES (2,'adherent','zzz',1,'2013-09-08 23:04:20','zzz','varchar','255',0,0,NULL,0,0,NULL,0,0,NULL,NULL,NULL),(27,'projet','priority',1,'2016-07-30 11:28:27','Priority','select','',0,1,'a:1:{s:7:\"options\";a:5:{i:1;s:1:\"1\";i:2;s:1:\"2\";i:3;s:1:\"3\";i:4;s:1:\"4\";i:5;s:1:\"5\";}}',0,0,NULL,0,0,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture` +-- + +DROP TABLE IF EXISTS `llx_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `facnumber` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `type` smallint(6) NOT NULL DEFAULT '0', + `ref_client` varchar(255) DEFAULT NULL, + `increment` varchar(10) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `date_valid` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `paye` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `close_code` varchar(16) DEFAULT NULL, + `close_note` varchar(128) DEFAULT NULL, + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `revenuestamp` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) NOT NULL DEFAULT '1', + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `situation_cycle_ref` smallint(6) DEFAULT NULL, + `situation_counter` smallint(6) DEFAULT NULL, + `situation_final` smallint(6) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `date_pointoftax` date DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_fac_rec_source` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_facture_uk_facnumber` (`facnumber`,`entity`), + KEY `idx_facture_fk_soc` (`fk_soc`), + KEY `idx_facture_fk_user_author` (`fk_user_author`), + KEY `idx_facture_fk_user_valid` (`fk_user_valid`), + KEY `idx_facture_fk_facture_source` (`fk_facture_source`), + KEY `idx_facture_fk_projet` (`fk_projet`), + KEY `idx_facture_fk_account` (`fk_account`), + KEY `idx_facture_fk_currency` (`fk_currency`), + KEY `idx_facture_fk_statut` (`fk_statut`), + CONSTRAINT `fk_facture_fk_facture_source` FOREIGN KEY (`fk_facture_source`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_facture_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_facture_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture` +-- + +LOCK TABLES `llx_facture` WRITE; +/*!40000 ALTER TABLE `llx_facture` DISABLE KEYS */; +INSERT INTO `llx_facture` VALUES (2,'FA1007-0002',1,NULL,NULL,0,NULL,NULL,2,'2010-07-10 18:20:13','2016-07-10',NULL,'2016-07-30 15:13:20',1,10.00000000,NULL,NULL,0,NULL,NULL,0.10000000,0.00000000,0.00000000,0.00000000,46.00000000,46.10000000,2,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2016-07-10',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(3,'FA1107-0006',1,NULL,NULL,0,NULL,NULL,10,'2011-07-18 20:33:35','2016-07-18',NULL,'2016-07-30 15:13:20',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,15.00000000,15.00000000,2,1,NULL,1,NULL,1,NULL,NULL,1,0,'2016-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(5,'FA1108-0003',1,NULL,NULL,0,NULL,NULL,7,'2011-08-01 03:34:11','2015-08-01',NULL,'2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,6,'2015-08-01',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(6,'FA1108-0004',1,NULL,NULL,0,NULL,NULL,7,'2011-08-06 20:33:53','2015-08-06',NULL,'2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.98000000,0.00000000,0.00000000,0.00000000,5.00000000,5.98000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,4,'2015-08-06','Cash\nReceived : 6 EUR\nRendu : 0.02 EUR\n\n--------------------------------------',NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(8,'FA1108-0005',1,NULL,NULL,3,NULL,NULL,2,'2011-08-08 02:41:44','2015-08-08',NULL,'2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(9,'FA1108-0007',1,NULL,NULL,3,NULL,NULL,10,'2011-08-08 02:55:14','2015-08-08',NULL,'2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(10,'AV1212-0001',1,NULL,NULL,2,NULL,NULL,10,'2012-12-08 17:45:20','2015-12-08','2015-12-08','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,-0.63000000,0.00000000,0.00000000,0.00000000,-11.00000000,-11.63000000,1,1,NULL,1,3,NULL,NULL,NULL,0,0,'2015-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(12,'AV1212-0002',1,NULL,NULL,2,NULL,NULL,10,'2012-12-08 18:20:14','2015-12-08','2015-12-08','2016-07-30 15:12:32',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,-5.00000000,2,1,NULL,1,3,NULL,NULL,NULL,0,0,'2015-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(13,'FA1212-0011',1,NULL,NULL,0,NULL,NULL,7,'2012-12-09 20:04:19','2015-12-09','2016-02-12','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,2.74000000,0.00000000,0.00000000,0.00000000,14.00000000,16.74000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-09',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(32,'FA1212-0021',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:34:23','2015-12-11','2016-03-24','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,90.00000000,0.00000000,0.00000000,0.60000000,520.00000000,610.60000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(33,'FA1212-0023',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:34:23','2015-12-11','2017-03-03','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,'abandon',NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,3,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(55,'FA1212-0009',1,NULL,NULL,0,NULL,NULL,1,'2012-12-11 09:35:51','2015-12-11','2015-12-12','2016-07-30 15:12:32',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2015-12-11','This is a comment (private)','This is a comment (public)','generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(148,'FS1301-0001',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:22:48','2016-01-19','2016-01-19','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,NULL,1,NULL,NULL,NULL,NULL,0,1,'2016-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(149,'(PROV149)',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:30:05','2016-01-19',NULL,'2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,0,1,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'2016-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(150,'FA6801-0010',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:31:10','2016-01-19','2016-01-19','2016-07-30 15:13:20',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,1,'2016-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(151,'FS1301-0002',1,NULL,NULL,0,NULL,NULL,1,'2013-01-19 18:31:58','2016-01-19','2016-01-19','2016-07-30 15:13:20',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,0,1,'2016-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(160,'FA1507-0015',1,NULL,NULL,0,NULL,NULL,12,'2013-03-06 16:47:48','2016-07-18','2014-03-06','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,1.11000000,0.00000000,0.00000000,0.00000000,8.89000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2016-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(210,'FA1107-0019',1,NULL,NULL,0,NULL,NULL,10,'2013-03-20 14:30:11','2016-07-10','2018-03-20','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,0,'2016-07-10',NULL,NULL,'generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(211,'FA1303-0020',1,NULL,NULL,0,NULL,NULL,19,'2013-03-22 09:40:10','2016-03-22','2017-03-02','2017-02-06 04:11:17',0,0.00000000,NULL,NULL,0,NULL,NULL,17.64000000,0.00000000,0.00000000,0.40000000,340.00000000,358.04000000,1,1,NULL,1,NULL,NULL,NULL,NULL,1,3,'2016-03-22',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(213,'AV1303-0003',1,NULL,NULL,2,NULL,NULL,1,'2014-03-03 19:22:03','2016-03-03','2017-03-03','2016-07-30 15:13:20',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-1000.00000000,-1000.00000000,1,1,NULL,1,32,NULL,NULL,NULL,0,0,'2016-03-03',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(216,'(PROV216)',1,NULL,NULL,0,NULL,NULL,26,'2017-02-12 23:21:27','2017-02-12',NULL,'2017-02-12 19:21:27',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2017-02-12',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,'',NULL,0,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,NULL); +/*!40000 ALTER TABLE `llx_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_extrafields` +-- + +LOCK TABLES `llx_facture_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(255) NOT NULL, + `ref_supplier` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `type` smallint(6) NOT NULL DEFAULT '0', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `libelle` varchar(255) DEFAULT NULL, + `paye` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise` double(24,8) DEFAULT '0.00000000', + `close_code` varchar(16) DEFAULT NULL, + `close_note` varchar(128) DEFAULT NULL, + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_facture_fourn_ref` (`ref`,`entity`), + UNIQUE KEY `uk_facture_fourn_ref_supplier` (`ref_supplier`,`fk_soc`,`entity`), + KEY `idx_facture_fourn_date_lim_reglement` (`date_lim_reglement`), + KEY `idx_facture_fourn_fk_soc` (`fk_soc`), + KEY `idx_facture_fourn_fk_user_author` (`fk_user_author`), + KEY `idx_facture_fourn_fk_user_valid` (`fk_user_valid`), + KEY `idx_facture_fourn_fk_projet` (`fk_projet`), + CONSTRAINT `fk_facture_fourn_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_facture_fourn_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn` +-- + +LOCK TABLES `llx_facture_fourn` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn` DISABLE KEYS */; +INSERT INTO `llx_facture_fourn` VALUES (16,'SI1601-0001','FR70813',1,NULL,0,1,'2012-12-19 15:24:11','2003-04-11','2017-02-06 04:08:22','OVH FR70813',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,829.00000000,162.48000000,991.48000000,1,1,NULL,12,NULL,NULL,NULL,1,NULL,'2003-04-11','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(17,'SI1601-0002','FR81385',1,NULL,0,1,'2013-02-13 17:19:35','2003-06-04','2017-02-06 04:08:31','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,NULL,NULL,1,NULL,'2003-06-04','','','canelle',NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(18,'SI1601-0003','FR81385',1,NULL,0,2,'2013-02-13 17:20:25','2003-06-04','2017-02-06 04:08:35','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,NULL,NULL,1,NULL,'2003-06-04','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(19,'SI1601-0004','FR813852',1,NULL,0,2,'2013-03-16 17:59:02','2013-03-16','2017-02-06 04:08:38','OVH FR81385',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,26.00000000,5.10000000,31.10000000,0,1,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(20,'SI1702-0001','INV-AE56ER08',1,NULL,0,13,'2017-02-01 19:00:31','2017-02-01','2017-02-01 15:05:28','',0,0.00000000,0.00000000,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,200.00000000,39.20000000,239.20000000,1,12,NULL,12,NULL,5,NULL,1,0,'2017-02-01','The customer has called us the 24th april. He agree us to not pay the remain of invoice due to default.
        \r\nLet\'s see with our book keeper, if we must cancel invoice or ask the supplier a credit note...',NULL,'canelle',NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,39.20000000,239.20000000); +/*!40000 ALTER TABLE `llx_facture_fourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_det` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_det`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_det` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture_fourn` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `pu_ht` double(24,8) DEFAULT NULL, + `pu_ttc` double(24,8) DEFAULT NULL, + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `total_ht` double(24,8) DEFAULT NULL, + `tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_det_fk_facture` (`fk_facture_fourn`), + KEY `fk_facture_fourn_det_fk_unit` (`fk_unit`), + KEY `idx_facture_fourn_det_fk_code_ventilation` (`fk_code_ventilation`), + KEY `idx_facture_fourn_det_fk_product` (`fk_product`), + CONSTRAINT `fk_facture_fourn_det_fk_facture` FOREIGN KEY (`fk_facture_fourn`) REFERENCES `llx_facture_fourn` (`rowid`), + CONSTRAINT `fk_facture_fourn_det_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=54 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_det` +-- + +LOCK TABLES `llx_facture_fourn_det` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_det` DISABLE KEYS */; +INSERT INTO `llx_facture_fourn_det` VALUES (44,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
        6 mois - Location de SuperPlan avec la connexion 512kbs
        Du 11/04/2003 à 11/10/2003',414.00000000,495.14400000,1,0,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(45,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
        6 mois - Location de SuperPlan avec la connexion 512kbs
        Du 11/10/2003 à 11/04/2004',414.00000000,495.14400000,1,0,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(46,16,NULL,NULL,NULL,NULL,'ref :sd.installation.annuel
        Frais de mise en service d\'un serveur dédié pour un paiement annuel
        ',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(47,17,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
        Création du compte backup ftp 250Mo.
        ',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(48,17,NULL,NULL,NULL,NULL,'ref :bk.full250.12
        Redevance pour un backup de 250Mo sur 12 mois
        ',25.00000000,29.90000000,1,0,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(49,18,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
        Création du compte backup ftp 250Mo.
        ',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(50,18,NULL,NULL,NULL,NULL,'ref :bk.full250.12
        Redevance pour un backup de 250Mo sur 12 mois
        ',25.00000000,29.90000000,1,0,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(51,19,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
        Création du compte backup ftp 250Mo.
        ',1.00000000,1.19600000,1,0,19.600,'',0.000,'0',0.000,'0',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(52,19,NULL,NULL,NULL,NULL,'ref :bk.full250.12
        Redevance pour un backup de 250Mo sur 12 mois
        ',25.00000000,29.90000000,1,0,19.600,'',0.000,'0',0.000,'0',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(53,20,NULL,NULL,NULL,NULL,'Chips',20.00000000,23.92000000,10,0,19.600,'',0.000,'0',0.000,'0',200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'EUR',20.00000000,200.00000000,39.20000000,239.20000000); +/*!40000 ALTER TABLE `llx_facture_fourn_det` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_det_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_det_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_det_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_det_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_det_extrafields` +-- + +LOCK TABLES `llx_facture_fourn_det_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_det_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_fourn_det_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_fourn_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facture_fourn_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_fourn_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facture_fourn_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_fourn_extrafields` +-- + +LOCK TABLES `llx_facture_fourn_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facture_fourn_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facture_fourn_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facture_rec` +-- + +DROP TABLE IF EXISTS `llx_facture_rec`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facture_rec` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `titre` varchar(50) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `remise` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_user_author` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT '0', + `fk_mode_reglement` int(11) DEFAULT '0', + `date_lim_reglement` date DEFAULT NULL, + `note_private` text, + `note_public` text, + `last_gen` varchar(7) DEFAULT NULL, + `unit_frequency` varchar(2) DEFAULT 'd', + `date_when` datetime DEFAULT NULL, + `date_last_gen` datetime DEFAULT NULL, + `nb_gen_done` int(11) DEFAULT NULL, + `nb_gen_max` int(11) DEFAULT NULL, + `frequency` int(11) DEFAULT NULL, + `usenewprice` int(11) DEFAULT '0', + `revenuestamp` double(24,8) DEFAULT '0.00000000', + `auto_validate` int(11) DEFAULT '0', + `fk_account` int(11) DEFAULT '0', + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_user_modif` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `vat_src_code` varchar(10) DEFAULT '', + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_facture_rec_uk_titre` (`titre`,`entity`), + KEY `idx_facture_rec_fk_soc` (`fk_soc`), + KEY `idx_facture_rec_fk_user_author` (`fk_user_author`), + KEY `idx_facture_rec_fk_projet` (`fk_projet`), + CONSTRAINT `fk_facture_rec_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_facture_rec_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_facture_rec_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facture_rec` +-- + +LOCK TABLES `llx_facture_rec` WRITE; +/*!40000 ALTER TABLE `llx_facture_rec` DISABLE KEYS */; +INSERT INTO `llx_facture_rec` VALUES (1,'fsdfsfsfsf',1,10,'2017-02-07 03:47:00',0.00000000,0,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,12,NULL,1,0,NULL,NULL,NULL,NULL,'m',NULL,NULL,0,0,0,0,0.00000000,0,3,NULL,NULL,1.00000000,10.00000000,0.00000000,10.00000000,NULL,'2017-02-07 02:47:00',''),(2,'fffff',1,10,'2017-02-07 03:47:58',0.00000000,0,0,0,0.00000000,0.00000000,0.00000000,5.00000000,5.00000000,12,6,1,2,NULL,NULL,NULL,NULL,'m',NULL,NULL,0,0,0,0,0.00000000,0,4,NULL,NULL,1.00000000,5.00000000,0.00000000,5.00000000,NULL,'2017-02-07 02:47:58',''); +/*!40000 ALTER TABLE `llx_facture_rec` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet` +-- + +DROP TABLE IF EXISTS `llx_facturedet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `fk_remise_except` int(11) DEFAULT NULL, + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_code_ventilation` int(11) NOT NULL DEFAULT '0', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_contract_line` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `situation_percent` double DEFAULT NULL, + `fk_prev_id` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fk_remise_except` (`fk_remise_except`,`fk_facture`), + KEY `idx_facturedet_fk_facture` (`fk_facture`), + KEY `idx_facturedet_fk_product` (`fk_product`), + KEY `fk_facturedet_fk_unit` (`fk_unit`), + KEY `idx_facturedet_fk_code_ventilation` (`fk_code_ventilation`), + CONSTRAINT `fk_facturedet_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_facturedet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=1027 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet` +-- + +LOCK TABLES `llx_facturedet` WRITE; +/*!40000 ALTER TABLE `llx_facturedet` DISABLE KEYS */; +INSERT INTO `llx_facturedet` VALUES (3,2,NULL,3,NULL,'Service S1',0.000,'',0.000,'',0.000,'',1,10,4,NULL,40.00000000,36.00000000,36.00000000,0.00000000,0.00000000,0.00000000,36.00000000,1,'2010-07-10 00:00:00',NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,2,NULL,NULL,NULL,'Abonnement annuel assurance',1.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.10000000,0.00000000,0.00000000,10.10000000,0,'2010-07-10 00:00:00','2011-07-10 00:00:00',0,NULL,0.00000000,0,0,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(11,3,NULL,4,NULL,'afsdfsdfsdfsdf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(12,3,NULL,NULL,NULL,'dfdfd',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(13,5,NULL,4,NULL,'Decapsuleur',12.500,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(14,6,NULL,4,NULL,'Decapsuleur',19.600,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,5.00000000,0.98000000,0.00000000,0.00000000,5.98000000,0,NULL,NULL,0,NULL,0.00000000,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(21,8,NULL,NULL,NULL,'dddd',0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(22,9,NULL,NULL,NULL,'ggg',19.600,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(23,10,NULL,4,NULL,'',12.500,'',0.000,'',0.000,'',1,0,0,NULL,-5.00000000,NULL,-5.00000000,-0.63000000,0.00000000,0.00000000,-5.63000000,0,NULL,NULL,0,NULL,12.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(24,10,NULL,1,NULL,'A beatifull pink dress\r\nlkm',0.000,'',0.000,'',0.000,'',1,0,0,NULL,-6.00000000,NULL,-6.00000000,0.00000000,0.00000000,0.00000000,-6.00000000,0,NULL,NULL,0,0,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(26,12,NULL,1,NULL,'A beatifull pink dress\r\nhfghf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,-5.00000000,NULL,-5.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,0,NULL,NULL,0,0,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(27,13,NULL,NULL,NULL,'gdfgdf',19.600,'',0.000,'',0.000,'',1.4,0,0,NULL,10.00000000,NULL,14.00000000,2.74000000,0.00000000,0.00000000,16.74000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(137,33,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(138,33,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(256,55,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(257,55,NULL,NULL,NULL,'Desc',10.000,'',0.000,'',0.000,'',1,0,0,NULL,1.24000000,NULL,1.24000000,0.12000000,0.00000000,0.00000000,1.36000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(753,13,NULL,2,NULL,'(Pays d\'origine: Albanie)',0.000,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,0,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(754,148,NULL,11,NULL,'hfghf',0.000,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(755,148,NULL,4,NULL,'Decapsuleur',12.500,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,NULL,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(756,149,NULL,5,NULL,'aaaa',19.600,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,NULL,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(757,150,NULL,2,NULL,'Product P1',12.500,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(758,151,NULL,2,NULL,'Product P1',12.500,'',0.000,'',0.000,'',1,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(768,32,NULL,NULL,NULL,'mlml',18.000,'',0.000,'',0.000,'',1,0,0,NULL,100.00000000,NULL,100.00000000,18.00000000,0.00000000,0.00000000,118.00000000,0,NULL,NULL,0,NULL,46.00000000,0,0,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(769,32,NULL,NULL,NULL,'mlkml',18.000,'',0.000,'',0.000,'',1,0,0,NULL,400.00000000,NULL,400.00000000,72.00000000,0.00000000,0.00000000,472.00000000,0,NULL,NULL,0,NULL,300.00000000,0,0,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(772,160,NULL,NULL,NULL,'Adhésion/cotisation 2015',12.500,'',0.000,'',0.000,'',1,0,0,NULL,8.88889000,NULL,8.89000000,1.11000000,0.00000000,0.00000000,10.00000000,1,'2015-07-18 00:00:00','2016-07-17 00:00:00',0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(776,32,NULL,NULL,NULL,'fsdfsdfds',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(777,32,NULL,NULL,NULL,'fsdfsdfds',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(779,32,NULL,NULL,NULL,'fsdfds',0.000,'',0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,0,0.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(780,32,NULL,NULL,NULL,'ffsdf',0.000,'',0.000,'0',0.000,'0',0,0,0,NULL,0.00000000,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,9,NULL,NULL,0,NULL,0.00000000,0,1790,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1022,210,NULL,NULL,NULL,'Adhésion/cotisation 2011',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,NULL,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,1,'2011-07-10 00:00:00','2012-07-09 00:00:00',0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1023,211,NULL,NULL,NULL,'Samsung Android x4',0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,250.00000000,NULL,250.00000000,0.00000000,0.00000000,0.00000000,250.00000000,0,NULL,NULL,0,NULL,200.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1024,211,NULL,1,NULL,'A beatifull pink dress\r\nSize XXL',19.600,'',0.000,'0',0.000,'0',1,10,0,NULL,100.00000000,NULL,90.00000000,17.64000000,0.00000000,0.00000000,107.64000000,0,NULL,NULL,0,NULL,90.00000000,0,0,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(1026,213,NULL,1,NULL,'A beatifull pink dress',0.000,'',0.000,'0',0.000,'0',10,0,0,NULL,-100.00000000,NULL,-1000.00000000,0.00000000,0.00000000,0.00000000,-1000.00000000,0,NULL,NULL,0,NULL,0.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_facturedet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_facturedet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_facturedet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet_extrafields` +-- + +LOCK TABLES `llx_facturedet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_facturedet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_facturedet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_facturedet_rec` +-- + +DROP TABLE IF EXISTS `llx_facturedet_rec`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_facturedet_rec` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `product_type` int(11) DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `description` text, + `tva_tx` double(6,3) DEFAULT NULL, + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `subprice` double(24,8) DEFAULT NULL, + `price` double(24,8) DEFAULT NULL, + `total_ht` double(24,8) DEFAULT NULL, + `total_tva` double(24,8) DEFAULT NULL, + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_contract_line` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `fk_facturedet_rec_fk_unit` (`fk_unit`), + CONSTRAINT `fk_facturedet_rec_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_facturedet_rec` +-- + +LOCK TABLES `llx_facturedet_rec` WRITE; +/*!40000 ALTER TABLE `llx_facturedet_rec` DISABLE KEYS */; +INSERT INTO `llx_facturedet_rec` VALUES (1,1,NULL,NULL,0,NULL,'ùkù',0.000,'',0.000,'0',0.000,'0',1,0,NULL,10.00000000,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,2,NULL,NULL,0,NULL,'ddd',0.000,'',0.000,'0',0.000,'0',1,0,NULL,5.00000000,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,0,1,NULL,NULL,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000); +/*!40000 ALTER TABLE `llx_facturedet_rec` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinter` +-- + +DROP TABLE IF EXISTS `llx_fichinter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinter` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `fk_projet` int(11) DEFAULT '0', + `fk_contrat` int(11) DEFAULT '0', + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `datei` date DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `duree` double DEFAULT NULL, + `dateo` date DEFAULT NULL, + `datee` date DEFAULT NULL, + `datet` date DEFAULT NULL, + `description` text, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `ref_ext` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fichinter_ref` (`ref`,`entity`), + KEY `idx_fichinter_fk_soc` (`fk_soc`), + CONSTRAINT `fk_fichinter_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinter` +-- + +LOCK TABLES `llx_fichinter` WRITE; +/*!40000 ALTER TABLE `llx_fichinter` DISABLE KEYS */; +INSERT INTO `llx_fichinter` VALUES (1,2,1,0,'FI1007-0001',1,'2016-01-22 17:39:37','2010-07-09 01:42:41','2016-01-22 18:39:37',NULL,1,NULL,12,1,10800,NULL,NULL,NULL,NULL,NULL,NULL,'soleil',NULL,NULL),(2,1,NULL,0,'FI1007-0002',1,'2012-12-08 13:11:07','2010-07-11 16:07:51',NULL,NULL,1,NULL,NULL,0,3600,NULL,NULL,NULL,'ferfrefeferf',NULL,NULL,'soleil',NULL,NULL),(3,2,NULL,0,'FI1511-0003',1,'2016-07-30 15:51:16','2015-11-18 15:57:34','2016-01-22 18:38:46',NULL,2,NULL,12,1,36000,NULL,NULL,NULL,NULL,NULL,NULL,'soleil',NULL,NULL); +/*!40000 ALTER TABLE `llx_fichinter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinter_extrafields` +-- + +DROP TABLE IF EXISTS `llx_fichinter_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinter_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_ficheinter_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinter_extrafields` +-- + +LOCK TABLES `llx_fichinter_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_fichinter_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_fichinter_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinterdet` +-- + +DROP TABLE IF EXISTS `llx_fichinterdet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinterdet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_fichinter` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `date` datetime DEFAULT NULL, + `description` text, + `duree` int(11) DEFAULT NULL, + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_fichinterdet_fk_fichinter` (`fk_fichinter`), + CONSTRAINT `fk_fichinterdet_fk_fichinter` FOREIGN KEY (`fk_fichinter`) REFERENCES `llx_fichinter` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinterdet` +-- + +LOCK TABLES `llx_fichinterdet` WRITE; +/*!40000 ALTER TABLE `llx_fichinterdet` DISABLE KEYS */; +INSERT INTO `llx_fichinterdet` VALUES (1,1,NULL,'2010-07-07 04:00:00','Intervention sur site',3600,0),(2,1,NULL,'2010-07-08 11:00:00','Other actions on client site.',7200,0),(3,2,NULL,'2010-07-11 05:00:00','Pres',3600,0),(5,3,NULL,'2015-11-18 09:00:00','Intervention on building windows 1',32400,0),(6,3,NULL,'2016-01-22 00:00:00','Intervention on building windows 2',3600,0); +/*!40000 ALTER TABLE `llx_fichinterdet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_fichinterdet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_fichinterdet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_fichinterdet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_ficheinterdet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_fichinterdet_extrafields` +-- + +LOCK TABLES `llx_fichinterdet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_fichinterdet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_fichinterdet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday` +-- + +DROP TABLE IF EXISTS `llx_holiday`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `date_create` datetime NOT NULL, + `description` varchar(255) NOT NULL, + `date_debut` date NOT NULL, + `date_fin` date NOT NULL, + `halfday` int(11) DEFAULT '0', + `statut` int(11) NOT NULL DEFAULT '1', + `fk_validator` int(11) NOT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_refuse` datetime DEFAULT NULL, + `fk_user_refuse` int(11) DEFAULT NULL, + `date_cancel` datetime DEFAULT NULL, + `fk_user_cancel` int(11) DEFAULT NULL, + `detail_refuse` varchar(250) DEFAULT NULL, + `note_private` text, + `note_public` text, + `note` text, + `fk_user_create` int(11) DEFAULT NULL, + `fk_type` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `entity` int(11) NOT NULL DEFAULT '1', + `ref` varchar(30) DEFAULT NULL, + `ref_ext` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_holiday_fk_user` (`fk_user`), + KEY `idx_holiday_date_debut` (`date_debut`), + KEY `idx_holiday_date_fin` (`date_fin`), + KEY `idx_holiday_fk_user_create` (`fk_user_create`), + KEY `idx_holiday_date_create` (`date_create`), + KEY `idx_holiday_fk_validator` (`fk_validator`), + KEY `idx_holiday_entity` (`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday` +-- + +LOCK TABLES `llx_holiday` WRITE; +/*!40000 ALTER TABLE `llx_holiday` DISABLE KEYS */; +INSERT INTO `llx_holiday` VALUES (1,1,'2013-02-17 19:06:35','gdf','2013-02-10','2013-02-11',0,3,1,'2013-02-17 19:06:57',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'0000-00-00 00:00:00',1,NULL,NULL,NULL,NULL,NULL),(2,12,'2016-01-22 19:10:01','','2016-01-04','2016-01-08',0,1,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,5,'0000-00-00 00:00:00',1,NULL,NULL,NULL,NULL,NULL),(3,13,'2016-01-22 19:10:29','','2016-01-11','2016-01-13',0,2,11,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,5,'0000-00-00 00:00:00',1,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_holiday` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_config` +-- + +DROP TABLE IF EXISTS `llx_holiday_config`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_config` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `value` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_config` +-- + +LOCK TABLES `llx_holiday_config` WRITE; +/*!40000 ALTER TABLE `llx_holiday_config` DISABLE KEYS */; +INSERT INTO `llx_holiday_config` VALUES (1,'userGroup','1'),(2,'lastUpdate','20170202035337'),(3,'nbUser',''),(4,'delayForRequest','31'),(5,'AlertValidatorDelay','0'),(6,'AlertValidatorSolde','0'),(7,'nbHolidayDeducted','1'),(8,'nbHolidayEveryMonth','2.08334'); +/*!40000 ALTER TABLE `llx_holiday_config` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_logs` +-- + +DROP TABLE IF EXISTS `llx_holiday_logs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_logs` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_action` datetime NOT NULL, + `fk_user_action` int(11) NOT NULL, + `fk_user_update` int(11) NOT NULL, + `type_action` varchar(255) NOT NULL, + `prev_solde` varchar(255) NOT NULL, + `new_solde` varchar(255) NOT NULL, + `fk_type` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=195 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_logs` +-- + +LOCK TABLES `llx_holiday_logs` WRITE; +/*!40000 ALTER TABLE `llx_holiday_logs` DISABLE KEYS */; +INSERT INTO `llx_holiday_logs` VALUES (1,'2013-01-17 21:03:15',1,1,'Event : Mise à jour mensuelle','0.00','2.08',1),(2,'2013-01-17 21:03:15',1,2,'Event : Mise à jour mensuelle','0.00','2.08',1),(3,'2013-01-17 21:03:15',1,3,'Event : Mise à jour mensuelle','0.00','2.08',1),(4,'2013-02-01 09:53:26',1,1,'Event : Mise à jour mensuelle','2.08','4.16',1),(5,'2013-02-01 09:53:26',1,2,'Event : Mise à jour mensuelle','2.08','4.16',1),(6,'2013-02-01 09:53:26',1,3,'Event : Mise à jour mensuelle','2.08','4.16',1),(7,'2013-02-01 09:53:26',1,1,'Event : Mise à jour mensuelle','4.17','6.25',1),(8,'2013-02-01 09:53:26',1,2,'Event : Mise à jour mensuelle','4.17','6.25',1),(9,'2013-02-01 09:53:26',1,3,'Event : Mise à jour mensuelle','4.17','6.25',1),(10,'2013-02-01 09:53:26',1,4,'Event : Mise à jour mensuelle','0.00','2.08',1),(11,'2013-02-01 09:53:31',1,1,'Event : Mise à jour mensuelle','6.25','8.33',1),(12,'2013-02-01 09:53:31',1,2,'Event : Mise à jour mensuelle','6.25','8.33',1),(13,'2013-02-01 09:53:31',1,3,'Event : Mise à jour mensuelle','6.25','8.33',1),(14,'2013-02-01 09:53:31',1,4,'Event : Mise à jour mensuelle','2.08','4.16',1),(15,'2013-02-01 09:53:31',1,1,'Event : Mise à jour mensuelle','8.33','10.41',1),(16,'2013-02-01 09:53:31',1,2,'Event : Mise à jour mensuelle','8.33','10.41',1),(17,'2013-02-01 09:53:31',1,3,'Event : Mise à jour mensuelle','8.33','10.41',1),(18,'2013-02-01 09:53:31',1,4,'Event : Mise à jour mensuelle','4.17','6.25',1),(19,'2013-02-01 09:53:33',1,1,'Event : Mise à jour mensuelle','10.42','12.50',1),(20,'2013-02-01 09:53:33',1,2,'Event : Mise à jour mensuelle','10.42','12.50',1),(21,'2013-02-01 09:53:33',1,3,'Event : Mise à jour mensuelle','10.42','12.50',1),(22,'2013-02-01 09:53:33',1,4,'Event : Mise à jour mensuelle','6.25','8.33',1),(23,'2013-02-01 09:53:34',1,1,'Event : Mise à jour mensuelle','12.50','14.58',1),(24,'2013-02-01 09:53:34',1,2,'Event : Mise à jour mensuelle','12.50','14.58',1),(25,'2013-02-01 09:53:34',1,3,'Event : Mise à jour mensuelle','12.50','14.58',1),(26,'2013-02-01 09:53:34',1,4,'Event : Mise à jour mensuelle','8.33','10.41',1),(27,'2013-02-01 09:53:34',1,1,'Event : Mise à jour mensuelle','14.58','16.66',1),(28,'2013-02-01 09:53:34',1,2,'Event : Mise à jour mensuelle','14.58','16.66',1),(29,'2013-02-01 09:53:34',1,3,'Event : Mise à jour mensuelle','14.58','16.66',1),(30,'2013-02-01 09:53:34',1,4,'Event : Mise à jour mensuelle','10.42','12.50',1),(31,'2013-02-01 09:53:36',1,1,'Event : Mise à jour mensuelle','16.67','18.75',1),(32,'2013-02-01 09:53:36',1,2,'Event : Mise à jour mensuelle','16.67','18.75',1),(33,'2013-02-01 09:53:36',1,3,'Event : Mise à jour mensuelle','16.67','18.75',1),(34,'2013-02-01 09:53:36',1,4,'Event : Mise à jour mensuelle','12.50','14.58',1),(35,'2013-02-01 09:53:36',1,1,'Event : Mise à jour mensuelle','18.75','20.83',1),(36,'2013-02-01 09:53:36',1,2,'Event : Mise à jour mensuelle','18.75','20.83',1),(37,'2013-02-01 09:53:36',1,3,'Event : Mise à jour mensuelle','18.75','20.83',1),(38,'2013-02-01 09:53:36',1,4,'Event : Mise à jour mensuelle','14.58','16.66',1),(39,'2013-02-01 09:53:37',1,1,'Event : Mise à jour mensuelle','20.83','22.91',1),(40,'2013-02-01 09:53:37',1,2,'Event : Mise à jour mensuelle','20.83','22.91',1),(41,'2013-02-01 09:53:37',1,3,'Event : Mise à jour mensuelle','20.83','22.91',1),(42,'2013-02-01 09:53:37',1,4,'Event : Mise à jour mensuelle','16.67','18.75',1),(43,'2013-02-01 09:53:37',1,1,'Event : Mise à jour mensuelle','22.92','25.00',1),(44,'2013-02-01 09:53:37',1,2,'Event : Mise à jour mensuelle','22.92','25.00',1),(45,'2013-02-01 09:53:37',1,3,'Event : Mise à jour mensuelle','22.92','25.00',1),(46,'2013-02-01 09:53:37',1,4,'Event : Mise à jour mensuelle','18.75','20.83',1),(47,'2013-02-01 09:53:44',1,1,'Event : Mise à jour mensuelle','25.00','27.08',1),(48,'2013-02-01 09:53:44',1,2,'Event : Mise à jour mensuelle','25.00','27.08',1),(49,'2013-02-01 09:53:44',1,3,'Event : Mise à jour mensuelle','25.00','27.08',1),(50,'2013-02-01 09:53:44',1,4,'Event : Mise à jour mensuelle','20.83','22.91',1),(51,'2013-02-01 09:53:47',1,1,'Event : Mise à jour mensuelle','27.08','29.16',1),(52,'2013-02-01 09:53:47',1,2,'Event : Mise à jour mensuelle','27.08','29.16',1),(53,'2013-02-01 09:53:47',1,3,'Event : Mise à jour mensuelle','27.08','29.16',1),(54,'2013-02-01 09:53:47',1,4,'Event : Mise à jour mensuelle','22.92','25.00',1),(55,'2013-02-01 09:53:47',1,1,'Event : Mise à jour mensuelle','29.17','31.25',1),(56,'2013-02-01 09:53:47',1,2,'Event : Mise à jour mensuelle','29.17','31.25',1),(57,'2013-02-01 09:53:47',1,3,'Event : Mise à jour mensuelle','29.17','31.25',1),(58,'2013-02-01 09:53:47',1,4,'Event : Mise à jour mensuelle','25.00','27.08',1),(59,'2013-02-01 09:53:49',1,1,'Event : Mise à jour mensuelle','31.25','33.33',1),(60,'2013-02-01 09:53:49',1,2,'Event : Mise à jour mensuelle','31.25','33.33',1),(61,'2013-02-01 09:53:49',1,3,'Event : Mise à jour mensuelle','31.25','33.33',1),(62,'2013-02-01 09:53:49',1,4,'Event : Mise à jour mensuelle','27.08','29.16',1),(63,'2013-02-01 09:53:52',1,1,'Event : Mise à jour mensuelle','33.33','35.41',1),(64,'2013-02-01 09:53:52',1,2,'Event : Mise à jour mensuelle','33.33','35.41',1),(65,'2013-02-01 09:53:52',1,3,'Event : Mise à jour mensuelle','33.33','35.41',1),(66,'2013-02-01 09:53:52',1,4,'Event : Mise à jour mensuelle','29.17','31.25',1),(67,'2013-02-01 09:53:52',1,1,'Event : Mise à jour mensuelle','35.42','37.50',1),(68,'2013-02-01 09:53:52',1,2,'Event : Mise à jour mensuelle','35.42','37.50',1),(69,'2013-02-01 09:53:52',1,3,'Event : Mise à jour mensuelle','35.42','37.50',1),(70,'2013-02-01 09:53:52',1,4,'Event : Mise à jour mensuelle','31.25','33.33',1),(71,'2013-02-01 09:53:53',1,1,'Event : Mise à jour mensuelle','37.50','39.58',1),(72,'2013-02-01 09:53:53',1,2,'Event : Mise à jour mensuelle','37.50','39.58',1),(73,'2013-02-01 09:53:53',1,3,'Event : Mise à jour mensuelle','37.50','39.58',1),(74,'2013-02-01 09:53:53',1,4,'Event : Mise à jour mensuelle','33.33','35.41',1),(75,'2013-02-01 09:53:54',1,1,'Event : Mise à jour mensuelle','39.58','41.66',1),(76,'2013-02-01 09:53:54',1,2,'Event : Mise à jour mensuelle','39.58','41.66',1),(77,'2013-02-01 09:53:54',1,3,'Event : Mise à jour mensuelle','39.58','41.66',1),(78,'2013-02-01 09:53:54',1,4,'Event : Mise à jour mensuelle','35.42','37.50',1),(79,'2013-02-01 09:53:54',1,1,'Event : Mise à jour mensuelle','41.67','43.75',1),(80,'2013-02-01 09:53:54',1,2,'Event : Mise à jour mensuelle','41.67','43.75',1),(81,'2013-02-01 09:53:54',1,3,'Event : Mise à jour mensuelle','41.67','43.75',1),(82,'2013-02-01 09:53:54',1,4,'Event : Mise à jour mensuelle','37.50','39.58',1),(83,'2013-02-01 09:55:49',1,1,'Event : Mise à jour mensuelle','43.75','45.83',1),(84,'2013-02-01 09:55:49',1,2,'Event : Mise à jour mensuelle','43.75','45.83',1),(85,'2013-02-01 09:55:49',1,3,'Event : Mise à jour mensuelle','43.75','45.83',1),(86,'2013-02-01 09:55:49',1,4,'Event : Mise à jour mensuelle','39.58','41.66',1),(87,'2013-02-01 09:55:56',1,1,'Event : Mise à jour mensuelle','45.83','47.91',1),(88,'2013-02-01 09:55:56',1,2,'Event : Mise à jour mensuelle','45.83','47.91',1),(89,'2013-02-01 09:55:56',1,3,'Event : Mise à jour mensuelle','45.83','47.91',1),(90,'2013-02-01 09:55:56',1,4,'Event : Mise à jour mensuelle','41.67','43.75',1),(91,'2013-02-01 09:56:01',1,1,'Event : Mise à jour mensuelle','47.92','50.00',1),(92,'2013-02-01 09:56:01',1,2,'Event : Mise à jour mensuelle','47.92','50.00',1),(93,'2013-02-01 09:56:01',1,3,'Event : Mise à jour mensuelle','47.92','50.00',1),(94,'2013-02-01 09:56:01',1,4,'Event : Mise à jour mensuelle','43.75','45.83',1),(95,'2013-02-01 09:56:01',1,1,'Event : Mise à jour mensuelle','50.00','52.08',1),(96,'2013-02-01 09:56:01',1,2,'Event : Mise à jour mensuelle','50.00','52.08',1),(97,'2013-02-01 09:56:01',1,3,'Event : Mise à jour mensuelle','50.00','52.08',1),(98,'2013-02-01 09:56:01',1,4,'Event : Mise à jour mensuelle','45.83','47.91',1),(99,'2013-02-01 09:56:03',1,1,'Event : Mise à jour mensuelle','52.08','54.16',1),(100,'2013-02-01 09:56:03',1,2,'Event : Mise à jour mensuelle','52.08','54.16',1),(101,'2013-02-01 09:56:03',1,3,'Event : Mise à jour mensuelle','52.08','54.16',1),(102,'2013-02-01 09:56:03',1,4,'Event : Mise à jour mensuelle','47.92','50.00',1),(103,'2013-02-01 09:56:03',1,1,'Event : Mise à jour mensuelle','54.17','56.25',1),(104,'2013-02-01 09:56:03',1,2,'Event : Mise à jour mensuelle','54.17','56.25',1),(105,'2013-02-01 09:56:03',1,3,'Event : Mise à jour mensuelle','54.17','56.25',1),(106,'2013-02-01 09:56:03',1,4,'Event : Mise à jour mensuelle','50.00','52.08',1),(107,'2013-02-01 09:56:05',1,1,'Event : Mise à jour mensuelle','56.25','58.33',1),(108,'2013-02-01 09:56:05',1,2,'Event : Mise à jour mensuelle','56.25','58.33',1),(109,'2013-02-01 09:56:05',1,3,'Event : Mise à jour mensuelle','56.25','58.33',1),(110,'2013-02-01 09:56:05',1,4,'Event : Mise à jour mensuelle','52.08','54.16',1),(111,'2013-02-01 09:56:06',1,1,'Event : Mise à jour mensuelle','58.33','60.41',1),(112,'2013-02-01 09:56:06',1,2,'Event : Mise à jour mensuelle','58.33','60.41',1),(113,'2013-02-01 09:56:06',1,3,'Event : Mise à jour mensuelle','58.33','60.41',1),(114,'2013-02-01 09:56:06',1,4,'Event : Mise à jour mensuelle','54.17','56.25',1),(115,'2013-02-01 09:56:06',1,1,'Event : Mise à jour mensuelle','60.42','62.50',1),(116,'2013-02-01 09:56:06',1,2,'Event : Mise à jour mensuelle','60.42','62.50',1),(117,'2013-02-01 09:56:06',1,3,'Event : Mise à jour mensuelle','60.42','62.50',1),(118,'2013-02-01 09:56:06',1,4,'Event : Mise à jour mensuelle','56.25','58.33',1),(119,'2013-02-01 09:56:07',1,1,'Event : Mise à jour mensuelle','62.50','64.58',1),(120,'2013-02-01 09:56:07',1,2,'Event : Mise à jour mensuelle','62.50','64.58',1),(121,'2013-02-01 09:56:07',1,3,'Event : Mise à jour mensuelle','62.50','64.58',1),(122,'2013-02-01 09:56:07',1,4,'Event : Mise à jour mensuelle','58.33','60.41',1),(123,'2013-02-01 09:56:07',1,1,'Event : Mise à jour mensuelle','64.58','66.66',1),(124,'2013-02-01 09:56:07',1,2,'Event : Mise à jour mensuelle','64.58','66.66',1),(125,'2013-02-01 09:56:07',1,3,'Event : Mise à jour mensuelle','64.58','66.66',1),(126,'2013-02-01 09:56:07',1,4,'Event : Mise à jour mensuelle','60.42','62.50',1),(127,'2013-02-01 09:56:50',1,1,'Event : Mise à jour mensuelle','66.67','68.75',1),(128,'2013-02-01 09:56:50',1,2,'Event : Mise à jour mensuelle','66.67','68.75',1),(129,'2013-02-01 09:56:50',1,3,'Event : Mise à jour mensuelle','66.67','68.75',1),(130,'2013-02-01 09:56:50',1,4,'Event : Mise à jour mensuelle','62.50','64.58',1),(131,'2013-02-01 09:56:50',1,1,'Event : Mise à jour mensuelle','68.75','70.83',1),(132,'2013-02-01 09:56:50',1,2,'Event : Mise à jour mensuelle','68.75','70.83',1),(133,'2013-02-01 09:56:50',1,3,'Event : Mise à jour mensuelle','68.75','70.83',1),(134,'2013-02-01 09:56:50',1,4,'Event : Mise à jour mensuelle','64.58','66.66',1),(135,'2013-02-17 18:49:21',1,1,'Event : Mise à jour mensuelle','70.83','72.91',1),(136,'2013-02-17 18:49:21',1,2,'Event : Mise à jour mensuelle','70.83','72.91',1),(137,'2013-02-17 18:49:21',1,3,'Event : Mise à jour mensuelle','70.83','72.91',1),(138,'2013-02-17 18:49:21',1,4,'Event : Mise à jour mensuelle','66.67','68.75',1),(139,'2013-02-17 19:06:57',1,1,'Event : Holiday','72.92','71.92',1),(140,'2013-03-01 23:12:31',1,1,'Event : Mise à jour mensuelle','71.92','74.00',1),(141,'2013-03-01 23:12:31',1,2,'Event : Mise à jour mensuelle','72.92','75.00',1),(142,'2013-03-01 23:12:31',1,3,'Event : Mise à jour mensuelle','72.92','75.00',1),(143,'2013-03-01 23:12:31',1,4,'Event : Mise à jour mensuelle','68.75','70.83',1),(145,'2015-07-19 15:44:57',1,1,'Monthly update','0','2.08334',4),(146,'2015-07-19 15:44:57',1,2,'Monthly update','0','2.08334',4),(147,'2015-07-19 15:44:57',1,3,'Monthly update','0','2.08334',4),(148,'2015-07-19 15:44:57',1,4,'Monthly update','0','2.08334',4),(151,'2015-07-19 15:44:57',1,1,'Monthly update','0','2.08334',5),(152,'2015-07-19 15:44:57',1,2,'Monthly update','0','2.08334',5),(153,'2015-07-19 15:44:57',1,3,'Monthly update','0','2.08334',5),(154,'2015-07-19 15:44:57',1,4,'Monthly update','0','2.08334',5),(157,'2015-07-19 15:44:57',1,1,'Monthly update','0','2.08334',9),(158,'2015-07-19 15:44:57',1,2,'Monthly update','0','2.08334',9),(159,'2015-07-19 15:44:57',1,3,'Monthly update','0','2.08334',9),(160,'2015-07-19 15:44:57',1,4,'Monthly update','0','2.08334',9),(163,'2016-01-22 18:59:06',12,1,'Monthly update','0','2.08334',4),(164,'2016-01-22 18:59:06',12,2,'Monthly update','0','2.08334',4),(165,'2016-01-22 18:59:06',12,3,'Monthly update','0','2.08334',4),(166,'2016-01-22 18:59:06',12,4,'Monthly update','0','2.08334',4),(168,'2016-01-22 18:59:06',12,1,'Monthly update','0','2.08334',5),(169,'2016-01-22 18:59:06',12,2,'Monthly update','0','2.08334',5),(170,'2016-01-22 18:59:06',12,3,'Monthly update','0','2.08334',5),(171,'2016-01-22 18:59:06',12,4,'Monthly update','0','2.08334',5),(173,'2016-01-22 18:59:06',12,1,'Monthly update','0','2.08334',9),(174,'2016-01-22 18:59:06',12,2,'Monthly update','0','2.08334',9),(175,'2016-01-22 18:59:06',12,3,'Monthly update','0','2.08334',9),(176,'2016-01-22 18:59:06',12,4,'Monthly update','0','2.08334',9),(178,'2016-01-22 18:59:38',12,18,'Manual update','0','10',5),(179,'2016-01-22 18:59:42',12,16,'Manual update','0','10',5),(180,'2016-01-22 18:59:45',12,12,'Manual update','0','10',5),(181,'2016-01-22 18:59:49',12,1,'Manual update','0','10',5),(182,'2016-01-22 18:59:52',12,2,'Manual update','0','10',5),(183,'2016-01-22 18:59:55',12,3,'Manual update','0','5',5),(184,'2016-07-30 19:45:49',12,1,'Manual update','0','25',3),(185,'2016-07-30 19:45:52',12,2,'Manual update','0','23',3),(186,'2016-07-30 19:45:54',12,3,'Manual update','0','10',3),(187,'2016-07-30 19:45:57',12,4,'Manual update','0','-4',3),(188,'2016-07-30 19:46:02',12,10,'Manual update','0','20',3),(189,'2016-07-30 19:46:04',12,11,'Manual update','0','30',3),(190,'2016-07-30 19:46:07',12,12,'Manual update','0','15',3),(191,'2016-07-30 19:46:09',12,13,'Manual update','0','11',3),(192,'2016-07-30 19:46:12',12,14,'Manual update','0','4',3),(193,'2016-07-30 19:46:14',12,16,'Manual update','0','5',3),(194,'2016-07-30 19:46:16',12,18,'Manual update','0','22',3); +/*!40000 ALTER TABLE `llx_holiday_logs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_holiday_users` +-- + +DROP TABLE IF EXISTS `llx_holiday_users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_holiday_users` ( + `fk_user` int(11) NOT NULL, + `nb_holiday` double NOT NULL DEFAULT '0', + `fk_type` int(11) NOT NULL DEFAULT '1' +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_holiday_users` +-- + +LOCK TABLES `llx_holiday_users` WRITE; +/*!40000 ALTER TABLE `llx_holiday_users` DISABLE KEYS */; +INSERT INTO `llx_holiday_users` VALUES (0,0,1),(1,74.00334000000001,1),(2,75.00024000000003,1),(3,75.00024000000003,1),(4,70.83356000000002,1),(5,2.08334,1),(6,0,1),(18,10,5),(16,10,5),(12,10,5),(1,10,5),(2,10,5),(3,5,5),(1,25,3),(2,23,3),(3,10,3),(4,-4,3),(10,20,3),(11,30,3),(12,15,3),(13,11,3),(14,4,3),(16,5,3),(18,22,3); +/*!40000 ALTER TABLE `llx_holiday_users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_import_model` +-- + +DROP TABLE IF EXISTS `llx_import_model`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_import_model` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL DEFAULT '0', + `label` varchar(50) NOT NULL, + `type` varchar(50) DEFAULT NULL, + `field` text NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_import_model` (`label`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_import_model` +-- + +LOCK TABLES `llx_import_model` WRITE; +/*!40000 ALTER TABLE `llx_import_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_import_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_inventory` +-- + +DROP TABLE IF EXISTS `llx_inventory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_inventory` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_warehouse` int(11) DEFAULT NULL, + `date_inventory` date DEFAULT NULL, + `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_validation` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + `datec` datetime DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_inventory_rowid` (`rowid`), + KEY `idx_inventory_ref` (`ref`), + KEY `idx_inventory_entity` (`entity`), + KEY `idx_inventory_fk_warehouse` (`fk_warehouse`), + KEY `idx_inventory_status` (`status`), + KEY `idx_inventory_import_key` (`import_key`), + KEY `idx_inventory_tms` (`tms`), + KEY `idx_inventory_datec` (`datec`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_inventory` +-- + +LOCK TABLES `llx_inventory` WRITE; +/*!40000 ALTER TABLE `llx_inventory` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_inventory` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_inventory_extrafields` +-- + +DROP TABLE IF EXISTS `llx_inventory_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_inventory_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_inventory_extrafields` +-- + +LOCK TABLES `llx_inventory_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_inventory_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_inventory_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_inventorydet` +-- + +DROP TABLE IF EXISTS `llx_inventorydet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_inventorydet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_inventory` int(11) DEFAULT '0', + `fk_warehouse` int(11) DEFAULT '0', + `fk_product` int(11) DEFAULT '0', + `batch` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, + `qty_view` double DEFAULT NULL, + `qty_stock` double DEFAULT NULL, + `qty_regulated` double DEFAULT NULL, + `pmp` double DEFAULT '0', + `pa` double DEFAULT '0', + `new_pmp` double DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_inventorydet_tms` (`tms`), + KEY `idx_inventorydet_datec` (`datec`), + KEY `idx_inventorydet_fk_inventory` (`fk_inventory`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_inventorydet` +-- + +LOCK TABLES `llx_inventorydet` WRITE; +/*!40000 ALTER TABLE `llx_inventorydet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_inventorydet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_links` +-- + +DROP TABLE IF EXISTS `llx_links`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_links` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datea` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `label` varchar(255) NOT NULL, + `objecttype` varchar(255) NOT NULL, + `objectid` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_links` (`objectid`,`label`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_links` +-- + +LOCK TABLES `llx_links` WRITE; +/*!40000 ALTER TABLE `llx_links` DISABLE KEYS */; +INSERT INTO `llx_links` VALUES (1,1,'2016-01-16 16:45:35','http://www.dolicloud.com','The DoliCoud service','societe',10),(2,1,'2016-01-16 17:14:35','https://www.dolistore.com/en/tools-documentation/12-SVG-file-for-85cm-x-200cm-rollup.html','Link to rollup file on dolistore.com','product',11),(3,1,'2016-01-22 17:40:23','http://www.nltechno.com','NLtechno portal','societe',10),(4,1,'2016-01-22 18:32:31','https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro','Link on Google Play','product',5); +/*!40000 ALTER TABLE `llx_links` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraison` +-- + +DROP TABLE IF EXISTS `llx_livraison`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraison` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_customer` varchar(30) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `ref_ext` varchar(30) DEFAULT NULL, + `ref_int` varchar(30) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `date_delivery` datetime DEFAULT NULL, + `fk_address` int(11) DEFAULT NULL, + `fk_statut` smallint(6) DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_livraison_uk_ref` (`ref`,`entity`), + KEY `idx_livraison_fk_soc` (`fk_soc`), + KEY `idx_livraison_fk_user_author` (`fk_user_author`), + KEY `idx_livraison_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_livraison_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_livraison_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_livraison_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraison` +-- + +LOCK TABLES `llx_livraison` WRITE; +/*!40000 ALTER TABLE `llx_livraison` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraison` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraison_extrafields` +-- + +DROP TABLE IF EXISTS `llx_livraison_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraison_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_livraison_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraison_extrafields` +-- + +LOCK TABLES `llx_livraison_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_livraison_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraison_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraisondet` +-- + +DROP TABLE IF EXISTS `llx_livraisondet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraisondet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_livraison` int(11) DEFAULT NULL, + `fk_origin_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `description` text, + `qty` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `rang` int(11) DEFAULT '0', + PRIMARY KEY (`rowid`), + KEY `idx_livraisondet_fk_expedition` (`fk_livraison`), + CONSTRAINT `fk_livraisondet_fk_livraison` FOREIGN KEY (`fk_livraison`) REFERENCES `llx_livraison` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraisondet` +-- + +LOCK TABLES `llx_livraisondet` WRITE; +/*!40000 ALTER TABLE `llx_livraisondet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraisondet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_livraisondet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_livraisondet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_livraisondet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_livraisondet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_livraisondet_extrafields` +-- + +LOCK TABLES `llx_livraisondet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_livraisondet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_livraisondet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_loan` +-- + +DROP TABLE IF EXISTS `llx_loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_loan` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(80) NOT NULL, + `fk_bank` int(11) DEFAULT NULL, + `capital` double NOT NULL DEFAULT '0', + `datestart` date DEFAULT NULL, + `dateend` date DEFAULT NULL, + `nbterm` double DEFAULT NULL, + `rate` double NOT NULL, + `note_private` text, + `note_public` text, + `capital_position` double DEFAULT '0', + `date_position` date DEFAULT NULL, + `paid` smallint(6) NOT NULL DEFAULT '0', + `accountancy_account_capital` varchar(32) DEFAULT NULL, + `accountancy_account_insurance` varchar(32) DEFAULT NULL, + `accountancy_account_interest` varchar(32) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `active` tinyint(4) NOT NULL DEFAULT '1', + `fk_projet` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_loan` +-- + +LOCK TABLES `llx_loan` WRITE; +/*!40000 ALTER TABLE `llx_loan` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_loan_schedule` +-- + +DROP TABLE IF EXISTS `llx_loan_schedule`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_loan_schedule` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_loan` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount_capital` double DEFAULT '0', + `amount_insurance` double DEFAULT '0', + `amount_interest` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `note_private` text COLLATE utf8_unicode_ci, + `note_public` text COLLATE utf8_unicode_ci, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_loan_schedule` +-- + +LOCK TABLES `llx_loan_schedule` WRITE; +/*!40000 ALTER TABLE `llx_loan_schedule` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_loan_schedule` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_localtax` +-- + +DROP TABLE IF EXISTS `llx_localtax`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_localtax` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `localtaxtype` tinyint(4) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_localtax` +-- + +LOCK TABLES `llx_localtax` WRITE; +/*!40000 ALTER TABLE `llx_localtax` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_localtax` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_mailing` +-- + +DROP TABLE IF EXISTS `llx_mailing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_mailing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` smallint(6) DEFAULT '0', + `titre` varchar(60) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `sujet` varchar(60) DEFAULT NULL, + `body` mediumtext, + `bgcolor` varchar(8) DEFAULT NULL, + `bgimage` varchar(255) DEFAULT NULL, + `cible` varchar(60) DEFAULT NULL, + `nbemail` int(11) DEFAULT NULL, + `email_from` varchar(160) DEFAULT NULL, + `email_replyto` varchar(160) DEFAULT NULL, + `email_errorsto` varchar(160) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `date_creat` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_appro` datetime DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_appro` int(11) DEFAULT NULL, + `joined_file1` varchar(255) DEFAULT NULL, + `joined_file2` varchar(255) DEFAULT NULL, + `joined_file3` varchar(255) DEFAULT NULL, + `joined_file4` varchar(255) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_mailing` +-- + +LOCK TABLES `llx_mailing` WRITE; +/*!40000 ALTER TABLE `llx_mailing` DISABLE KEYS */; +INSERT INTO `llx_mailing` VALUES (3,2,'Commercial emailing January',1,'Buy my product','
        \"\"
        \r\n\"Seguici\"Seguici\"Seguici\"Seguici
        \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n

        DoliCloud is the service to provide you a web hosting solution of Dolibarr ERP CRM in one click. Just enter your email to create your instance and you are ready to work. Backup and full access is to data (SFTP, Mysql) are provided.

        \r\n
        \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        Test Dolibarr ERP CRM on Dolicloud →
        \r\n
        \r\n
        \r\n
        \r\n
        \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        DoliCloud team
        \r\n Unsubscribe   |   View on web browser
        \r\n
        \r\n
        ','','',NULL,26,'dolibarr@domain.com','','',NULL,'2010-07-11 13:15:59','2017-01-29 21:33:11',NULL,'2017-01-29 21:36:40',1,12,NULL,NULL,NULL,NULL,NULL,NULL),(4,0,'Commercial emailing February',1,'Buy my product','This is a new éEéé\"Mailing content
        \r\n
        \r\n\r\nYou can adit it with the WYSIWYG editor.
        \r\nIt is\r\n
          \r\n
        • \r\n Fast
        • \r\n
        • \r\n Easy to use
        • \r\n
        • \r\n Pretty
        • \r\n
        ','','',NULL,NULL,'dolibarr@domain.com','','',NULL,'2011-07-18 20:44:33',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,1,'Commercial emailing March',1,'Buy my product','
        \"\"
        \r\n\"Seguici\"Seguici\"Seguici\"Seguici
        \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n

        DoliCloud is the service to provide you a web hosting solution of Dolibarr ERP CRM in one click. Just enter your email to create your instance and you are ready to work. Backup and full access is to data (SFTP, Mysql) are provided.

        \r\n
        \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        Test Dolibarr ERP CRM on Dolicloud →
        \r\n
        \r\n
        \r\n
        \r\n
        \r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        \r\n \r\n \r\n \r\n \r\n \r\n \r\n
        DoliCloud team
        \r\n Unsubscribe   |   View on web browser
        \r\n
        \r\n
        ','','',NULL,28,'dolibarr@domain.com','','',NULL,'2017-01-29 21:47:37','2017-01-29 21:54:55',NULL,NULL,12,12,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_mailing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_mailing_cibles` +-- + +DROP TABLE IF EXISTS `llx_mailing_cibles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_mailing_cibles` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_mailing` int(11) NOT NULL, + `fk_contact` int(11) NOT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `email` varchar(160) NOT NULL, + `other` varchar(255) DEFAULT NULL, + `tag` varchar(128) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `source_url` varchar(255) DEFAULT NULL, + `source_id` int(11) DEFAULT NULL, + `source_type` varchar(16) DEFAULT NULL, + `date_envoi` datetime DEFAULT NULL, + `error_text` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_mailing_cibles` (`fk_mailing`,`email`), + KEY `idx_mailing_cibles_email` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_mailing_cibles` +-- + +LOCK TABLES `llx_mailing_cibles` WRITE; +/*!40000 ALTER TABLE `llx_mailing_cibles` DISABLE KEYS */; +INSERT INTO `llx_mailing_cibles` VALUES (1,1,0,'Dupont','Alain','toto@aa.com','Date fin=10/07/2011',NULL,0,'0',NULL,NULL,NULL,NULL),(2,2,0,'Swiss customer supplier','','abademail@aa.com','',NULL,0,'0',NULL,NULL,NULL,NULL),(3,2,0,'Smith Vick','','vsmith@email.com','',NULL,0,'0',NULL,NULL,NULL,NULL),(4,3,0,'Swiss customer supplier','','abademail@aa.com','',NULL,1,'0',NULL,NULL,'2017-01-29 21:36:40',NULL),(5,3,0,'Smith Vick','','vsmith@email.com','',NULL,1,'0',NULL,NULL,'2017-01-29 21:36:40',NULL),(7,3,0,'Name 2','Firstname 2','emailtest2@example.com','','522b79aedf231576db576d246d82a0d7',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(8,3,0,'Name 3','Firstname 3','emailtest3@example.com','','f3e74e96a64068093af469b6826a75bf',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(9,3,0,'Name 4','Firstname 4','emailtest4@example.com','','fdacf67090698e0216f5c9a449e7404a',2,'',NULL,'file','2017-01-29 21:36:40',NULL),(10,3,0,'Name 5','Firstname 5','emailtest5@example.com','','38b4e4895bf5e7f9969c9ad9bbcd0dce',3,'',NULL,'file','2017-01-29 21:36:40',NULL),(11,3,0,'Name 1','Firstname 1','emailtest1@example.com','','b2543a771e2a10c694fc6437859e29ae',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(12,3,0,'Do','John','johndoe@example.com','','bdb70b6835ca053b113e7ac53c83efbe',-1,'',NULL,'file','2017-01-29 21:36:40','Invalid email'),(13,3,0,'Smith,Alan','','alan.smith@example.com','','326b9fb6d83f58b7ce5ca28a51022c83',2,'',NULL,'file','2017-01-29 21:36:40',NULL),(15,3,0,'Bowl','Kathy','kathy.bowl@example.com','','0848d51a04ad29adf28de7d6efe63091',2,'',NULL,'file','2017-01-29 21:36:40',NULL),(16,3,0,'Ducanseen','Herbert','herbert@example.com','','0585f4366c7b0c8bab592acb7256a409',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(17,3,0,'Djay','Djay','djay@example.com','','fad171648dcd8449d6e2f8246724f153',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(18,3,0,'','','alice.bigo@example.com','','86b03b13caec209e9a9d96979b7154b8',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(19,3,0,'','','bob.markus@example.com','','06df0b2b930718949a5afee280f04e6b',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(20,3,0,'Customer 1','','mycustomer1@example.com','','cac0a5a38fa9e67ed63d0753e08cd919',1,'',NULL,'file','2017-01-29 21:36:40',NULL),(21,3,0,'Customer 2','','mycustomer2@example.com','','19b631ee27e7036684675f2db35c54f0',0,'',NULL,'file',NULL,NULL),(22,3,0,'Customer 3','','mycustomer3@example.com','','bfd49e2db7c511e2d5bde30eda7db07a',0,'',NULL,'file',NULL,NULL),(23,3,0,'Customer 4','','mycustomer4@example.com','','de4640d0684c62dd83ffc27ff20d5938',0,'',NULL,'file',NULL,NULL),(24,3,0,'Customer 5','','mycustomer5@example.com','','2eb5786291928fd23ca0354ac261ec9b',0,'',NULL,'file',NULL,NULL),(25,3,0,'Customer 6','','mycustomer6@example.com','','c50c85b7f3370232c1d1335e17f953ca',0,'',NULL,'file',NULL,NULL),(26,3,0,'Prospect 1','','myprospect1@example.com','','553b1f7417f7c96290cdec5ca4c560f7',0,'',NULL,'file',NULL,NULL),(27,3,0,'Prospect 2','','myprospect2@example.com','','de45e526168546315ff4fedb54e63102',0,'',NULL,'file',NULL,NULL),(28,3,0,'Prospect 3','','myprospect3@example.com','','466d946e7c46881334f4abe427d382fa',0,'',NULL,'file',NULL,NULL),(29,3,0,'Prospect 4','','myprospect4@example.com','','619d1ec47318842971db7fa266b6d74a',0,'',NULL,'file',NULL,NULL),(30,3,0,'Prospect 5','','myprospect5@example.com','','e301713dcbf58d33ef1ae540dee58ad7',0,'',NULL,'file',NULL,NULL),(31,3,0,'Prospect 6','','myprospect6@example.com','','26fcbd0c641a535bfc14a80a867a61f2',0,'',NULL,'file',NULL,NULL),(32,5,0,'Swiss customer supplier','','abademail@aa.com','','0e7d20e3c9b1612a75eab5d12da84060',0,'0',NULL,'',NULL,NULL),(33,5,0,'Smith Vick','','vsmith@email.com','','cab14f12668ccb2c92843969819c6c6e',0,'0',NULL,'',NULL,NULL),(34,5,0,'Name 2','Firstname 2','emailtest2@example.com','','1b6adeceaac7e2b9c399c877f8b1a616',0,'',NULL,'file',NULL,NULL),(35,5,0,'Name 3','Firstname 3','emailtest3@example.com','','c9f6f80ba118c378aef4974e17b01a07',0,'',NULL,'file',NULL,NULL),(36,5,0,'Name 4','Firstname 4','emailtest4@example.com','','75a3051301db736a2bb7722de7b4ece1',0,'',NULL,'file',NULL,NULL),(37,5,0,'Name 5','Firstname 5','emailtest5@example.com','','a9e292e70ec11ed58718c9f5da58f870',0,'',NULL,'file',NULL,NULL),(38,5,0,'Name 1','Firstname 1','emailtest1@example.com','','0243e796981c9e82cc23d8a6a5a23570',0,'',NULL,'file',NULL,NULL),(39,5,0,'Do','John','johndoe@example.com','','7db6219748fbad348b1aa89f2014d529',0,'',NULL,'file',NULL,NULL),(40,5,0,'Smith,Alan','','alan.smith@example.com','','5006f91f3bd97918460b6dc3edf4cd7f',0,'',NULL,'file',NULL,NULL),(41,5,0,'Bowl','Kathy','kathy.bowl@example.com','','377ac5b241f2d5bf421a7162c60bf7b6',0,'',NULL,'file',NULL,NULL),(42,5,0,'Ducanseen','Herbert','herbert@example.com','','10e1b891a249ee8046f1686a0a44d773',0,'',NULL,'file',NULL,NULL),(43,5,0,'Djay','Djay','djay@example.com','','6cf76a2b74874caa6b8eced78f63bca1',0,'',NULL,'file',NULL,NULL),(44,5,0,'','','alice.bigo@example.com','','61651804afc02887a3934ab042285044',0,'',NULL,'file',NULL,NULL),(45,5,0,'','','bob.markus@example.com','','b6d3e934e4bc92d194b43041260564da',0,'',NULL,'file',NULL,NULL),(46,5,0,'Customer 1','','mycustomer1@example.com','','fa9ade908a5a420e7dc64e62d1d9eb65',0,'',NULL,'file',NULL,NULL),(47,5,0,'Customer 2','','mycustomer2@example.com','','5d502923487f0f4226ab9f5f71102857',0,'',NULL,'file',NULL,NULL),(48,5,0,'Customer 3','','mycustomer3@example.com','','0b7da54f9969554eee95684069173f23',0,'',NULL,'file',NULL,NULL),(49,5,0,'Customer 4','','mycustomer4@example.com','','b073cf47a6af4740c76620ab4442033c',0,'',NULL,'file',NULL,NULL),(50,5,0,'Customer 5','','mycustomer5@example.com','','468b7404027e91edf437c3980619c8f6',0,'',NULL,'file',NULL,NULL),(51,5,0,'Customer 6','','mycustomer6@example.com','','cb196086497f64cd23dd68aed2bf5cc8',0,'',NULL,'file',NULL,NULL),(52,5,0,'Prospect 1','','myprospect1@example.com','','9854ed6528267f30c8c22c24384b31ae',0,'',NULL,'file',NULL,NULL),(53,5,0,'Prospect 2','','myprospect2@example.com','','b37ed581bbc51b6d9a334e1626b5fe22',0,'',NULL,'file',NULL,NULL),(54,5,0,'Prospect 3','','myprospect3@example.com','','8bedd7821877a72841efae36691f7765',0,'',NULL,'file',NULL,NULL),(55,5,0,'Prospect 4','','myprospect4@example.com','','518353a5cfb1a628ada10874ac4e0098',0,'',NULL,'file',NULL,NULL),(56,5,0,'Prospect 5','','myprospect5@example.com','','de392a2999e262fec63c9de4a3fe7613',0,'',NULL,'file',NULL,NULL),(57,5,0,'Prospect 6','','myprospect6@example.com','','56256cc297c4870c514819cdb4e6b95c',0,'',NULL,'file',NULL,NULL),(58,5,0,'Prospect 7','','myprospect7@example.com','','d32512607d4e74d6f71d031538128721',0,'',NULL,'file',NULL,NULL),(59,5,0,'Prospect 8','','myprospect8@example.com','','427eeb75492ede5355996a8df998f9de',0,'',NULL,'file',NULL,NULL); +/*!40000 ALTER TABLE `llx_mailing_cibles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_menu` +-- + +DROP TABLE IF EXISTS `llx_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_menu` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `menu_handler` varchar(16) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `module` varchar(64) DEFAULT NULL, + `type` varchar(4) NOT NULL, + `mainmenu` varchar(100) NOT NULL, + `fk_menu` int(11) NOT NULL, + `fk_leftmenu` varchar(24) DEFAULT NULL, + `fk_mainmenu` varchar(24) DEFAULT NULL, + `position` int(11) NOT NULL, + `url` varchar(255) NOT NULL, + `target` varchar(100) DEFAULT NULL, + `titre` varchar(255) NOT NULL, + `langs` varchar(100) DEFAULT NULL, + `level` smallint(6) DEFAULT NULL, + `leftmenu` varchar(100) DEFAULT NULL, + `perms` varchar(255) DEFAULT NULL, + `enabled` varchar(255) DEFAULT '1', + `usertype` int(11) NOT NULL DEFAULT '0', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `idx_menu_uk_menu` (`menu_handler`,`fk_menu`,`position`,`url`,`entity`), + KEY `idx_menu_menuhandler_type` (`menu_handler`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=145176 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_menu` +-- + +LOCK TABLES `llx_menu` WRITE; +/*!40000 ALTER TABLE `llx_menu` DISABLE KEYS */; +INSERT INTO `llx_menu` VALUES (103094,'all',2,'agenda','top','agenda',0,NULL,NULL,100,'/comm/action/index.php','','Agenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103095,'all',2,'agenda','left','agenda',103094,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103096,'all',2,'agenda','left','agenda',103095,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103097,'all',2,'agenda','left','agenda',103095,NULL,NULL,102,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Calendar','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103098,'all',2,'agenda','left','agenda',103097,NULL,NULL,103,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103099,'all',2,'agenda','left','agenda',103097,NULL,NULL,104,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103100,'all',2,'agenda','left','agenda',103097,NULL,NULL,105,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103101,'all',2,'agenda','left','agenda',103097,NULL,NULL,106,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103102,'all',2,'agenda','left','agenda',103095,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103103,'all',2,'agenda','left','agenda',103102,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103104,'all',2,'agenda','left','agenda',103102,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103105,'all',2,'agenda','left','agenda',103102,NULL,NULL,115,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103106,'all',2,'agenda','left','agenda',103102,NULL,NULL,116,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2013-03-13 15:29:19'),(103107,'all',2,'agenda','left','agenda',103095,NULL,NULL,120,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2013-03-13 15:29:19'),(103108,'all',2,'pos','top','pos',0,NULL,NULL,100,'/pos/backend/listefac.php','','POS','pos@pos',NULL,'1','1','1',2,'2013-03-13 20:33:09'),(103109,'all',2,'pos','left','pos',103108,NULL,NULL,100,'/pos/backend/list.php','','Tickets','pos@pos',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103110,'all',2,'pos','left','pos',103109,NULL,NULL,100,'/pos/backend/list.php','','List','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103111,'all',2,'pos','left','pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewstatut=0','','StatusTicketDraft','pos@pos',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103112,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewstatut=1','','StatusTicketClosed','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103113,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewstatut=2','','StatusTicketProcessed','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103114,'all',2,'pos','left','@pos',103110,NULL,NULL,100,'/pos/backend/list.php?viewtype=1','','StatusTicketReturned','main',NULL,NULL,'$user->rights->pos->backend','$conf->global->POS_USE_TICKETS',0,'2013-03-13 20:33:09'),(103115,'all',2,'pos','left','pos',103108,NULL,NULL,100,'/pos/backend/listefac.php','','Factures','pos@pos',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103116,'all',2,'pos','left','pos',103115,NULL,NULL,100,'/pos/backend/listefac.php','','List','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103117,'all',2,'pos','left','pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=0','','BillStatusDraft','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103118,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=1','','BillStatusValidated','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103119,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewstatut=2&viewtype=0','','BillStatusPaid','bills',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103120,'all',2,'pos','left','@pos',103116,NULL,NULL,100,'/pos/backend/listefac.php?viewtype=2','','BillStatusReturned','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103121,'all',2,'pos','left','@pos',103108,NULL,NULL,100,'/pos/frontend/index.php','','POS','main',NULL,NULL,'$user->rights->pos->frontend','1',0,'2013-03-13 20:33:09'),(103122,'all',2,'pos','left','@pos',103121,NULL,NULL,100,'/pos/frontend/index.php','','NewTicket','main',NULL,NULL,'$user->rights->pos->frontend','1',0,'2013-03-13 20:33:09'),(103123,'all',2,'pos','left','@pos',103121,NULL,NULL,101,'/pos/backend/closes.php','','CloseandArching','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103124,'all',2,'pos','left','@pos',103108,NULL,NULL,100,'/pos/backend/terminal/cash.php','','Terminal','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103125,'all',2,'pos','left','@pos',103124,NULL,NULL,100,'/pos/backend/terminal/card.php?action=create','','NewCash','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103126,'all',2,'pos','left','@pos',103124,NULL,NULL,101,'/pos/backend/terminal/cash.php','','List','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103127,'all',2,'pos','left','@pos',103123,NULL,NULL,101,'/pos/backend/closes.php?viewstatut=0','','Arqueo','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103128,'all',2,'pos','left','@pos',103123,NULL,NULL,102,'/pos/backend/closes.php?viewstatut=1','','Closes','main',NULL,NULL,'$user->rights->pos->backend','1',0,'2013-03-13 20:33:09'),(103129,'all',2,'pos','left','@pos',103108,NULL,NULL,102,'/pos/backend/transfers.php','','Transfer','main',NULL,NULL,'$user->rights->pos->transfer','1',0,'2013-03-13 20:33:09'),(103130,'all',2,'pos','left','@pos',103108,NULL,NULL,102,'/pos/backend/resultat/index.php','','Rapport','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103131,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/casoc.php','','ReportsCustomer','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103132,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/causer.php','','ReportsUser','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103133,'all',2,'pos','left','@pos',103130,NULL,NULL,102,'/pos/backend/resultat/sellsjournal.php','','ReportsSells','main',NULL,NULL,'$user->rights->pos->stats','1',0,'2013-03-13 20:33:09'),(103134,'all',2,'opensurvey','top','opensurvey',0,NULL,NULL,200,'/opensurvey/index.php','','Surveys','opensurvey',NULL,NULL,'$user->rights->opensurvey->survey->read','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103135,'all',2,'opensurvey','left','opensurvey',-1,NULL,'opensurvey',200,'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey','','Survey','opensurvey@opensurvey',NULL,'opensurvey','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103136,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',210,'/opensurvey/public/index.php','_blank','NewSurvey','opensurvey@opensurvey',NULL,'opensurvey_new','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(103137,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',220,'/opensurvey/list.php','','List','opensurvey@opensurvey',NULL,'opensurvey_list','','$conf->opensurvey->enabled',0,'2013-03-13 20:33:42'),(124179,'all',1,'cashdesk','top','cashdesk',0,NULL,NULL,100,'/cashdesk/index.php?user=__LOGIN__','pointofsale','CashDeskMenu','cashdesk',NULL,NULL,'$user->rights->cashdesk->use','$conf->cashdesk->enabled',0,'2015-11-15 22:38:33'),(124210,'all',1,'margins','left','accountancy',-1,NULL,'accountancy',100,'/margin/index.php','','Margins','margins',NULL,'margins','$user->rights->margins->liretous','$conf->margin->enabled',2,'2015-11-15 22:41:47'),(139885,'auguria',1,'','top','home',0,NULL,NULL,10,'/index.php?mainmenu=home&leftmenu=','','Home','',-1,'','','1',2,'2016-07-30 11:13:00'),(139886,'auguria',1,'societe|fournisseur','top','companies',0,NULL,NULL,20,'/societe/index.php?mainmenu=companies&leftmenu=','','ThirdParties','companies',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)',2,'2016-07-30 11:13:00'),(139887,'auguria',1,'product|service','top','products',0,NULL,NULL,30,'/product/index.php?mainmenu=products&leftmenu=','','Products/Services','products',-1,'','$user->rights->produit->lire||$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',0,'2016-07-30 11:13:00'),(139889,'auguria',1,'propal|commande|fournisseur|contrat|ficheinter','top','commercial',0,NULL,NULL,40,'/comm/index.php?mainmenu=commercial&leftmenu=','','Commercial','commercial',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled',2,'2016-07-30 11:13:00'),(139890,'auguria',1,'comptabilite|accounting|facture|don|tax|salaries|loan','top','accountancy',0,NULL,NULL,50,'/compta/index.php?mainmenu=accountancy&leftmenu=','','MenuFinancial','compta',-1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled',2,'2016-07-30 11:13:00'),(139891,'auguria',1,'projet','top','project',0,NULL,NULL,70,'/projet/index.php?mainmenu=project&leftmenu=','','Projects','projects',-1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(139892,'auguria',1,'mailing|export|import|opensurvey|resource','top','tools',0,NULL,NULL,90,'/core/tools.php?mainmenu=tools&leftmenu=','','Tools','other',-1,'','$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read','$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled',2,'2016-07-30 11:13:00'),(139898,'auguria',1,'banque|prelevement','top','bank',0,NULL,NULL,60,'/compta/bank/index.php?mainmenu=bank&leftmenu=bank','','MenuBankCash','banks',-1,'','$user->rights->banque->lire || $user->rights->prelevement->bons->lire','$conf->banque->enabled || $conf->prelevement->enabled',0,'2016-07-30 11:13:00'),(139899,'auguria',1,'hrm|holiday|deplacement|expensereport','top','hrm',0,NULL,NULL,80,'/hrm/hrm.php?mainmenu=hrm&leftmenu=','','HRM','holiday',-1,'','$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire','$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled',0,'2016-07-30 11:13:00'),(139974,'auguria',1,'','left','home',139885,NULL,NULL,0,'/index.php','','Dashboard','',0,'','','1',2,'2016-07-30 11:13:00'),(139984,'auguria',1,'','left','home',139885,NULL,NULL,1,'/admin/index.php?leftmenu=setup','','Setup','admin',0,'setup','','$user->admin',2,'2016-07-30 11:13:00'),(139985,'auguria',1,'','left','home',139984,NULL,NULL,1,'/admin/company.php?leftmenu=setup','','MenuCompanySetup','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139986,'auguria',1,'','left','home',139984,NULL,NULL,4,'/admin/ihm.php?leftmenu=setup','','GUISetup','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139987,'auguria',1,'','left','home',139984,NULL,NULL,2,'/admin/modules.php?leftmenu=setup','','Modules','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139988,'auguria',1,'','left','home',139984,NULL,NULL,6,'/admin/boxes.php?leftmenu=setup','','Boxes','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139989,'auguria',1,'','left','home',139984,NULL,NULL,3,'/admin/menus.php?leftmenu=setup','','Menus','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139990,'auguria',1,'','left','home',139984,NULL,NULL,7,'/admin/delais.php?leftmenu=setup','','Alerts','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139991,'auguria',1,'','left','home',139984,NULL,NULL,10,'/admin/pdf.php?leftmenu=setup','','PDF','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139992,'auguria',1,'','left','home',139984,NULL,NULL,8,'/admin/security_other.php?leftmenu=setup','','Security','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139993,'auguria',1,'','left','home',139984,NULL,NULL,11,'/admin/mails.php?leftmenu=setup','','Emails','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139994,'auguria',1,'','left','home',139984,NULL,NULL,9,'/admin/limits.php?leftmenu=setup','','MenuLimits','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139995,'auguria',1,'','left','home',139984,NULL,NULL,13,'/admin/dict.php?leftmenu=setup','','Dictionary','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139996,'auguria',1,'','left','home',139984,NULL,NULL,14,'/admin/const.php?leftmenu=setup','','OtherSetup','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139997,'auguria',1,'','left','home',139984,NULL,NULL,12,'/admin/sms.php?leftmenu=setup','','SMS','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139998,'auguria',1,'','left','home',139984,NULL,NULL,4,'/admin/translation.php?leftmenu=setup','','Translation','admin',1,'','','$leftmenu==\"setup\"',2,'2016-07-30 11:13:00'),(139999,'auguria',1,'','left','home',139984,NULL,NULL,4,'/accountancy/admin/fiscalyear.php?mainmenu=setup','','Fiscalyear','admin',1,'','','$leftmenu==\"setup\" && $conf->accounting->enabled',2,'2016-07-30 11:13:00'),(140085,'auguria',1,'','left','home',140184,NULL,NULL,0,'/admin/system/dolibarr.php?leftmenu=admintools','','InfoDolibarr','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140086,'auguria',1,'','left','home',140085,NULL,NULL,2,'/admin/system/modules.php?leftmenu=admintools','','Modules','admin',2,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140087,'auguria',1,'','left','home',140085,NULL,NULL,3,'/admin/triggers.php?leftmenu=admintools','','Triggers','admin',2,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140089,'auguria',1,'','left','home',140184,NULL,NULL,1,'/admin/system/browser.php?leftmenu=admintools','','InfoBrowser','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140090,'auguria',1,'','left','home',140184,NULL,NULL,2,'/admin/system/os.php?leftmenu=admintools','','InfoOS','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140091,'auguria',1,'','left','home',140184,NULL,NULL,3,'/admin/system/web.php?leftmenu=admintools','','InfoWebServer','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140092,'auguria',1,'','left','home',140184,NULL,NULL,4,'/admin/system/phpinfo.php?leftmenu=admintools','','InfoPHP','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140094,'auguria',1,'','left','home',140184,NULL,NULL,5,'/admin/system/database.php?leftmenu=admintools','','InfoDatabase','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140184,'auguria',1,'','left','home',139885,NULL,NULL,2,'/admin/tools/index.php?leftmenu=admintools','','AdminTools','admin',0,'admintools','','$user->admin',2,'2016-07-30 11:13:00'),(140185,'auguria',1,'','left','home',140184,NULL,NULL,6,'/admin/tools/dolibarr_export.php?leftmenu=admintools','','Backup','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140186,'auguria',1,'','left','home',140184,NULL,NULL,7,'/admin/tools/dolibarr_import.php?leftmenu=admintools','','Restore','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140189,'auguria',1,'','left','home',140184,NULL,NULL,8,'/admin/tools/update.php?leftmenu=admintools','','MenuUpgrade','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140190,'auguria',1,'','left','home',140184,NULL,NULL,9,'/admin/tools/eaccelerator.php?leftmenu=admintools','','EAccelerator','admin',1,'','','$leftmenu==\"admintools\" && function_exists(\"eaccelerator_info\")',2,'2016-07-30 11:13:00'),(140191,'auguria',1,'','left','home',140184,NULL,NULL,10,'/admin/tools/listevents.php?leftmenu=admintools','','Audit','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140192,'auguria',1,'','left','home',140184,NULL,NULL,11,'/admin/tools/listsessions.php?leftmenu=admintools','','Sessions','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140193,'auguria',1,'','left','home',140184,NULL,NULL,12,'/admin/tools/purge.php?leftmenu=admintools','','Purge','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140194,'auguria',1,'','left','home',140184,NULL,NULL,13,'/support/index.php?leftmenu=admintools','_blank','HelpCenter','help',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140195,'auguria',1,'','left','home',140184,NULL,NULL,14,'/admin/system/about.php?leftmenu=admintools','','About','admin',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140204,'auguria',1,'','left','home',140184,NULL,NULL,0,'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools','','ProductVatMassChange','products',1,'','','$leftmenu==\"admintools\"',2,'2016-07-30 11:13:00'),(140205,'auguria',1,'','left','home',140184,NULL,NULL,0,'/accountancy/admin/productaccount.php?mainmenu=home&leftmenu=admintools','','InitAccountancy','accountancy',1,'','','$leftmenu==\"admintools\" && $conf->accounting->enabled',2,'2016-07-30 11:13:00'),(140284,'auguria',1,'','left','home',139885,NULL,NULL,4,'/user/home.php?leftmenu=users','','MenuUsersAndGroups','users',0,'users','','1',2,'2016-07-30 11:13:00'),(140285,'auguria',1,'','left','home',140284,NULL,NULL,0,'/user/index.php?leftmenu=users','','Users','users',1,'','$user->rights->user->user->lire || $user->admin','$leftmenu==\"users\"',2,'2016-07-30 11:13:00'),(140286,'auguria',1,'','left','home',140285,NULL,NULL,0,'/user/card.php?leftmenu=users&action=create','','NewUser','users',2,'','$user->rights->user->user->creer || $user->admin','$leftmenu==\"users\"',2,'2016-07-30 11:13:00'),(140287,'auguria',1,'','left','home',140284,NULL,NULL,1,'/user/group/index.php?leftmenu=users','','Groups','users',1,'','($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin','$leftmenu==\"users\"',2,'2016-07-30 11:13:00'),(140288,'auguria',1,'','left','home',140287,NULL,NULL,0,'/user/group/card.php?leftmenu=users&action=create','','NewGroup','users',2,'','($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin','$leftmenu==\"users\"',2,'2016-07-30 11:13:00'),(140384,'auguria',1,'','left','companies',139886,NULL,NULL,0,'/societe/index.php?leftmenu=thirdparties','','ThirdParty','companies',0,'thirdparties','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140385,'auguria',1,'','left','companies',140384,NULL,NULL,0,'/societe/soc.php?action=create','','MenuNewThirdParty','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140386,'auguria',1,'','left','companies',140384,NULL,NULL,0,'/societe/list.php?action=create','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140387,'auguria',1,'','left','companies',140384,NULL,NULL,5,'/societe/list.php?type=f&leftmenu=suppliers','','ListSuppliersShort','suppliers',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2016-07-30 11:13:00'),(140388,'auguria',1,'','left','companies',140387,NULL,NULL,0,'/societe/soc.php?leftmenu=supplier&action=create&type=f','','NewSupplier','suppliers',2,'','$user->rights->societe->creer','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2016-07-30 11:13:00'),(140390,'auguria',1,'','left','companies',140384,NULL,NULL,3,'/societe/list.php?type=p&leftmenu=prospects','','ListProspectsShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140391,'auguria',1,'','left','companies',140390,NULL,NULL,0,'/societe/soc.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140393,'auguria',1,'','left','companies',140384,NULL,NULL,4,'/societe/list.php?type=c&leftmenu=customers','','ListCustomersShort','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140394,'auguria',1,'','left','companies',140393,NULL,NULL,0,'/societe/soc.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer','companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140484,'auguria',1,'','left','companies',139886,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','ContactsAddresses','companies',0,'contacts','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140485,'auguria',1,'','left','companies',140484,NULL,NULL,0,'/contact/card.php?leftmenu=contacts&action=create','','NewContactAddress','companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140486,'auguria',1,'','left','companies',140484,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','List','companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140488,'auguria',1,'','left','companies',140486,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','ThirdPartyProspects','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140489,'auguria',1,'','left','companies',140486,NULL,NULL,2,'/contact/list.php?leftmenu=contacts&type=c','','ThirdPartyCustomers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140490,'auguria',1,'','left','companies',140486,NULL,NULL,3,'/contact/list.php?leftmenu=contacts&type=f','','ThirdPartySuppliers','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2016-07-30 11:13:00'),(140491,'auguria',1,'','left','companies',140486,NULL,NULL,4,'/contact/list.php?leftmenu=contacts&type=o','','Others','companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2016-07-30 11:13:00'),(140534,'auguria',1,'','left','companies',139886,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=1','','SuppliersCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(140535,'auguria',1,'','left','companies',140534,NULL,NULL,0,'/categories/card.php?action=create&type=1','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(140544,'auguria',1,'','left','companies',139886,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=2','','CustomersProspectsCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(140545,'auguria',1,'','left','companies',140544,NULL,NULL,0,'/categories/card.php?action=create&type=2','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(140554,'auguria',1,'','left','companies',139886,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=4','','ContactCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(140555,'auguria',1,'','left','companies',140554,NULL,NULL,0,'/categories/card.php?action=create&type=4','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(140984,'auguria',1,'','left','commercial',139889,NULL,NULL,4,'/comm/propal/index.php?leftmenu=propals','','Prop','propal',0,'propals','$user->rights->propale->lire','$conf->propal->enabled',2,'2016-07-30 11:13:00'),(140985,'auguria',1,'','left','commercial',140984,NULL,NULL,0,'/comm/propal/card.php?action=create&leftmenu=propals','','NewPropal','propal',1,'','$user->rights->propale->creer','$conf->propal->enabled',2,'2016-07-30 11:13:00'),(140986,'auguria',1,'','left','commercial',140984,NULL,NULL,1,'/comm/propal/list.php?leftmenu=propals','','List','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2016-07-30 11:13:00'),(140987,'auguria',1,'','left','commercial',140986,NULL,NULL,2,'/comm/propal/list.php?leftmenu=propals&viewstatut=0','','PropalsDraft','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2016-07-30 11:13:00'),(140988,'auguria',1,'','left','commercial',140986,NULL,NULL,3,'/comm/propal/list.php?leftmenu=propals&viewstatut=1','','PropalsOpened','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2016-07-30 11:13:00'),(140989,'auguria',1,'','left','commercial',140986,NULL,NULL,4,'/comm/propal/list.php?leftmenu=propals&viewstatut=2','','PropalStatusSigned','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2016-07-30 11:13:00'),(140990,'auguria',1,'','left','commercial',140986,NULL,NULL,5,'/comm/propal/list.php?leftmenu=propals&viewstatut=3','','PropalStatusNotSigned','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2016-07-30 11:13:00'),(140991,'auguria',1,'','left','commercial',140986,NULL,NULL,6,'/comm/propal/list.php?leftmenu=propals&viewstatut=4','','PropalStatusBilled','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2016-07-30 11:13:00'),(140994,'auguria',1,'','left','commercial',140984,NULL,NULL,4,'/comm/propal/stats/index.php?leftmenu=propals','','Statistics','propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2016-07-30 11:13:00'),(141084,'auguria',1,'','left','commercial',139889,NULL,NULL,5,'/commande/index.php?leftmenu=orders','','CustomersOrders','orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',2,'2016-07-30 11:13:00'),(141085,'auguria',1,'','left','commercial',141084,NULL,NULL,0,'/commande/card.php?action=create&leftmenu=orders','','NewOrder','orders',1,'','$user->rights->commande->creer','$conf->commande->enabled',2,'2016-07-30 11:13:00'),(141086,'auguria',1,'','left','commercial',141084,NULL,NULL,1,'/commande/list.php?leftmenu=orders','','List','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2016-07-30 11:13:00'),(141087,'auguria',1,'','left','commercial',141086,NULL,NULL,2,'/commande/list.php?leftmenu=orders&viewstatut=0','','StatusOrderDraftShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2016-07-30 11:13:00'),(141088,'auguria',1,'','left','commercial',141086,NULL,NULL,3,'/commande/list.php?leftmenu=orders&viewstatut=1','','StatusOrderValidated','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2016-07-30 11:13:00'),(141089,'auguria',1,'','left','commercial',141086,NULL,NULL,4,'/commande/list.php?leftmenu=orders&viewstatut=2','','StatusOrderOnProcessShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2016-07-30 11:13:00'),(141090,'auguria',1,'','left','commercial',141086,NULL,NULL,5,'/commande/list.php?leftmenu=orders&viewstatut=3','','StatusOrderToBill','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2016-07-30 11:13:00'),(141091,'auguria',1,'','left','commercial',141086,NULL,NULL,6,'/commande/list.php?leftmenu=orders&viewstatut=4','','StatusOrderProcessed','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2016-07-30 11:13:00'),(141092,'auguria',1,'','left','commercial',141086,NULL,NULL,7,'/commande/list.php?leftmenu=orders&viewstatut=-1','','StatusOrderCanceledShort','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2016-07-30 11:13:00'),(141093,'auguria',1,'','left','commercial',141084,NULL,NULL,4,'/commande/stats/index.php?leftmenu=orders','','Statistics','orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2016-07-30 11:13:00'),(141184,'auguria',1,'','left','commercial',139887,NULL,NULL,6,'/expedition/index.php?leftmenu=sendings','','Shipments','sendings',0,'sendings','$user->rights->expedition->lire','$conf->expedition->enabled',2,'2016-07-30 11:13:00'),(141185,'auguria',1,'','left','commercial',141184,NULL,NULL,0,'/expedition/card.php?action=create2&leftmenu=sendings','','NewSending','sendings',1,'','$user->rights->expedition->creer','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2016-07-30 11:13:00'),(141186,'auguria',1,'','left','commercial',141184,NULL,NULL,1,'/expedition/list.php?leftmenu=sendings','','List','sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2016-07-30 11:13:00'),(141187,'auguria',1,'','left','commercial',141184,NULL,NULL,2,'/expedition/stats/index.php?leftmenu=sendings','','Statistics','sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2016-07-30 11:13:00'),(141284,'auguria',1,'','left','commercial',139889,NULL,NULL,7,'/contrat/index.php?leftmenu=contracts','','Contracts','contracts',0,'contracts','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2016-07-30 11:13:00'),(141285,'auguria',1,'','left','commercial',141284,NULL,NULL,0,'/contrat/card.php?&action=create&leftmenu=contracts','','NewContract','contracts',1,'','$user->rights->contrat->creer','$conf->contrat->enabled',2,'2016-07-30 11:13:00'),(141286,'auguria',1,'','left','commercial',141284,NULL,NULL,1,'/contrat/list.php?leftmenu=contracts','','List','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2016-07-30 11:13:00'),(141287,'auguria',1,'','left','commercial',141284,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts','','MenuServices','contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2016-07-30 11:13:00'),(141288,'auguria',1,'','left','commercial',141287,NULL,NULL,0,'/contrat/services.php?leftmenu=contracts&mode=0','','MenuInactiveServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2016-07-30 11:13:00'),(141289,'auguria',1,'','left','commercial',141287,NULL,NULL,1,'/contrat/services.php?leftmenu=contracts&mode=4','','MenuRunningServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2016-07-30 11:13:00'),(141290,'auguria',1,'','left','commercial',141287,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts&mode=4&filter=expired','','MenuExpiredServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2016-07-30 11:13:00'),(141291,'auguria',1,'','left','commercial',141287,NULL,NULL,3,'/contrat/services.php?leftmenu=contracts&mode=5','','MenuClosedServices','contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled&&$leftmenu==\"contracts\"',2,'2016-07-30 11:13:00'),(141384,'auguria',1,'','left','commercial',139889,NULL,NULL,8,'/fichinter/list.php?leftmenu=ficheinter','','Interventions','interventions',0,'ficheinter','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2016-07-30 11:13:00'),(141385,'auguria',1,'','left','commercial',141384,NULL,NULL,0,'/fichinter/card.php?action=create&leftmenu=ficheinter','','NewIntervention','interventions',1,'','$user->rights->ficheinter->creer','$conf->ficheinter->enabled',2,'2016-07-30 11:13:00'),(141386,'auguria',1,'','left','commercial',141384,NULL,NULL,1,'/fichinter/list.php?leftmenu=ficheinter','','List','interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2016-07-30 11:13:00'),(141387,'auguria',1,'','left','commercial',141384,NULL,NULL,2,'/fichinter/stats/index.php?leftmenu=ficheinter','','Statistics','interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2016-07-30 11:13:00'),(141484,'auguria',1,'','left','accountancy',139890,NULL,NULL,3,'/fourn/facture/list.php?leftmenu=suppliers_bills','','BillsSuppliers','bills',0,'supplier_bills','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2016-07-30 11:13:00'),(141485,'auguria',1,'','left','accountancy',141484,NULL,NULL,0,'/fourn/facture/card.php?action=create&leftmenu=suppliers_bills','','NewBill','bills',1,'','$user->rights->fournisseur->facture->creer','$conf->supplier_invoice->enabled',2,'2016-07-30 11:13:00'),(141486,'auguria',1,'','left','accountancy',141484,NULL,NULL,1,'/fourn/facture/impayees.php?leftmenu=suppliers_bills','','Unpaid','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2016-07-30 11:13:00'),(141487,'auguria',1,'','left','accountancy',141484,NULL,NULL,2,'/fourn/facture/paiement.php?leftmenu=suppliers_bills','','Payments','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2016-07-30 11:13:00'),(141488,'auguria',1,'','left','accountancy',141484,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier','','Statistics','bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2016-07-30 11:13:00'),(141584,'auguria',1,'','left','accountancy',139890,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills','','BillsCustomers','bills',0,'customer_bills','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141585,'auguria',1,'','left','accountancy',141584,NULL,NULL,3,'/compta/facture.php?action=create&leftmenu=customers_bills','','NewBill','bills',1,'','$user->rights->facture->creer','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141586,'auguria',1,'','left','accountancy',141584,NULL,NULL,5,'/compta/facture/fiche-rec.php?leftmenu=customers_bills','','ListOfTemplates','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141588,'auguria',1,'','left','accountancy',141584,NULL,NULL,6,'/compta/paiement/list.php?leftmenu=customers_bills','','Payments','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141589,'auguria',1,'','left','accountancy',141584,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills','','List','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141594,'auguria',1,'','left','accountancy',141588,NULL,NULL,1,'/compta/paiement/rapport.php?leftmenu=customers_bills','','Reportings','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141595,'auguria',1,'','left','accountancy',139898,NULL,NULL,9,'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank','','MenuChequeDeposits','bills',0,'checks','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2016-07-30 11:13:00'),(141596,'auguria',1,'','left','accountancy',141595,NULL,NULL,0,'/compta/paiement/cheque/card.php?leftmenu=checks&action=new','','NewCheckDeposit','compta',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2016-07-30 11:13:00'),(141597,'auguria',1,'','left','accountancy',141595,NULL,NULL,1,'/compta/paiement/cheque/list.php?leftmenu=checks','','List','bills',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2016-07-30 11:13:00'),(141598,'auguria',1,'','left','accountancy',141584,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills','','Statistics','bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141604,'auguria',1,'','left','accountancy',141589,NULL,NULL,1,'/compta/facture/list.php?leftmenu=customers_bills&search_status=0','','BillShortStatusDraft','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141605,'auguria',1,'','left','accountancy',141589,NULL,NULL,2,'/compta/facture/list.php?leftmenu=customers_bills&search_status=1','','BillShortStatusNotPaid','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141606,'auguria',1,'','left','accountancy',141589,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills&search_status=2','','BillShortStatusPaid','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141607,'auguria',1,'','left','accountancy',141589,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills&search_status=3','','BillShortStatusCanceled','bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2016-07-30 11:13:00'),(141784,'auguria',1,'','left','accountancy',139890,NULL,NULL,3,'/commande/list.php?leftmenu=orders&viewstatut=3','','MenuOrdersToBill','orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',0,'2016-07-30 11:13:00'),(141884,'auguria',1,'','left','accountancy',139890,NULL,NULL,4,'/don/index.php?leftmenu=donations&mainmenu=accountancy','','Donations','donations',0,'donations','$user->rights->don->lire','$conf->don->enabled',2,'2016-07-30 11:13:00'),(141885,'auguria',1,'','left','accountancy',141884,NULL,NULL,0,'/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create','','NewDonation','donations',1,'','$user->rights->don->creer','$conf->don->enabled && $leftmenu==\"donations\"',2,'2016-07-30 11:13:00'),(141886,'auguria',1,'','left','accountancy',141884,NULL,NULL,1,'/don/list.php?leftmenu=donations&mainmenu=accountancy','','List','donations',1,'','$user->rights->don->lire','$conf->don->enabled && $leftmenu==\"donations\"',2,'2016-07-30 11:13:00'),(141984,'auguria',1,'','left','accountancy',139899,NULL,NULL,5,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','TripsAndExpenses','trips',0,'tripsandexpenses','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2016-07-30 11:13:00'),(141985,'auguria',1,'','left','accountancy',141984,NULL,NULL,1,'/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses','','New','trips',1,'','$user->rights->deplacement->creer','$conf->deplacement->enabled',0,'2016-07-30 11:13:00'),(141986,'auguria',1,'','left','accountancy',141984,NULL,NULL,2,'/compta/deplacement/list.php?leftmenu=tripsandexpenses','','List','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2016-07-30 11:13:00'),(141987,'auguria',1,'','left','accountancy',141984,NULL,NULL,2,'/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses','','Statistics','trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2016-07-30 11:13:00'),(142084,'auguria',1,'','left','accountancy',139890,NULL,NULL,6,'/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy','','MenuSpecialExpenses','compta',0,'tax','(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)','$conf->tax->enabled || $conf->salaries->enabled',0,'2016-07-30 11:13:00'),(142094,'auguria',1,'','left','accountancy',142084,NULL,NULL,1,'/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy','','Salaries','salaries',1,'tax_sal','$user->rights->salaries->read','$conf->salaries->enabled',0,'2016-07-30 11:13:00'),(142095,'auguria',1,'','left','accountancy',142094,NULL,NULL,2,'/compta/salaries/card.php?leftmenu=tax_salary&action=create','','NewPayment','companies',2,'','$user->rights->salaries->write','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2016-07-30 11:13:00'),(142096,'auguria',1,'','left','accountancy',142094,NULL,NULL,3,'/compta/salaries/index.php?leftmenu=tax_salary','','Payments','companies',2,'','$user->rights->salaries->read','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2016-07-30 11:13:00'),(142104,'auguria',1,'','left','accountancy',142084,NULL,NULL,1,'/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy','','Loans','loan',1,'tax_loan','$user->rights->loan->read','$conf->loan->enabled',0,'2016-07-30 11:13:00'),(142105,'auguria',1,'','left','accountancy',142104,NULL,NULL,2,'/loan/card.php?leftmenu=tax_loan&action=create','','NewLoan','loan',2,'','$user->rights->loan->write','$conf->loan->enabled && $leftmenu==\"tax_loan\"',0,'2016-07-30 11:13:00'),(142107,'auguria',1,'','left','accountancy',142104,NULL,NULL,4,'/loan/calc.php?leftmenu=tax_loan','','Calculator','companies',2,'','$user->rights->loan->calc','$conf->loan->enabled && $leftmenu==\"tax_loan\" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)',0,'2016-07-30 11:13:00'),(142134,'auguria',1,'','left','accountancy',142084,NULL,NULL,1,'/compta/sociales/index.php?leftmenu=tax_social','','SocialContributions','',1,'tax_social','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2016-07-30 11:13:00'),(142135,'auguria',1,'','left','accountancy',142134,NULL,NULL,2,'/compta/sociales/charges.php?leftmenu=tax_social&action=create','','MenuNewSocialContribution','',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2016-07-30 11:13:00'),(142136,'auguria',1,'','left','accountancy',142134,NULL,NULL,3,'/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly','','Payments','',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2016-07-30 11:13:00'),(142184,'auguria',1,'','left','accountancy',142084,NULL,NULL,7,'/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy','','VAT','companies',1,'tax_vat','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)',0,'2016-07-30 11:13:00'),(142185,'auguria',1,'','left','accountancy',142184,NULL,NULL,0,'/compta/tva/card.php?leftmenu=tax_vat&action=create','','New','companies',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2016-07-30 11:13:00'),(142186,'auguria',1,'','left','accountancy',142184,NULL,NULL,1,'/compta/tva/reglement.php?leftmenu=tax_vat','','List','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2016-07-30 11:13:00'),(142187,'auguria',1,'','left','accountancy',142184,NULL,NULL,2,'/compta/tva/clients.php?leftmenu=tax_vat','','ReportByCustomers','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2016-07-30 11:13:00'),(142188,'auguria',1,'','left','accountancy',142184,NULL,NULL,3,'/compta/tva/quadri_detail.php?leftmenu=tax_vat','','ReportByQuarter','companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2016-07-30 11:13:00'),(142284,'auguria',1,'','left','accountancy',139890,NULL,NULL,7,'/accountancy/customer/index.php?leftmenu=accounting','','MenuAccountancy','accountancy',0,'accounting','! empty($conf->accounting->enabled) || $user->rights->accounting->ventilation->read || $user->rights->accounting->ventilation->dispatch || $user->rights->compta->resultat->lire','$conf->accounting->enabled',0,'2016-07-30 11:13:00'),(142285,'auguria',1,'','left','accountancy',142284,NULL,NULL,1,'/accountancy/customer/index.php?leftmenu=dispatch_customer','','CustomersVentilation','accountancy',1,'dispatch_customer','$user->rights->accounting->ventilation->read','$conf->accounting->enabled',0,'2016-07-30 11:13:00'),(142286,'auguria',1,'','left','accountancy',142285,NULL,NULL,2,'/accountancy/customer/list.php','','ToDispatch','accountancy',2,'','$user->rights->accounting->ventilation->dispatch','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2016-07-30 11:13:00'),(142287,'auguria',1,'','left','accountancy',142285,NULL,NULL,3,'/accountancy/customer/lines.php','','Dispatched','accountancy',2,'','$user->rights->accounting->ventilation->read','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2016-07-30 11:13:00'),(142294,'auguria',1,'','left','accountancy',142284,NULL,NULL,4,'/accountancy/supplier/index.php?leftmenu=dispatch_supplier','','SuppliersVentilation','accountancy',1,'ventil_supplier','$user->rights->accounting->ventilation->read','$conf->accounting->enabled && $conf->fournisseur->enabled',0,'2016-07-30 11:13:00'),(142295,'auguria',1,'','left','accountancy',142294,NULL,NULL,5,'/accountancy/supplier/list.php','','ToDispatch','accountancy',2,'','$user->rights->accounting->ventilation->dispatch','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2016-07-30 11:13:00'),(142296,'auguria',1,'','left','accountancy',142294,NULL,NULL,6,'/accountancy/supplier/lines.php','','Dispatched','accountancy',2,'','$user->rights->accounting->ventilation->read','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2016-07-30 11:13:00'),(142314,'auguria',1,'','left','accountancy',142284,NULL,NULL,15,'/accountancy/bookkeeping/list.php','','Bookkeeping','accountancy',1,'bookkeeping','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2016-07-30 11:13:00'),(142319,'auguria',1,'','left','accountancy',142284,NULL,NULL,16,'/accountancy/bookkeeping/balance.php','','AccountBalance','accountancy',1,'balance','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2016-07-30 11:13:00'),(142324,'auguria',1,'','left','accountancy',142284,NULL,NULL,17,'/accountancy/report/result.php?leftmenu=ca&mainmenu=accountancy','','Reportings','main',1,'report','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2016-07-30 11:13:00'),(142325,'auguria',1,'','left','accountancy',142324,NULL,NULL,18,'/accountancy/report/result.php?leftmenu=ca','','ReportInOut','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142326,'auguria',1,'','left','accountancy',142324,NULL,NULL,19,'/compta/resultat/index.php?leftmenu=ca','','ByExpenseIncome','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142327,'auguria',1,'','left','accountancy',142324,NULL,NULL,20,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142328,'auguria',1,'','left','accountancy',142324,NULL,NULL,21,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142329,'auguria',1,'','left','accountancy',142324,NULL,NULL,22,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142330,'auguria',1,'','left','accountancy',142324,NULL,NULL,23,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142331,'auguria',1,'','left','accountancy',142324,NULL,NULL,24,'/compta/stats/cabyprodserv.php?leftmenu=ca','','ByProductsAndServices','main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142335,'auguria',1,'','left','home',142284,NULL,NULL,25,'/accountancy/admin/account.php?mainmenu=accountancy','','Chartofaccounts','admin',1,'','$user->rights->accounting->chartofaccount','$conf->accounting->enabled',0,'2016-07-30 11:13:00'),(142384,'auguria',1,'','left','accountancy',139898,NULL,NULL,9,'/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank','','StandingOrders','withdrawals',0,'withdraw','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled',2,'2016-07-30 11:13:00'),(142386,'auguria',1,'','left','accountancy',142384,NULL,NULL,0,'/compta/prelevement/create.php?leftmenu=withdraw','','NewStandingOrder','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2016-07-30 11:13:00'),(142387,'auguria',1,'','left','accountancy',142384,NULL,NULL,2,'/compta/prelevement/bons.php?leftmenu=withdraw','','WithdrawalsReceipts','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2016-07-30 11:13:00'),(142388,'auguria',1,'','left','accountancy',142384,NULL,NULL,3,'/compta/prelevement/list.php?leftmenu=withdraw','','WithdrawalsLines','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2016-07-30 11:13:00'),(142390,'auguria',1,'','left','accountancy',142384,NULL,NULL,5,'/compta/prelevement/rejets.php?leftmenu=withdraw','','Rejects','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2016-07-30 11:13:00'),(142391,'auguria',1,'','left','accountancy',142384,NULL,NULL,6,'/compta/prelevement/stats.php?leftmenu=withdraw','','Statistics','withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2016-07-30 11:13:00'),(142484,'auguria',1,'','left','accountancy',139898,NULL,NULL,1,'/compta/bank/index.php?leftmenu=bank&mainmenu=bank','','MenuBankCash','banks',0,'bank','$user->rights->banque->lire','$conf->banque->enabled',0,'2016-07-30 11:13:00'),(142485,'auguria',1,'','left','accountancy',142484,NULL,NULL,0,'/compta/bank/card.php?action=create&leftmenu=bank','','MenuNewFinancialAccount','banks',1,'','$user->rights->banque->configurer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2016-07-30 11:13:00'),(142487,'auguria',1,'','left','accountancy',142484,NULL,NULL,2,'/compta/bank/search.php?leftmenu=bank','','ListTransactions','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2016-07-30 11:13:00'),(142488,'auguria',1,'','left','accountancy',142484,NULL,NULL,3,'/compta/bank/budget.php?leftmenu=bank','','ListTransactionsByCategory','banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2016-07-30 11:13:00'),(142490,'auguria',1,'','left','accountancy',142484,NULL,NULL,5,'/compta/bank/virement.php?leftmenu=bank','','BankTransfers','banks',1,'','$user->rights->banque->transfer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2016-07-30 11:13:00'),(142534,'auguria',1,'','left','accountancy',139898,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=5','','Categories','categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2016-07-30 11:13:00'),(142535,'auguria',1,'','left','accountancy',142534,NULL,NULL,0,'/categories/card.php?action=create&type=5','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2016-07-30 11:13:00'),(142584,'auguria',1,'','left','accountancy',139890,NULL,NULL,11,'/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy','','Reportings','main',0,'ca','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled',0,'2016-07-30 11:13:00'),(142585,'auguria',1,'','left','accountancy',142584,NULL,NULL,0,'/compta/resultat/index.php?leftmenu=ca','','ReportInOut','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142586,'auguria',1,'','left','accountancy',142585,NULL,NULL,0,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142587,'auguria',1,'','left','accountancy',142584,NULL,NULL,1,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142588,'auguria',1,'','left','accountancy',142587,NULL,NULL,0,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142589,'auguria',1,'','left','accountancy',142587,NULL,NULL,1,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142590,'auguria',1,'','left','accountancy',142584,NULL,NULL,1,'/compta/journal/sellsjournal.php?leftmenu=ca','','SellsJournal','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142591,'auguria',1,'','left','accountancy',142584,NULL,NULL,1,'/compta/journal/purchasesjournal.php?leftmenu=ca','','PurchasesJournal','main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142592,'auguria',1,'','left','accountancy',142587,NULL,NULL,1,'/compta/stats/cabyprodserv.php?leftmenu=ca','','ByProductsAndServices','main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2016-07-30 11:13:00'),(142684,'auguria',1,'','left','products',139887,NULL,NULL,0,'/product/index.php?leftmenu=product&type=0','','Products','products',0,'product','$user->rights->produit->lire','$conf->product->enabled',2,'2016-07-30 11:13:00'),(142685,'auguria',1,'','left','products',142684,NULL,NULL,0,'/product/card.php?leftmenu=product&action=create&type=0','','NewProduct','products',1,'','$user->rights->produit->creer','$conf->product->enabled',2,'2016-07-30 11:13:00'),(142686,'auguria',1,'','left','products',142684,NULL,NULL,1,'/product/list.php?leftmenu=product&type=0','','List','products',1,'','$user->rights->produit->lire','$conf->product->enabled',2,'2016-07-30 11:13:00'),(142687,'auguria',1,'','left','products',142684,NULL,NULL,4,'/product/reassort.php?type=0','','Stocks','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->product->enabled',2,'2016-07-30 11:13:00'),(142688,'auguria',1,'','left','products',142684,NULL,NULL,6,'/product/stats/card.php?id=all&leftmenu=stats&type=0','','Statistics','main',1,'','$user->rights->produit->lire','$conf->propal->enabled',2,'2016-07-30 11:13:00'),(142689,'auguria',1,'','left','products',142684,NULL,NULL,5,'/product/reassortlot.php?type=0','','StocksByLotSerial','products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2016-07-30 11:13:00'),(142784,'auguria',1,'','left','products',139887,NULL,NULL,1,'/product/index.php?leftmenu=service&type=1','','Services','products',0,'service','$user->rights->service->lire','$conf->service->enabled',2,'2016-07-30 11:13:00'),(142785,'auguria',1,'','left','products',142784,NULL,NULL,0,'/product/card.php?leftmenu=service&action=create&type=1','','NewService','products',1,'','$user->rights->service->creer','$conf->service->enabled',2,'2016-07-30 11:13:00'),(142786,'auguria',1,'','left','products',142784,NULL,NULL,1,'/product/list.php?leftmenu=service&type=1','','List','products',1,'','$user->rights->service->lire','$conf->service->enabled',2,'2016-07-30 11:13:00'),(142787,'auguria',1,'','left','products',142784,NULL,NULL,5,'/product/stats/card.php?id=all&leftmenu=stats&type=1','','Statistics','main',1,'','$user->rights->service->lire','$conf->propal->enabled',2,'2016-07-30 11:13:00'),(142984,'auguria',1,'','left','products',139887,NULL,NULL,3,'/product/stock/index.php?leftmenu=stock','','Stock','stocks',0,'stock','$user->rights->stock->lire','$conf->stock->enabled',2,'2016-07-30 11:13:00'),(142985,'auguria',1,'','left','products',142984,NULL,NULL,0,'/product/stock/card.php?action=create','','MenuNewWarehouse','stocks',1,'','$user->rights->stock->creer','$conf->stock->enabled',2,'2016-07-30 11:13:00'),(142986,'auguria',1,'','left','products',142984,NULL,NULL,1,'/product/stock/list.php','','List','stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2016-07-30 11:13:00'),(142988,'auguria',1,'','left','products',142984,NULL,NULL,3,'/product/stock/mouvement.php','','Movements','stocks',1,'','$user->rights->stock->mouvement->lire','$conf->stock->enabled',2,'2016-07-30 11:13:00'),(142989,'auguria',1,'','left','products',142984,NULL,NULL,4,'/product/stock/replenish.php','','Replenishments','stocks',1,'','$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire','$conf->stock->enabled && $conf->supplier_order->enabled',2,'2016-07-30 11:13:00'),(142990,'auguria',1,'','left','products',142984,NULL,NULL,5,'/product/stock/massstockmove.php','','MassStockTransferShort','stocks',1,'','$user->rights->stock->mouvement->creer','$conf->stock->enabled',2,'2016-07-30 11:13:00'),(143084,'auguria',1,'','left','products',139887,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=0','','Categories','categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2016-07-30 11:13:00'),(143085,'auguria',1,'','left','products',143084,NULL,NULL,0,'/categories/card.php?action=create&type=0','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2016-07-30 11:13:00'),(143484,'auguria',1,'','left','project',139891,NULL,NULL,0,'/projet/index.php?leftmenu=projects','','Projects','projects',0,'projects','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143485,'auguria',1,'','left','project',143484,NULL,NULL,1,'/projet/card.php?leftmenu=projects&action=create','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143486,'auguria',1,'','left','project',143484,NULL,NULL,2,'/projet/list.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143494,'auguria',1,'','left','project',139891,NULL,NULL,0,'/projet/index.php?leftmenu=projects&mode=mine','','MyProjects','projects',0,'myprojects','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143495,'auguria',1,'','left','project',143494,NULL,NULL,1,'/projet/card.php?leftmenu=projects&action=create&mode=mine','','NewProject','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143496,'auguria',1,'','left','project',143494,NULL,NULL,2,'/projet/list.php?leftmenu=projects&mode=mine','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143584,'auguria',1,'','left','project',139891,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects','','Activities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143585,'auguria',1,'','left','project',143584,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143586,'auguria',1,'','left','project',143584,NULL,NULL,2,'/projet/tasks/list.php?leftmenu=projects','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143587,'auguria',1,'','left','project',143584,NULL,NULL,3,'/projet/activity/perweek.php?leftmenu=projects','','NewTimeSpent','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143684,'auguria',1,'','left','project',139891,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects&mode=mine','','MyActivities','projects',0,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143685,'auguria',1,'','left','project',143684,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask','projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143686,'auguria',1,'','left','project',143684,NULL,NULL,2,'/projet/tasks/list.php?leftmenu=projects&mode=mine','','List','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143687,'auguria',1,'','left','project',143684,NULL,NULL,3,'/projet/activity/perweek.php?leftmenu=projects&mode=mine','','NewTimeSpent','projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2016-07-30 11:13:00'),(143784,'auguria',1,'','left','tools',139892,NULL,NULL,0,'/comm/mailing/index.php?leftmenu=mailing','','EMailings','mails',0,'mailing','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2016-07-30 11:13:00'),(143785,'auguria',1,'','left','tools',143784,NULL,NULL,0,'/comm/mailing/card.php?leftmenu=mailing&action=create','','NewMailing','mails',1,'','$user->rights->mailing->creer','$conf->mailing->enabled',0,'2016-07-30 11:13:00'),(143786,'auguria',1,'','left','tools',143784,NULL,NULL,1,'/comm/mailing/list.php?leftmenu=mailing','','List','mails',1,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2016-07-30 11:13:00'),(143984,'auguria',1,'','left','tools',139892,NULL,NULL,2,'/exports/index.php?leftmenu=export','','FormatedExport','exports',0,'export','$user->rights->export->lire','$conf->export->enabled',2,'2016-07-30 11:13:00'),(143985,'auguria',1,'','left','tools',143984,NULL,NULL,0,'/exports/export.php?leftmenu=export','','NewExport','exports',1,'','$user->rights->export->creer','$conf->export->enabled',2,'2016-07-30 11:13:00'),(144014,'auguria',1,'','left','tools',139892,NULL,NULL,2,'/imports/index.php?leftmenu=import','','FormatedImport','exports',0,'import','$user->rights->import->run','$conf->import->enabled',2,'2016-07-30 11:13:00'),(144015,'auguria',1,'','left','tools',144014,NULL,NULL,0,'/imports/import.php?leftmenu=import','','NewImport','exports',1,'','$user->rights->import->run','$conf->import->enabled',2,'2016-07-30 11:13:00'),(144084,'auguria',1,'','left','members',139897,NULL,NULL,0,'/adherents/index.php?leftmenu=members&mainmenu=members','','Members','members',0,'members','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144085,'auguria',1,'','left','members',144084,NULL,NULL,0,'/adherents/card.php?leftmenu=members&action=create','','NewMember','members',1,'','$user->rights->adherent->creer','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144086,'auguria',1,'','left','members',144084,NULL,NULL,1,'/adherents/list.php','','List','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144087,'auguria',1,'','left','members',144086,NULL,NULL,2,'/adherents/list.php?leftmenu=members&statut=-1','','MenuMembersToValidate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144088,'auguria',1,'','left','members',144086,NULL,NULL,3,'/adherents/list.php?leftmenu=members&statut=1','','MenuMembersValidated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144089,'auguria',1,'','left','members',144086,NULL,NULL,4,'/adherents/list.php?leftmenu=members&statut=1&filter=outofdate','','MenuMembersNotUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144090,'auguria',1,'','left','members',144086,NULL,NULL,5,'/adherents/list.php?leftmenu=members&statut=1&filter=uptodate','','MenuMembersUpToDate','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144091,'auguria',1,'','left','members',144086,NULL,NULL,6,'/adherents/list.php?leftmenu=members&statut=0','','MenuMembersResiliated','members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144092,'auguria',1,'','left','members',144084,NULL,NULL,7,'/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry','','MenuMembersStats','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144184,'auguria',1,'','left','members',139897,NULL,NULL,1,'/adherents/index.php?leftmenu=members&mainmenu=members','','Subscriptions','compta',0,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144185,'auguria',1,'','left','members',144184,NULL,NULL,0,'/adherents/list.php?statut=-1&leftmenu=accountancy&mainmenu=members','','NewSubscription','compta',1,'','$user->rights->adherent->cotisation->creer','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144186,'auguria',1,'','left','members',144184,NULL,NULL,1,'/adherents/cotisations.php?leftmenu=members','','List','compta',1,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144187,'auguria',1,'','left','members',144184,NULL,NULL,7,'/adherents/stats/index.php?leftmenu=members','','MenuMembersStats','members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144384,'auguria',1,'','left','members',139897,NULL,NULL,3,'/adherents/index.php?leftmenu=export&mainmenu=members','','Exports','members',0,'export','$user->rights->adherent->export','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144385,'auguria',1,'','left','members',144384,NULL,NULL,0,'/exports/index.php?leftmenu=export','','Datas','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled && $conf->export->enabled',2,'2016-07-30 11:13:00'),(144386,'auguria',1,'','left','members',144384,NULL,NULL,1,'/adherents/htpasswd.php?leftmenu=export','','Filehtpasswd','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144387,'auguria',1,'','left','members',144384,NULL,NULL,2,'/adherents/cartes/carte.php?leftmenu=export','','MembersCards','members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144484,'auguria',1,'','left','hrm',139899,NULL,NULL,1,'/user/index.php?&leftmenu=hrm&mode=employee','','Employees','hrm',0,'hrm','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2016-07-30 11:13:00'),(144485,'auguria',1,'','left','hrm',144484,NULL,NULL,1,'/user/card.php?&action=create','','NewEmployee','hrm',1,'','$user->rights->hrm->employee->write','$conf->hrm->enabled',0,'2016-07-30 11:13:00'),(144486,'auguria',1,'','left','hrm',144484,NULL,NULL,2,'/user/index.php?$leftmenu=hrm&mode=employee','','List','hrm',1,'','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2016-07-30 11:13:00'),(144584,'auguria',1,'','left','members',139897,NULL,NULL,5,'/adherents/type.php?leftmenu=setup&mainmenu=members','','MembersTypes','members',0,'setup','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144585,'auguria',1,'','left','members',144584,NULL,NULL,0,'/adherents/type.php?leftmenu=setup&mainmenu=members&action=create','','New','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144586,'auguria',1,'','left','members',144584,NULL,NULL,1,'/adherents/type.php?leftmenu=setup&mainmenu=members','','List','members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2016-07-30 11:13:00'),(144884,'auguria',1,'','left','hrm',139899,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','CPTitreMenu','holiday',0,'hrm','$user->rights->holiday->read','$conf->holiday->enabled',0,'2016-07-30 11:13:00'),(144885,'auguria',1,'','left','hrm',144884,NULL,NULL,1,'/holiday/card.php?&action=request','','MenuAddCP','holiday',1,'','$user->rights->holiday->write','$conf->holiday->enabled',0,'2016-07-30 11:13:00'),(144886,'auguria',1,'','left','hrm',144884,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','List','holiday',1,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2016-07-30 11:13:00'),(144887,'auguria',1,'','left','hrm',144886,NULL,NULL,1,'/holiday/list.php?select_statut=2&leftmenu=hrm','','ListToApprove','trips',2,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2016-07-30 11:13:00'),(144888,'auguria',1,'','left','hrm',144884,NULL,NULL,2,'/holiday/define_holiday.php?&action=request','','MenuConfCP','holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2016-07-30 11:13:00'),(144889,'auguria',1,'','left','hrm',144884,NULL,NULL,3,'/holiday/view_log.php?&action=request','','MenuLogCP','holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2016-07-30 11:13:00'),(144984,'auguria',1,'','left','commercial',139889,NULL,NULL,6,'/fourn/commande/index.php?leftmenu=orders_suppliers','','SuppliersOrders','orders',0,'orders_suppliers','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2016-07-30 11:13:00'),(144985,'auguria',1,'','left','commercial',144984,NULL,NULL,0,'/fourn/commande/card.php?action=create&leftmenu=orders_suppliers','','NewOrder','orders',1,'','$user->rights->fournisseur->commande->creer','$conf->supplier_order->enabled',2,'2016-07-30 11:13:00'),(144986,'auguria',1,'','left','commercial',144984,NULL,NULL,1,'/fourn/commande/list.php?leftmenu=orders_suppliers&viewstatut=0','','List','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2016-07-30 11:13:00'),(144992,'auguria',1,'','left','commercial',144984,NULL,NULL,7,'/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier','','Statistics','orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2016-07-30 11:13:00'),(145084,'auguria',1,'','left','members',139897,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=3','','MembersCategoriesShort','categories',0,'cat','$user->rights->categorie->lire','$conf->adherent->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(145085,'auguria',1,'','left','members',145084,NULL,NULL,0,'/categories/card.php?action=create&type=3','','NewCategory','categories',1,'','$user->rights->categorie->creer','$conf->adherent->enabled && $conf->categorie->enabled',2,'2016-07-30 11:13:00'),(145086,'all',1,'supplier_proposal','left','commercial',-1,NULL,'commercial',300,'/supplier_proposal/index.php','','SupplierProposalsShort','supplier_proposal',NULL,'supplier_proposalsubmenu','$user->rights->supplier_proposal->lire','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145087,'all',1,'supplier_proposal','left','commercial',-1,'supplier_proposalsubmenu','commercial',301,'/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals','','SupplierProposalNew','supplier_proposal',NULL,NULL,'$user->rights->supplier_proposal->creer','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145088,'all',1,'supplier_proposal','left','commercial',-1,'supplier_proposalsubmenu','commercial',302,'/supplier_proposal/list.php?leftmenu=supplier_proposals','','List','supplier_proposal',NULL,NULL,'$user->rights->supplier_proposal->lire','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145089,'all',1,'supplier_proposal','left','commercial',-1,'supplier_proposalsubmenu','commercial',303,'/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier','','Statistics','supplier_proposal',NULL,NULL,'$user->rights->supplier_proposal->lire','$conf->supplier_proposal->enabled',2,'2016-07-30 11:13:20'),(145090,'all',1,'resource','left','tools',-1,NULL,'tools',100,'/resource/list.php','','MenuResourceIndex','resource',NULL,'resource','$user->rights->resource->read','1',0,'2016-07-30 11:13:32'),(145091,'all',1,'resource','left','tools',-1,'resource','tools',101,'/resource/add.php','','MenuResourceAdd','resource',NULL,NULL,'$user->rights->resource->read','1',0,'2016-07-30 11:13:32'),(145092,'all',1,'resource','left','tools',-1,'resource','tools',102,'/resource/list.php','','List','resource',NULL,NULL,'$user->rights->resource->read','1',0,'2016-07-30 11:13:32'),(145127,'all',1,'printing','left','home',-1,'admintools','home',300,'/printing/index.php?mainmenu=home&leftmenu=admintools','','MenuDirectPrinting','printing',NULL,NULL,'$user->rights->printing->read','$conf->printing->enabled && $leftmenu==\'admintools\'',0,'2017-01-29 15:12:44'),(145152,'all',1,'agenda','top','agenda',0,NULL,NULL,15,'/comm/action/index.php','','TMenuAgenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145153,'all',1,'agenda','left','agenda',145152,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145154,'all',1,'agenda','left','agenda',145153,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145155,'all',1,'agenda','left','agenda',145153,NULL,NULL,140,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Agenda','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145156,'all',1,'agenda','left','agenda',145155,NULL,NULL,141,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145157,'all',1,'agenda','left','agenda',145155,NULL,NULL,142,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145158,'all',1,'agenda','left','agenda',145155,NULL,NULL,143,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-08-27 13:29:14'),(145159,'all',1,'agenda','left','agenda',145155,NULL,NULL,144,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-08-27 13:29:14'),(145160,'all',1,'agenda','left','agenda',145153,NULL,NULL,110,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145161,'all',1,'agenda','left','agenda',145160,NULL,NULL,111,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145162,'all',1,'agenda','left','agenda',145160,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145163,'all',1,'agenda','left','agenda',145160,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-08-27 13:29:14'),(145164,'all',1,'agenda','left','agenda',145160,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2017-08-27 13:29:14'),(145165,'all',1,'agenda','left','agenda',145153,NULL,NULL,160,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2017-08-27 13:29:14'),(145166,'all',1,'barcode','left','tools',-1,NULL,'tools',200,'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint','','BarCodePrintsheet','products',NULL,'barcodeprint','($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled',2,'2017-08-27 13:29:14'),(145167,'all',1,'barcode','left','home',-1,'admintools','home',300,'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools','','MassBarcodeInit','products',NULL,NULL,'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled && ($leftmenu==\"admintools\" || $leftmenu==\"admintools_info\")',0,'2017-08-27 13:29:14'),(145168,'all',1,'cron','left','home',-1,'admintools','home',200,'/cron/list.php?status=-2&leftmenu=admintools','','CronList','cron',NULL,NULL,'$user->rights->cron->read','$conf->cron->enabled && preg_match(\'/^admintools/\', $leftmenu)',2,'2017-08-27 13:29:14'),(145169,'all',1,'ecm','top','ecm',0,NULL,NULL,100,'/ecm/index.php','','MenuECM','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup','$conf->ecm->enabled',2,'2017-08-27 13:29:14'),(145170,'all',1,'ecm','left','ecm',-1,NULL,'ecm',101,'/ecm/index.php?mainmenu=ecm&leftmenu=ecm','','ECMArea','ecm',NULL,'ecm','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2017-08-27 13:29:14'),(145171,'all',1,'ecm','left','ecm',-1,'ecm','ecm',102,'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsManual','ecm',NULL,'ecm_manual','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2017-08-27 13:29:14'),(145172,'all',1,'ecm','left','ecm',-1,'ecm','ecm',103,'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsAuto','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload','($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)',2,'2017-08-27 13:29:14'),(145173,'all',1,'opensurvey','left','tools',-1,NULL,'tools',200,'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey','','Survey','opensurvey',NULL,'opensurvey','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2017-08-27 13:29:14'),(145174,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',210,'/opensurvey/wizard/index.php','','NewSurvey','opensurvey',NULL,'opensurvey_new','$user->rights->opensurvey->write','$conf->opensurvey->enabled',0,'2017-08-27 13:29:14'),(145175,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',220,'/opensurvey/list.php','','List','opensurvey',NULL,'opensurvey_list','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2017-08-27 13:29:14'); +/*!40000 ALTER TABLE `llx_menu` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_multicurrency` +-- + +DROP TABLE IF EXISTS `llx_multicurrency`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_multicurrency` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_create` datetime DEFAULT NULL, + `code` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `entity` int(11) DEFAULT '1', + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_multicurrency` +-- + +LOCK TABLES `llx_multicurrency` WRITE; +/*!40000 ALTER TABLE `llx_multicurrency` DISABLE KEYS */; +INSERT INTO `llx_multicurrency` VALUES (1,'2017-02-15 21:17:16','EUR','Euros (€)',1,12); +/*!40000 ALTER TABLE `llx_multicurrency` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_multicurrency_rate` +-- + +DROP TABLE IF EXISTS `llx_multicurrency_rate`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_multicurrency_rate` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `date_sync` datetime DEFAULT NULL, + `rate` double NOT NULL DEFAULT '0', + `fk_multicurrency` int(11) NOT NULL, + `entity` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_multicurrency_rate` +-- + +LOCK TABLES `llx_multicurrency_rate` WRITE; +/*!40000 ALTER TABLE `llx_multicurrency_rate` DISABLE KEYS */; +INSERT INTO `llx_multicurrency_rate` VALUES (1,'2017-02-15 21:17:16',1,1,1); +/*!40000 ALTER TABLE `llx_multicurrency_rate` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify` +-- + +DROP TABLE IF EXISTS `llx_notify`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `daten` datetime DEFAULT NULL, + `fk_action` int(11) NOT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `objet_type` varchar(24) NOT NULL, + `objet_id` int(11) NOT NULL, + `email` varchar(255) DEFAULT NULL, + `type` varchar(16) DEFAULT 'email', + `type_target` varchar(16) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify` +-- + +LOCK TABLES `llx_notify` WRITE; +/*!40000 ALTER TABLE `llx_notify` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify_def` +-- + +DROP TABLE IF EXISTS `llx_notify_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify_def` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` date DEFAULT NULL, + `fk_action` int(11) NOT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `type` varchar(16) DEFAULT 'email', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify_def` +-- + +LOCK TABLES `llx_notify_def` WRITE; +/*!40000 ALTER TABLE `llx_notify_def` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_notify_def_object` +-- + +DROP TABLE IF EXISTS `llx_notify_def_object`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_notify_def_object` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `objet_type` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `objet_id` int(11) NOT NULL, + `type_notif` varchar(16) COLLATE utf8_unicode_ci DEFAULT 'browser', + `date_notif` datetime DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `moreparam` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_notify_def_object` +-- + +LOCK TABLES `llx_notify_def_object` WRITE; +/*!40000 ALTER TABLE `llx_notify_def_object` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_notify_def_object` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_oauth_state` +-- + +DROP TABLE IF EXISTS `llx_oauth_state`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_oauth_state` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `service` varchar(36) DEFAULT NULL, + `state` varchar(128) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_oauth_state` +-- + +LOCK TABLES `llx_oauth_state` WRITE; +/*!40000 ALTER TABLE `llx_oauth_state` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_oauth_state` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_oauth_token` +-- + +DROP TABLE IF EXISTS `llx_oauth_token`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_oauth_token` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `service` varchar(36) DEFAULT NULL, + `token` text, + `fk_user` int(11) DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_oauth_token` +-- + +LOCK TABLES `llx_oauth_token` WRITE; +/*!40000 ALTER TABLE `llx_oauth_token` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_oauth_token` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_comments` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_comments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_comments` ( + `id_comment` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_sondage` char(16) NOT NULL, + `comment` text NOT NULL, + `usercomment` text, + PRIMARY KEY (`id_comment`), + KEY `idx_id_comment` (`id_comment`), + KEY `idx_id_sondage` (`id_sondage`) +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_comments` +-- + +LOCK TABLES `llx_opensurvey_comments` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_comments` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_comments` VALUES (2,'434dio8rxfljs3p1','aaa','aaa'),(5,'434dio8rxfljs3p1','aaa','aaa'),(6,'434dio8rxfljs3p1','gfh','jj'),(11,'434dio8rxfljs3p1','fsdf','fdsf'),(12,'3imby4hf7joiilsu','fsdf','aa'),(16,'3imby4hf7joiilsu','gdfg','gfdg'),(17,'3imby4hf7joiilsu','gfdgd','gdfgd'),(18,'om4e7azfiurnjtqe','fds','fdsf'),(26,'qgsfrgb922rqzocy','gfdg','gfdg'),(27,'qgsfrgb922rqzocy','gfdg','gfd'),(30,'ckanvbe7kt3rdb3h','hfgh','fdfds'); +/*!40000 ALTER TABLE `llx_opensurvey_comments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_formquestions` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_formquestions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_formquestions` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `id_sondage` varchar(16) DEFAULT NULL, + `question` text, + `available_answers` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_formquestions` +-- + +LOCK TABLES `llx_opensurvey_formquestions` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_formquestions` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_opensurvey_formquestions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_sondage` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_sondage`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_sondage` ( + `id_sondage` varchar(16) NOT NULL, + `commentaires` text, + `mail_admin` varchar(128) DEFAULT NULL, + `nom_admin` varchar(64) DEFAULT NULL, + `fk_user_creat` int(11) NOT NULL, + `titre` text NOT NULL, + `date_fin` datetime DEFAULT NULL, + `status` int(11) DEFAULT '1', + `format` varchar(2) NOT NULL, + `mailsonde` tinyint(4) NOT NULL DEFAULT '0', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `entity` int(11) NOT NULL DEFAULT '1', + `allow_comments` tinyint(4) NOT NULL DEFAULT '1', + `allow_spy` tinyint(4) NOT NULL DEFAULT '1', + `sujet` text, + PRIMARY KEY (`id_sondage`), + KEY `idx_date_fin` (`date_fin`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_sondage` +-- + +LOCK TABLES `llx_opensurvey_sondage` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_sondage` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_sondage` VALUES ('m4467s2mtk6khmxc','What is your prefered date for a brunch','myemail@aaa.com','fdfds',0,'Date of next brunch','2013-03-07 00:00:00',1,'D',1,'2017-02-20 16:47:22',1,1,1,',1483473600'),('tim1dye8x5eeetxu','Please vote for the candidate you want to have for our new president this year.',NULL,NULL,12,'Election of new president','2017-02-26 04:00:00',1,'A',0,'2017-02-20 16:53:37',1,1,0,'Alan Candide@foragainst,Alex Candor@foragainst'); +/*!40000 ALTER TABLE `llx_opensurvey_sondage` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_user_formanswers` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_user_formanswers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_user_formanswers` ( + `fk_user_survey` int(11) NOT NULL, + `fk_question` int(11) NOT NULL, + `reponses` text +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_user_formanswers` +-- + +LOCK TABLES `llx_opensurvey_user_formanswers` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_user_formanswers` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_opensurvey_user_formanswers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_opensurvey_user_studs` +-- + +DROP TABLE IF EXISTS `llx_opensurvey_user_studs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_opensurvey_user_studs` ( + `id_users` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(64) NOT NULL, + `id_sondage` varchar(16) NOT NULL, + `reponses` varchar(100) NOT NULL, + PRIMARY KEY (`id_users`), + KEY `idx_id_users` (`id_users`), + KEY `idx_nom` (`nom`), + KEY `idx_id_sondage` (`id_sondage`), + KEY `idx_opensurvey_user_studs_id_users` (`id_users`), + KEY `idx_opensurvey_user_studs_nom` (`nom`), + KEY `idx_opensurvey_user_studs_id_sondage` (`id_sondage`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_opensurvey_user_studs` +-- + +LOCK TABLES `llx_opensurvey_user_studs` WRITE; +/*!40000 ALTER TABLE `llx_opensurvey_user_studs` DISABLE KEYS */; +INSERT INTO `llx_opensurvey_user_studs` VALUES (1,'gfdgdf','om4e7azfiurnjtqe','01'),(2,'aa','3imby4hf7joiilsu','210'),(3,'fsdf','z2qcqjh5pm1q4p99','0110'),(5,'hfghf','z2qcqjh5pm1q4p99','1110'),(6,'qqqq','ah9xvaqu1ajjrqse','000111'),(7,'hjgh','ah9xvaqu1ajjrqse','000010'),(8,'bcvb','qgsfrgb922rqzocy','011000'),(9,'gdfg','ah9xvaqu1ajjrqse','001000'),(10,'ggg','ah9xvaqu1ajjrqse','000100'),(11,'gfdgd','ah9xvaqu1ajjrqse','001000'),(12,'hhhh','ah9xvaqu1ajjrqse','010000'),(13,'iii','ah9xvaqu1ajjrqse','000100'),(14,'kkk','ah9xvaqu1ajjrqse','001000'),(15,'lllll','ah9xvaqu1ajjrqse','000001'),(16,'kk','ah9xvaqu1ajjrqse','000001'),(17,'gggg','ah9xvaqu1ajjrqse','001000'),(18,'mmmm','ah9xvaqu1ajjrqse','000000'),(19,'jkjkj','ah9xvaqu1ajjrqse','000001'),(20,'azerty','8mcdnf2hgcntfibe','012'),(21,'hfghfg','8mcdnf2hgcntfibe','012'),(22,'fd','ckanvbe7kt3rdb3h','10'),(25,'John Doe','m4467s2mtk6khmxc','1'),(26,'Martial Bill','m4467s2mtk6khmxc','01'),(27,'Marissa Campbell','m4467s2mtk6khmxc','11'),(28,'Leonard Cast','m4467s2mtk6khmxc','01'),(29,'John Doe','tim1dye8x5eeetxu','01'),(30,'Eldy','tim1dye8x5eeetxu','11'); +/*!40000 ALTER TABLE `llx_opensurvey_user_studs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_overwrite_trans` +-- + +DROP TABLE IF EXISTS `llx_overwrite_trans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_overwrite_trans` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `lang` varchar(5) DEFAULT NULL, + `transkey` varchar(128) DEFAULT NULL, + `transvalue` text, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_overwrite_trans` (`lang`,`transkey`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_overwrite_trans` +-- + +LOCK TABLES `llx_overwrite_trans` WRITE; +/*!40000 ALTER TABLE `llx_overwrite_trans` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_overwrite_trans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiement` +-- + +DROP TABLE IF EXISTS `llx_paiement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) NOT NULL DEFAULT '', + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + `fk_paiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `fk_export_compta` int(11) NOT NULL DEFAULT '0', + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiement` +-- + +LOCK TABLES `llx_paiement` WRITE; +/*!40000 ALTER TABLE `llx_paiement` DISABLE KEYS */; +INSERT INTO `llx_paiement` VALUES (2,'',1,'2011-07-18 20:50:24','2016-07-30 15:13:20','2016-07-08 12:00:00',20.00000000,6,'','',5,1,NULL,0,0,0.00000000),(3,'',1,'2011-07-18 20:50:47','2016-07-30 15:13:20','2016-07-08 12:00:00',10.00000000,4,'','',6,1,NULL,0,0,0.00000000),(5,'',1,'2011-08-01 03:34:11','2016-07-30 15:12:32','2015-08-01 03:34:11',5.63000000,6,'','Payment Invoice FA1108-0003',8,1,NULL,0,0,0.00000000),(6,'',1,'2011-08-06 20:33:54','2016-07-30 15:12:32','2015-08-06 20:33:53',5.98000000,4,'','Payment Invoice FA1108-0004',13,1,NULL,0,0,0.00000000),(8,'',1,'2011-08-08 02:53:40','2016-07-30 15:12:32','2015-08-08 12:00:00',26.10000000,4,'','',14,1,NULL,0,0,0.00000000),(9,'',1,'2011-08-08 02:55:58','2016-07-30 15:12:32','2015-08-08 12:00:00',26.96000000,1,'','',15,1,NULL,0,0,0.00000000),(17,'',1,'2012-12-09 15:28:44','2016-07-30 15:12:32','2015-12-09 12:00:00',2.00000000,4,'','',16,1,NULL,0,0,0.00000000),(18,'',1,'2012-12-09 15:28:53','2016-07-30 15:12:32','2015-12-09 12:00:00',-2.00000000,4,'','',17,1,NULL,0,0,0.00000000),(19,'',1,'2012-12-09 17:35:55','2016-07-30 15:12:32','2015-12-09 12:00:00',-2.00000000,4,'','',18,1,NULL,0,0,0.00000000),(20,'',1,'2012-12-09 17:37:02','2016-07-30 15:12:32','2015-12-09 12:00:00',2.00000000,4,'','',19,1,NULL,0,0,0.00000000),(21,'',1,'2012-12-09 18:35:07','2016-07-30 15:12:32','2015-12-09 12:00:00',-2.00000000,4,'','',20,1,NULL,0,0,0.00000000),(23,'',1,'2012-12-12 18:54:33','2016-07-30 15:12:32','2015-12-12 12:00:00',1.00000000,1,'','',21,1,NULL,0,0,0.00000000),(24,'',1,'2013-03-06 16:48:16','2016-07-30 15:13:20','2016-03-06 00:00:00',20.00000000,4,'','Adhésion/cotisation 2016',22,1,NULL,0,0,0.00000000),(25,'',1,'2013-03-20 14:30:11','2016-07-30 15:13:20','2016-03-20 00:00:00',10.00000000,2,'','Adhésion/cotisation 2011',23,1,NULL,0,0,0.00000000),(26,'',1,'2014-03-02 19:57:58','2016-07-30 15:13:20','2016-07-09 12:00:00',605.00000000,2,'','',24,1,NULL,0,0,0.00000000),(29,'',1,'2014-03-02 20:01:39','2016-07-30 15:13:20','2016-03-19 12:00:00',500.00000000,4,'','',26,1,NULL,0,0,0.00000000),(30,'',1,'2014-03-02 20:02:06','2016-07-30 15:13:20','2016-03-21 12:00:00',400.00000000,2,'','',27,1,NULL,0,0,0.00000000),(32,'',1,'2014-03-03 19:22:32','2016-07-30 15:12:32','2015-10-03 12:00:00',-400.00000000,4,'','',28,1,NULL,0,0,0.00000000),(33,'',1,'2014-03-03 19:23:16','2016-07-30 15:13:20','2016-03-10 12:00:00',-300.00000000,4,'','',29,1,NULL,0,0,0.00000000),(34,'PAY1603-0001',1,'2017-02-06 08:10:24','2017-02-06 04:10:24','2016-03-22 12:00:00',150.00000000,7,'','',33,12,NULL,0,0,150.00000000),(35,'PAY1603-0002',1,'2017-02-06 08:10:50','2017-02-06 04:10:50','2016-03-25 12:00:00',140.00000000,3,'','',34,12,NULL,0,0,140.00000000),(36,'PAY1702-0003',1,'2017-02-21 16:07:43','2017-02-21 12:07:43','2017-02-21 12:00:00',50.00000000,3,'T170201','',37,12,NULL,0,0,50.00000000); +/*!40000 ALTER TABLE `llx_paiement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiement_facture` +-- + +DROP TABLE IF EXISTS `llx_paiement_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiement_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_paiement` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `amount` double(24,8) DEFAULT NULL, + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_paiement_facture` (`fk_paiement`,`fk_facture`), + KEY `idx_paiement_facture_fk_facture` (`fk_facture`), + KEY `idx_paiement_facture_fk_paiement` (`fk_paiement`), + CONSTRAINT `fk_paiement_facture_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_paiement_facture_fk_paiement` FOREIGN KEY (`fk_paiement`) REFERENCES `llx_paiement` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiement_facture` +-- + +LOCK TABLES `llx_paiement_facture` WRITE; +/*!40000 ALTER TABLE `llx_paiement_facture` DISABLE KEYS */; +INSERT INTO `llx_paiement_facture` VALUES (2,2,2,20.00000000,0.00000000),(3,3,2,10.00000000,0.00000000),(5,5,5,5.63000000,0.00000000),(6,6,6,5.98000000,0.00000000),(9,8,2,16.10000000,0.00000000),(10,8,8,10.00000000,0.00000000),(11,9,3,15.00000000,0.00000000),(12,9,9,11.96000000,0.00000000),(24,20,9,1.00000000,0.00000000),(31,26,32,600.00000000,0.00000000),(36,29,32,500.00000000,0.00000000),(37,30,32,400.00000000,0.00000000),(38,34,211,150.00000000,150.00000000),(39,35,211,140.00000000,140.00000000),(40,36,211,50.00000000,50.00000000); +/*!40000 ALTER TABLE `llx_paiement_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementcharge` +-- + +DROP TABLE IF EXISTS `llx_paiementcharge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementcharge` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_charge` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepaiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementcharge` +-- + +LOCK TABLES `llx_paiementcharge` WRITE; +/*!40000 ALTER TABLE `llx_paiementcharge` DISABLE KEYS */; +INSERT INTO `llx_paiementcharge` VALUES (4,4,'2011-08-05 23:11:37','2011-08-05 21:11:37','2011-08-05 12:00:00',10,2,'','',12,1,NULL); +/*!40000 ALTER TABLE `llx_paiementcharge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementfourn` +-- + +DROP TABLE IF EXISTS `llx_paiementfourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementfourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_paiement` int(11) NOT NULL, + `num_paiement` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `statut` smallint(6) NOT NULL DEFAULT '0', + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementfourn` +-- + +LOCK TABLES `llx_paiementfourn` WRITE; +/*!40000 ALTER TABLE `llx_paiementfourn` DISABLE KEYS */; +INSERT INTO `llx_paiementfourn` VALUES (1,NULL,NULL,'2016-01-22 17:56:34','2016-01-22 18:56:34','2016-01-22 12:00:00',900,12,4,'','',30,0,0.00000000,NULL),(2,'SPAY1702-0001',1,'2017-02-01 15:02:45','2017-02-01 19:02:44','2017-02-01 12:00:00',200,12,4,'','',32,0,200.00000000,NULL); +/*!40000 ALTER TABLE `llx_paiementfourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_paiementfourn_facturefourn` +-- + +DROP TABLE IF EXISTS `llx_paiementfourn_facturefourn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_paiementfourn_facturefourn` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_paiementfourn` int(11) DEFAULT NULL, + `fk_facturefourn` int(11) DEFAULT NULL, + `amount` double DEFAULT '0', + `multicurrency_amount` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_paiementfourn_facturefourn` (`fk_paiementfourn`,`fk_facturefourn`), + KEY `idx_paiementfourn_facturefourn_fk_facture` (`fk_facturefourn`), + KEY `idx_paiementfourn_facturefourn_fk_paiement` (`fk_paiementfourn`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_paiementfourn_facturefourn` +-- + +LOCK TABLES `llx_paiementfourn_facturefourn` WRITE; +/*!40000 ALTER TABLE `llx_paiementfourn_facturefourn` DISABLE KEYS */; +INSERT INTO `llx_paiementfourn_facturefourn` VALUES (1,1,16,900,0.00000000),(2,2,20,200,200.00000000); +/*!40000 ALTER TABLE `llx_paiementfourn_facturefourn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_donation` +-- + +DROP TABLE IF EXISTS `llx_payment_donation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_donation` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_donation` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_donation` +-- + +LOCK TABLES `llx_payment_donation` WRITE; +/*!40000 ALTER TABLE `llx_payment_donation` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_payment_donation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_expensereport` +-- + +DROP TABLE IF EXISTS `llx_payment_expensereport`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_expensereport` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_expensereport` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `note` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_expensereport` +-- + +LOCK TABLES `llx_payment_expensereport` WRITE; +/*!40000 ALTER TABLE `llx_payment_expensereport` DISABLE KEYS */; +INSERT INTO `llx_payment_expensereport` VALUES (1,1,'2017-02-16 02:13:13','2017-02-15 22:13:13','2017-02-16 12:00:00',5,7,'','',0,12,NULL),(2,1,'2017-02-16 02:22:09','2017-02-15 22:22:09','2017-02-16 12:00:00',1,7,'','',36,12,NULL); +/*!40000 ALTER TABLE `llx_payment_expensereport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_loan` +-- + +DROP TABLE IF EXISTS `llx_payment_loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_loan` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_loan` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datep` datetime DEFAULT NULL, + `amount_capital` double DEFAULT '0', + `amount_insurance` double DEFAULT '0', + `amount_interest` double DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `note_private` text, + `note_public` text, + `fk_bank` int(11) NOT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_loan` +-- + +LOCK TABLES `llx_payment_loan` WRITE; +/*!40000 ALTER TABLE `llx_payment_loan` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_payment_loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_salary` +-- + +DROP TABLE IF EXISTS `llx_payment_salary`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_salary` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_user` int(11) NOT NULL, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `salary` double DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `datesp` date DEFAULT NULL, + `dateep` date DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_payment_salary_ref` (`num_payment`), + KEY `idx_payment_salary_user` (`fk_user`,`entity`), + KEY `idx_payment_salary_datep` (`datep`), + KEY `idx_payment_salary_datesp` (`datesp`), + KEY `idx_payment_salary_dateep` (`dateep`), + CONSTRAINT `fk_payment_salary_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_salary` +-- + +LOCK TABLES `llx_payment_salary` WRITE; +/*!40000 ALTER TABLE `llx_payment_salary` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_payment_salary` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_payment_various` +-- + +DROP TABLE IF EXISTS `llx_payment_various`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_payment_various` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `sens` smallint(6) NOT NULL DEFAULT '0', + `amount` double(24,8) NOT NULL DEFAULT '0.00000000', + `fk_typepayment` int(11) NOT NULL, + `num_payment` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `accountancy_code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text COLLATE utf8_unicode_ci, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_payment_various` +-- + +LOCK TABLES `llx_payment_various` WRITE; +/*!40000 ALTER TABLE `llx_payment_various` DISABLE KEYS */; +INSERT INTO `llx_payment_various` VALUES (2,'2017-07-14 14:46:19','2017-07-14 18:46:19','2017-07-14','2017-07-14',0,123.00000000,4,'','Miscellaneous payment','518',1,NULL,48,12,NULL); +/*!40000 ALTER TABLE `llx_payment_various` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_bons` +-- + +DROP TABLE IF EXISTS `llx_prelevement_bons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_bons` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(12) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `amount` double DEFAULT '0', + `statut` smallint(6) DEFAULT '0', + `credite` smallint(6) DEFAULT '0', + `note` text, + `date_trans` datetime DEFAULT NULL, + `method_trans` smallint(6) DEFAULT NULL, + `fk_user_trans` int(11) DEFAULT NULL, + `date_credit` datetime DEFAULT NULL, + `fk_user_credit` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_prelevement_bons_ref` (`ref`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_bons` +-- + +LOCK TABLES `llx_prelevement_bons` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_bons` DISABLE KEYS */; +INSERT INTO `llx_prelevement_bons` VALUES (1,'T170201',1,'2017-02-21 15:53:46',50,2,0,NULL,'2017-02-21 12:00:00',0,12,'2017-02-21 12:00:00',12); +/*!40000 ALTER TABLE `llx_prelevement_bons` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_facture` +-- + +DROP TABLE IF EXISTS `llx_prelevement_facture`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_facture` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `fk_prelevement_lignes` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_prelevement_facture_fk_prelevement_lignes` (`fk_prelevement_lignes`), + CONSTRAINT `fk_prelevement_facture_fk_prelevement_lignes` FOREIGN KEY (`fk_prelevement_lignes`) REFERENCES `llx_prelevement_lignes` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_facture` +-- + +LOCK TABLES `llx_prelevement_facture` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_facture` DISABLE KEYS */; +INSERT INTO `llx_prelevement_facture` VALUES (1,211,1); +/*!40000 ALTER TABLE `llx_prelevement_facture` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_facture_demande` +-- + +DROP TABLE IF EXISTS `llx_prelevement_facture_demande`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_facture_demande` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_facture` int(11) NOT NULL, + `amount` double NOT NULL, + `date_demande` datetime NOT NULL, + `traite` smallint(6) DEFAULT '0', + `date_traite` datetime DEFAULT NULL, + `fk_prelevement_bons` int(11) DEFAULT NULL, + `fk_user_demande` int(11) NOT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_facture_demande` +-- + +LOCK TABLES `llx_prelevement_facture_demande` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_facture_demande` DISABLE KEYS */; +INSERT INTO `llx_prelevement_facture_demande` VALUES (1,211,50,'2017-02-06 08:11:17',1,'2017-02-21 15:53:46',1,12,'','','',''); +/*!40000 ALTER TABLE `llx_prelevement_facture_demande` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_lignes` +-- + +DROP TABLE IF EXISTS `llx_prelevement_lignes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_lignes` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prelevement_bons` int(11) DEFAULT NULL, + `fk_soc` int(11) NOT NULL, + `statut` smallint(6) DEFAULT '0', + `client_nom` varchar(255) DEFAULT NULL, + `amount` double DEFAULT '0', + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `note` text, + PRIMARY KEY (`rowid`), + KEY `idx_prelevement_lignes_fk_prelevement_bons` (`fk_prelevement_bons`), + CONSTRAINT `fk_prelevement_lignes_fk_prelevement_bons` FOREIGN KEY (`fk_prelevement_bons`) REFERENCES `llx_prelevement_bons` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_lignes` +-- + +LOCK TABLES `llx_prelevement_lignes` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_lignes` DISABLE KEYS */; +INSERT INTO `llx_prelevement_lignes` VALUES (1,1,19,2,'Magic Food Store',50,'','','','',NULL); +/*!40000 ALTER TABLE `llx_prelevement_lignes` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_prelevement_rejet` +-- + +DROP TABLE IF EXISTS `llx_prelevement_rejet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_prelevement_rejet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prelevement_lignes` int(11) DEFAULT NULL, + `date_rejet` datetime DEFAULT NULL, + `motif` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `fk_user_creation` int(11) DEFAULT NULL, + `note` text, + `afacturer` tinyint(4) DEFAULT '0', + `fk_facture` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_prelevement_rejet` +-- + +LOCK TABLES `llx_prelevement_rejet` WRITE; +/*!40000 ALTER TABLE `llx_prelevement_rejet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_prelevement_rejet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printer_receipt` +-- + +DROP TABLE IF EXISTS `llx_printer_receipt`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printer_receipt` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `fk_type` int(11) DEFAULT NULL, + `fk_profile` int(11) DEFAULT NULL, + `parameter` varchar(128) DEFAULT NULL, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printer_receipt` +-- + +LOCK TABLES `llx_printer_receipt` WRITE; +/*!40000 ALTER TABLE `llx_printer_receipt` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printer_receipt` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printer_receipt_template` +-- + +DROP TABLE IF EXISTS `llx_printer_receipt_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printer_receipt_template` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) DEFAULT NULL, + `template` text, + `entity` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printer_receipt_template` +-- + +LOCK TABLES `llx_printer_receipt_template` WRITE; +/*!40000 ALTER TABLE `llx_printer_receipt_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printer_receipt_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_printing` +-- + +DROP TABLE IF EXISTS `llx_printing`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_printing` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `printer_name` text NOT NULL, + `printer_location` text NOT NULL, + `printer_id` varchar(255) NOT NULL, + `copy` int(11) NOT NULL DEFAULT '1', + `module` varchar(16) NOT NULL, + `driver` varchar(16) NOT NULL, + `userid` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_printing` +-- + +LOCK TABLES `llx_printing` WRITE; +/*!40000 ALTER TABLE `llx_printing` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_printing` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product` +-- + +DROP TABLE IF EXISTS `llx_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `virtual` tinyint(4) NOT NULL DEFAULT '0', + `fk_parent` int(11) DEFAULT '0', + `ref` varchar(128) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `label` varchar(255) NOT NULL, + `description` text, + `note` text, + `customcode` varchar(32) DEFAULT NULL, + `fk_country` int(11) DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `tosell` tinyint(4) DEFAULT '1', + `tobuy` tinyint(4) DEFAULT '1', + `onportal` smallint(6) DEFAULT '0', + `tobatch` tinyint(4) NOT NULL DEFAULT '0', + `fk_product_type` int(11) DEFAULT '0', + `duration` varchar(6) DEFAULT NULL, + `seuil_stock_alerte` int(11) DEFAULT '0', + `url` varchar(255) DEFAULT NULL, + `barcode` varchar(255) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT NULL, + `accountancy_code_sell` varchar(32) DEFAULT NULL, + `accountancy_code_buy` varchar(32) DEFAULT NULL, + `partnumber` varchar(32) DEFAULT NULL, + `weight` float DEFAULT NULL, + `weight_units` tinyint(4) DEFAULT NULL, + `length` float DEFAULT NULL, + `length_units` tinyint(4) DEFAULT NULL, + `surface` float DEFAULT NULL, + `surface_units` tinyint(4) DEFAULT NULL, + `volume` float DEFAULT NULL, + `volume_units` tinyint(4) DEFAULT NULL, + `stock` double DEFAULT NULL, + `pmp` double(24,8) NOT NULL DEFAULT '0.00000000', + `fifo` double(24,8) DEFAULT NULL, + `lifo` double(24,8) DEFAULT NULL, + `canvas` varchar(32) DEFAULT 'default@product', + `finished` tinyint(4) DEFAULT NULL, + `hidden` tinyint(4) DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `desiredstock` int(11) DEFAULT '0', + `fk_price_expression` int(11) DEFAULT NULL, + `fk_unit` int(11) DEFAULT NULL, + `cost_price` double(24,8) DEFAULT NULL, + `default_vat_code` varchar(10) DEFAULT NULL, + `price_autogen` smallint(6) DEFAULT '0', + `note_public` text, + `model_pdf` varchar(255) DEFAULT '', + `width` float DEFAULT NULL, + `width_units` tinyint(4) DEFAULT NULL, + `height` float DEFAULT NULL, + `height_units` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_ref` (`ref`,`entity`), + UNIQUE KEY `uk_product_barcode` (`barcode`,`fk_barcode_type`,`entity`), + KEY `idx_product_label` (`label`), + KEY `idx_product_barcode` (`barcode`), + KEY `idx_product_import_key` (`import_key`), + KEY `idx_product_fk_country` (`fk_country`), + KEY `idx_product_fk_user_author` (`fk_user_author`), + KEY `idx_product_fk_barcode_type` (`fk_barcode_type`), + KEY `fk_product_fk_unit` (`fk_unit`), + KEY `idx_product_seuil_stock_alerte` (`seuil_stock_alerte`), + CONSTRAINT `fk_product_barcode_type` FOREIGN KEY (`fk_barcode_type`) REFERENCES `llx_c_barcode_type` (`rowid`), + CONSTRAINT `fk_product_fk_country` FOREIGN KEY (`fk_country`) REFERENCES `llx_c_country` (`rowid`), + CONSTRAINT `fk_product_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product` +-- + +LOCK TABLES `llx_product` WRITE; +/*!40000 ALTER TABLE `llx_product` DISABLE KEYS */; +INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2016-01-16 16:30:35',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','','',NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,NULL,'123456789066',2,'701PINKDRESS','601PINKDRESS',NULL,670,-3,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(2,'2010-07-09 00:30:01','2016-01-16 16:37:14',0,0,'PEARPIE',1,NULL,'Pear Pie','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,NULL,'123456789077',2,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(3,'2010-07-09 00:30:25','2016-01-16 16:40:03',0,0,'CAKECONTRIB',1,NULL,'Cake making contribution','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,1,'1m',NULL,NULL,'123456789088',2,'701CAKEM','601CAKEM',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(4,'2010-07-10 14:44:06','2016-01-16 15:58:20',0,0,'APPLEPIE',1,NULL,'Apple Pie','Nice Bio Apple Pie.
        \r\n ','','',NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,NULL,'123456789034',2,'701','601',NULL,500,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(5,'2011-07-20 23:11:38','2016-01-16 16:18:24',0,0,'DOLIDROID',1,NULL,'DoliDroid, Android app for Dolibarr','DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ','','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,'https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro','123456789023',2,'701','601',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(10,'2008-12-31 00:00:00','2017-02-16 00:12:09',0,0,'COMP-XP4523',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
        \r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',NULL,12,1,1,0,1,0,'',150,NULL,'123456789055',2,'701OLDC','601OLDC',NULL,1.7,0,NULL,0,NULL,0,NULL,0,110,0.00000000,NULL,NULL,NULL,NULL,0,'20110729232310',200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(11,'2013-01-13 20:24:42','2016-07-30 13:42:31',0,0,'ROLLUPABC',1,NULL,'Rollup Dolibarr','A nice rollup','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,'0',0.000,'0',1,12,0,0,0,0,0,'',NULL,NULL,'123456789044',2,'','',NULL,2.5,0,NULL,0,2.34,0,NULL,0,-1,0.00000000,NULL,NULL,'',1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(12,'2016-07-30 17:31:29','2016-07-30 13:35:02',0,0,'DOLICLOUD',1,NULL,'SaaS service of Dolibarr ERP CRM','Cloud hosting of Dolibarr ERP and CRM software','','',NULL,9.00000000,9.00000000,9.00000000,9.00000000,'HT',0.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,1,'',NULL,'http://www.dolicloud.com','123456789013',2,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,'',0,0,NULL,NULL,NULL,NULL,8.50000000,NULL,0,NULL,'',NULL,NULL,NULL,NULL),(13,'2017-02-16 03:49:00','2017-02-15 23:49:27',0,0,'COMP-XP4548',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
        \r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',12,12,1,1,0,1,0,'',150,NULL,NULL,2,'','',NULL,1.7,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_association` +-- + +DROP TABLE IF EXISTS `llx_product_association`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_association` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_pere` int(11) NOT NULL DEFAULT '0', + `fk_product_fils` int(11) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `incdec` int(11) DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_association` (`fk_product_pere`,`fk_product_fils`), + KEY `idx_product_association` (`fk_product_fils`), + KEY `idx_product_association_fils` (`fk_product_fils`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_association` +-- + +LOCK TABLES `llx_product_association` WRITE; +/*!40000 ALTER TABLE `llx_product_association` DISABLE KEYS */; +INSERT INTO `llx_product_association` VALUES (2,5,1,1,1),(3,4,3,5,1),(4,4,1,2,1); +/*!40000 ALTER TABLE `llx_product_association` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute` +-- + +DROP TABLE IF EXISTS `llx_product_attribute`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `label` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `rang` int(11) NOT NULL DEFAULT '0', + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_attribute_ref` (`ref`), + UNIQUE KEY `unique_ref` (`ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute` +-- + +LOCK TABLES `llx_product_attribute` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute_combination` +-- + +DROP TABLE IF EXISTS `llx_product_attribute_combination`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute_combination` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_parent` int(11) NOT NULL, + `fk_product_child` int(11) NOT NULL, + `variation_price` float NOT NULL, + `variation_price_percentage` int(11) DEFAULT NULL, + `variation_weight` float NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute_combination` +-- + +LOCK TABLES `llx_product_attribute_combination` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute_combination` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute_combination` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute_combination2val` +-- + +DROP TABLE IF EXISTS `llx_product_attribute_combination2val`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute_combination2val` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_prod_combination` int(11) NOT NULL, + `fk_prod_attr` int(11) NOT NULL, + `fk_prod_attr_val` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute_combination2val` +-- + +LOCK TABLES `llx_product_attribute_combination2val` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute_combination2val` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute_combination2val` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_attribute_value` +-- + +DROP TABLE IF EXISTS `llx_product_attribute_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_attribute_value` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_attribute` int(11) NOT NULL, + `ref` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + UNIQUE KEY `unique_ref` (`fk_product_attribute`,`ref`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_attribute_value` +-- + +LOCK TABLES `llx_product_attribute_value` WRITE; +/*!40000 ALTER TABLE `llx_product_attribute_value` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_attribute_value` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_batch` +-- + +DROP TABLE IF EXISTS `llx_product_batch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_batch` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product_stock` int(11) NOT NULL, + `eatby` datetime DEFAULT NULL, + `sellby` datetime DEFAULT NULL, + `batch` varchar(30) NOT NULL, + `qty` double NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_batch` (`fk_product_stock`,`batch`), + KEY `idx_fk_product_stock` (`fk_product_stock`), + KEY `ix_fk_product_stock` (`fk_product_stock`), + KEY `idx_batch` (`batch`), + CONSTRAINT `fk_product_batch_fk_product_stock` FOREIGN KEY (`fk_product_stock`) REFERENCES `llx_product_stock` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_batch` +-- + +LOCK TABLES `llx_product_batch` WRITE; +/*!40000 ALTER TABLE `llx_product_batch` DISABLE KEYS */; +INSERT INTO `llx_product_batch` VALUES (1,'2016-07-30 13:40:39',8,NULL,NULL,'5599887766452',15,NULL),(2,'2016-07-30 13:40:12',8,NULL,NULL,'4494487766452',60,NULL),(3,'2017-02-16 00:12:09',9,NULL,NULL,'5599887766452',35,NULL); +/*!40000 ALTER TABLE `llx_product_batch` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_customer_price` +-- + +DROP TABLE IF EXISTS `llx_product_customer_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_customer_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_customer_price_fk_product_fk_soc` (`fk_product`,`fk_soc`), + KEY `idx_product_customer_price_fk_user` (`fk_user`), + KEY `fk_customer_price_fk_soc` (`fk_soc`), + KEY `idx_product_customer_price_fk_soc` (`fk_soc`), + CONSTRAINT `fk_customer_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) ON DELETE CASCADE, + CONSTRAINT `fk_customer_price_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) ON DELETE CASCADE, + CONSTRAINT `fk_product_customer_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_customer_price_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_product_customer_price_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_customer_price` +-- + +LOCK TABLES `llx_product_customer_price` WRITE; +/*!40000 ALTER TABLE `llx_product_customer_price` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_customer_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_customer_price_log` +-- + +DROP TABLE IF EXISTS `llx_product_customer_price_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_customer_price_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `fk_product` int(11) NOT NULL, + `fk_soc` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `price_min` double(24,8) DEFAULT '0.00000000', + `price_min_ttc` double(24,8) DEFAULT '0.00000000', + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_customer_price_log` +-- + +LOCK TABLES `llx_product_customer_price_log` WRITE; +/*!40000 ALTER TABLE `llx_product_customer_price_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_customer_price_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_extrafields` +-- + +DROP TABLE IF EXISTS `llx_product_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_product_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_extrafields` +-- + +LOCK TABLES `llx_product_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_product_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_fournisseur_price` +-- + +DROP TABLE IF EXISTS `llx_product_fournisseur_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_fournisseur_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `ref_fourn` varchar(30) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `quantity` double DEFAULT NULL, + `remise_percent` double NOT NULL DEFAULT '0', + `remise` double NOT NULL DEFAULT '0', + `unitprice` double(24,8) DEFAULT '0.00000000', + `charges` double(24,8) DEFAULT '0.00000000', + `unitcharges` double(24,8) DEFAULT '0.00000000', + `tva_tx` double(6,3) NOT NULL DEFAULT '0.000', + `default_vat_code` varchar(10) DEFAULT NULL, + `info_bits` int(11) NOT NULL DEFAULT '0', + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_supplier_price_expression` int(11) DEFAULT NULL, + `fk_price_expression` int(11) DEFAULT NULL, + `delivery_time_days` int(11) DEFAULT NULL, + `supplier_reputation` varchar(10) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_price_ttc` double(24,8) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_price` double(24,8) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_fournisseur_price_ref` (`ref_fourn`,`fk_soc`,`quantity`,`entity`), + KEY `idx_product_fournisseur_price_fk_user` (`fk_user`), + KEY `idx_product_fourn_price_fk_product` (`fk_product`,`entity`), + KEY `idx_product_fourn_price_fk_soc` (`fk_soc`,`entity`), + CONSTRAINT `fk_product_fournisseur_price_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_fournisseur_price_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_fournisseur_price` +-- + +LOCK TABLES `llx_product_fournisseur_price` WRITE; +/*!40000 ALTER TABLE `llx_product_fournisseur_price` DISABLE KEYS */; +INSERT INTO `llx_product_fournisseur_price` VALUES (1,'2010-07-11 18:45:42','2012-12-08 13:11:08',4,1,'ABCD',NULL,10.00000000,1,0,0,10.00000000,0.00000000,0.00000000,0.000,NULL,0,1,NULL,1,NULL,NULL,NULL,NULL,1.00000000,NULL,NULL,NULL,NULL),(2,'2016-07-30 17:34:38','2016-07-30 13:34:38',12,10,'BASIC',0,9.00000000,1,0,0,9.00000000,0.00000000,0.00000000,0.000,NULL,0,12,NULL,1,NULL,NULL,NULL,'FAVORITE',1.00000000,NULL,NULL,NULL,NULL),(3,'2017-02-02 05:17:08','2017-02-02 01:17:08',1,10,'aaa',0,100.00000000,1,10,0,100.00000000,0.00000000,0.00000000,12.500,NULL,0,12,NULL,1,NULL,NULL,NULL,NULL,1.00000000,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_product_fournisseur_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_fournisseur_price_log` +-- + +DROP TABLE IF EXISTS `llx_product_fournisseur_price_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_fournisseur_price_log` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `fk_product_fournisseur` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `quantity` double DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_price` double(24,8) DEFAULT NULL, + `multicurrency_price_ttc` double(24,8) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_fournisseur_price_log` +-- + +LOCK TABLES `llx_product_fournisseur_price_log` WRITE; +/*!40000 ALTER TABLE `llx_product_fournisseur_price_log` DISABLE KEYS */; +INSERT INTO `llx_product_fournisseur_price_log` VALUES (1,'2010-07-11 18:45:42',1,10.00000000,1,1,NULL,NULL,1.00000000,NULL,NULL); +/*!40000 ALTER TABLE `llx_product_fournisseur_price_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lang` +-- + +DROP TABLE IF EXISTS `llx_product_lang`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lang` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL DEFAULT '0', + `lang` varchar(5) NOT NULL DEFAULT '0', + `label` varchar(255) NOT NULL, + `description` text, + `note` text, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_lang` (`fk_product`,`lang`), + CONSTRAINT `fk_product_lang_fk_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lang` +-- + +LOCK TABLES `llx_product_lang` WRITE; +/*!40000 ALTER TABLE `llx_product_lang` DISABLE KEYS */; +INSERT INTO `llx_product_lang` VALUES (1,1,'en_US','Pink dress','A beatifull pink dress','',NULL),(2,2,'en_US','Pear Pie','','',NULL),(3,3,'en_US','Cake making contribution','','',NULL),(4,4,'fr_FR','Decapsuleur','','',NULL),(5,5,'en_US','DoliDroid, Android app for Dolibarr','DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ','',NULL),(9,11,'fr_FR','hfghf','','',NULL),(10,2,'fr_FR','Product P1','','',NULL),(11,4,'en_US','Apple Pie','Nice Bio Apple Pie.
        \r\n ','',NULL),(12,11,'en_US','Rollup Dolibarr','A nice rollup','',NULL),(13,10,'en_US','Computer XP4523','A powerfull computer XP4523 ','This product is imported.
        \r\nWarning: Delay to get it are not reliable.',NULL),(14,12,'en_US','SaaS hosting of Dolibarr ERP CRM','Cloud hosting of Dolibarr ERP and CRM software','',NULL),(15,12,'fr_FR','Service SaaS Hébergement Dolibarr ERP CRM','Service SaaS d'hébergement de la solution Dolibarr ERP CRM','',NULL),(16,13,'en_US','Computer XP4523','A powerfull computer XP4523 ',NULL,NULL),(17,13,'fr_FR','Computer XP4523','A powerfull computer XP4523 ',NULL,NULL); +/*!40000 ALTER TABLE `llx_product_lang` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lot` +-- + +DROP TABLE IF EXISTS `llx_product_lot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lot` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) DEFAULT '1', + `fk_product` int(11) NOT NULL, + `batch` varchar(30) DEFAULT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `import_key` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_lot` (`fk_product`,`batch`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lot` +-- + +LOCK TABLES `llx_product_lot` WRITE; +/*!40000 ALTER TABLE `llx_product_lot` DISABLE KEYS */; +INSERT INTO `llx_product_lot` VALUES (1,1,2,'123456','2016-07-07',NULL,'2016-07-21 20:55:19','2016-12-12 10:53:58',NULL,NULL,NULL),(2,1,2,'2222','2016-07-08','2016-07-07','2016-07-21 21:00:42','2016-12-12 10:53:58',NULL,NULL,NULL),(3,1,10,'5599887766452',NULL,NULL,'2016-07-30 17:39:31','2016-12-12 10:53:58',NULL,NULL,NULL),(4,1,10,'4494487766452',NULL,NULL,'2016-07-30 17:40:12','2016-12-12 10:53:58',NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_product_lot` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_lot_extrafields` +-- + +DROP TABLE IF EXISTS `llx_product_lot_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_lot_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_product_lot_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_lot_extrafields` +-- + +LOCK TABLES `llx_product_lot_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_product_lot_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_lot_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_price` +-- + +DROP TABLE IF EXISTS `llx_product_price`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_price` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `date_price` datetime DEFAULT NULL, + `price_level` smallint(6) DEFAULT '1', + `price` double(24,8) DEFAULT NULL, + `price_ttc` double(24,8) DEFAULT NULL, + `price_min` double(24,8) DEFAULT NULL, + `price_min_ttc` double(24,8) DEFAULT NULL, + `price_base_type` varchar(3) DEFAULT 'HT', + `tva_tx` double(6,3) NOT NULL, + `default_vat_code` varchar(10) DEFAULT NULL, + `recuperableonly` int(11) NOT NULL DEFAULT '0', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `fk_user_author` int(11) DEFAULT NULL, + `tosell` tinyint(4) DEFAULT '1', + `price_by_qty` int(11) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `fk_price_expression` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_price` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_product_price_fk_user_author` (`fk_user_author`), + KEY `idx_product_price_fk_product` (`fk_product`), + CONSTRAINT `fk_product_price_product` FOREIGN KEY (`fk_product`) REFERENCES `llx_product` (`rowid`), + CONSTRAINT `fk_product_price_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_price` +-- + +LOCK TABLES `llx_product_price` WRITE; +/*!40000 ALTER TABLE `llx_product_price` DISABLE KEYS */; +INSERT INTO `llx_product_price` VALUES (1,1,'2010-07-08 12:33:17',1,'2010-07-08 14:33:17',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(2,1,'2010-07-08 22:30:01',2,'2010-07-09 00:30:01',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(3,1,'2010-07-08 22:30:25',3,'2010-07-09 00:30:25',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(4,1,'2010-07-10 12:44:06',4,'2010-07-10 14:44:06',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(5,1,'2011-07-20 21:11:38',5,'2011-07-20 23:11:38',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',19.600,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(6,1,'2011-07-27 17:02:59',5,'2011-07-27 19:02:59',1,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(10,1,'2011-07-31 22:34:27',4,'2011-08-01 00:34:27',1,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(12,1,'2013-01-13 19:24:59',11,'2013-01-13 20:24:59',1,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(13,1,'2013-03-12 09:30:24',1,'2013-03-12 10:30:24',1,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,NULL,0,0.000,'0',0.000,'0',1,1,0,NULL,NULL,NULL,NULL,0.00000000),(14,1,'2016-07-30 13:31:29',12,'2016-07-30 17:31:29',1,9.00000000,9.00000000,9.00000000,9.00000000,'HT',0.000,NULL,0,0.000,'0',0.000,'0',12,1,0,NULL,NULL,NULL,NULL,0.00000000),(15,1,'2017-02-15 23:49:00',13,'2017-02-16 03:49:00',1,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,NULL,0,0.000,'0',0.000,'0',12,0,0,NULL,NULL,NULL,NULL,0.00000000); +/*!40000 ALTER TABLE `llx_product_price` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_price_by_qty` +-- + +DROP TABLE IF EXISTS `llx_product_price_by_qty`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_price_by_qty` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product_price` int(11) NOT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `price_ttc` double(24,8) DEFAULT '0.00000000', + `remise_percent` double NOT NULL DEFAULT '0', + `remise` double NOT NULL DEFAULT '0', + `qty_min` double DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_price_by_qty_level` (`fk_product_price`,`qty_min`), + KEY `idx_product_price_by_qty_fk_product_price` (`fk_product_price`), + CONSTRAINT `fk_product_price_by_qty_fk_product_price` FOREIGN KEY (`fk_product_price`) REFERENCES `llx_product_price` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_price_by_qty` +-- + +LOCK TABLES `llx_product_price_by_qty` WRITE; +/*!40000 ALTER TABLE `llx_product_price_by_qty` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_price_by_qty` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_pricerules` +-- + +DROP TABLE IF EXISTS `llx_product_pricerules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_pricerules` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `level` int(11) NOT NULL, + `fk_level` int(11) NOT NULL, + `var_percent` float NOT NULL, + `var_min_percent` float NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `unique_level` (`level`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_pricerules` +-- + +LOCK TABLES `llx_product_pricerules` WRITE; +/*!40000 ALTER TABLE `llx_product_pricerules` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_pricerules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_stock` +-- + +DROP TABLE IF EXISTS `llx_product_stock`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_stock` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `reel` double DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_product_stock` (`fk_product`,`fk_entrepot`), + KEY `idx_product_stock_fk_product` (`fk_product`), + KEY `idx_product_stock_fk_entrepot` (`fk_entrepot`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_stock` +-- + +LOCK TABLES `llx_product_stock` WRITE; +/*!40000 ALTER TABLE `llx_product_stock` DISABLE KEYS */; +INSERT INTO `llx_product_stock` VALUES (1,'2010-07-08 22:43:51',2,2,1000,NULL),(3,'2010-07-10 23:02:20',4,2,1000,NULL),(4,'2013-01-19 17:22:48',4,1,1,NULL),(5,'2013-01-19 17:22:48',1,1,2,NULL),(6,'2013-01-19 17:22:48',11,1,-1,NULL),(7,'2013-01-19 17:31:58',2,1,-2,NULL),(8,'2016-07-30 13:40:39',10,2,75,NULL),(9,'2017-02-16 00:12:09',10,1,35,NULL); +/*!40000 ALTER TABLE `llx_product_stock` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_subproduct` +-- + +DROP TABLE IF EXISTS `llx_product_subproduct`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_subproduct` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL, + `fk_product_subproduct` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `fk_product` (`fk_product`,`fk_product_subproduct`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_subproduct` +-- + +LOCK TABLES `llx_product_subproduct` WRITE; +/*!40000 ALTER TABLE `llx_product_subproduct` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_subproduct` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_product_warehouse_properties` +-- + +DROP TABLE IF EXISTS `llx_product_warehouse_properties`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_product_warehouse_properties` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `seuil_stock_alerte` int(11) DEFAULT '0', + `desiredstock` int(11) DEFAULT '0', + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_product_warehouse_properties` +-- + +LOCK TABLES `llx_product_warehouse_properties` WRITE; +/*!40000 ALTER TABLE `llx_product_warehouse_properties` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_product_warehouse_properties` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet` +-- + +DROP TABLE IF EXISTS `llx_projet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `datec` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dateo` date DEFAULT NULL, + `datee` date DEFAULT NULL, + `ref` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `description` text, + `fk_user_creat` int(11) NOT NULL, + `public` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `fk_opp_status` int(11) DEFAULT NULL, + `opp_percent` double(5,2) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `budget_amount` double(24,8) DEFAULT NULL, + `date_close` datetime DEFAULT NULL, + `fk_user_close` int(11) DEFAULT NULL, + `opp_amount` double(24,8) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_projet_ref` (`ref`,`entity`), + KEY `idx_projet_fk_soc` (`fk_soc`), + CONSTRAINT `fk_projet_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet` +-- + +LOCK TABLES `llx_projet` WRITE; +/*!40000 ALTER TABLE `llx_projet` DISABLE KEYS */; +INSERT INTO `llx_projet` VALUES (1,11,'2010-07-09','2015-10-05 20:51:28','2010-07-09',NULL,'PROJ1',1,'Project One','',1,0,1,NULL,NULL,NULL,'gdfgdfg','baleine',NULL,NULL,NULL,NULL,NULL,NULL),(2,13,'2010-07-09','2015-10-05 20:51:51','2010-07-09',NULL,'PROJ2',1,'Project Two','',1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,1,'2010-07-09','2017-02-01 11:55:08','2010-07-09',NULL,'PROJINDIAN',1,'Project for Indian company move','',1,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,NULL,'2010-07-09','2010-07-08 22:50:49','2010-07-09',NULL,'PROJSHARED',1,'The Global project','',1,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,NULL,'2010-07-11','2017-02-01 15:01:51','2010-07-11','2011-07-14','RMLL',1,'Project management RMLL','',1,1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,10,'2016-07-30','2016-07-30 15:53:07','2016-07-30',NULL,'PJ1607-0001',1,'PROJALICE1','The Alice project number 1',12,0,1,2,20.00,NULL,NULL,NULL,5000.00000000,NULL,NULL,8000.00000000,NULL,NULL),(7,10,'2016-07-30','2017-02-01 12:24:37','2016-07-30',NULL,'PJ1607-0002',1,'PROJALICE2','The Alice project number 2',12,0,1,6,100.00,NULL,NULL,NULL,NULL,'2017-02-01 16:24:31',12,7000.00000000,NULL,NULL),(8,10,'2016-07-30','2016-07-30 15:53:23','2016-07-30',NULL,'PJ1607-0003',1,'PROJALICE2','The Alice project number 3',12,0,1,6,100.00,NULL,NULL,NULL,NULL,NULL,NULL,3550.00000000,NULL,NULL),(9,4,'2016-07-31','2016-07-31 14:27:26','2016-07-31',NULL,'PJ1607-0004',1,'Project Top X','',12,0,1,2,27.00,NULL,NULL,NULL,NULL,NULL,NULL,4000.00000000,NULL,NULL); +/*!40000 ALTER TABLE `llx_projet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_projet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + `priority` text, + PRIMARY KEY (`rowid`), + KEY `idx_projet_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_extrafields` +-- + +LOCK TABLES `llx_projet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_projet_extrafields` DISABLE KEYS */; +INSERT INTO `llx_projet_extrafields` VALUES (5,'2016-07-30 15:53:07',6,NULL,'3'),(7,'2016-07-30 15:53:23',8,NULL,'5'),(9,'2016-07-31 14:27:24',9,NULL,'0'),(13,'2017-02-01 11:55:08',3,NULL,'0'),(15,'2017-02-01 12:24:31',7,NULL,'1'),(16,'2017-02-01 15:01:51',5,NULL,'0'); +/*!40000 ALTER TABLE `llx_projet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task` +-- + +DROP TABLE IF EXISTS `llx_projet_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(50) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_projet` int(11) NOT NULL, + `fk_task_parent` int(11) NOT NULL DEFAULT '0', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `dateo` datetime DEFAULT NULL, + `datee` datetime DEFAULT NULL, + `datev` datetime DEFAULT NULL, + `label` varchar(255) NOT NULL, + `description` text, + `duration_effective` double DEFAULT '0', + `planned_workload` double DEFAULT '0', + `progress` int(11) DEFAULT '0', + `priority` int(11) DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `note_private` text, + `note_public` text, + `rang` int(11) DEFAULT '0', + `model_pdf` varchar(255) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_projet_task_ref` (`ref`,`entity`), + KEY `idx_projet_task_fk_projet` (`fk_projet`), + KEY `idx_projet_task_fk_user_creat` (`fk_user_creat`), + KEY `idx_projet_task_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_projet_task_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_projet_task_fk_user_creat` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_projet_task_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task` +-- + +LOCK TABLES `llx_projet_task` WRITE; +/*!40000 ALTER TABLE `llx_projet_task` DISABLE KEYS */; +INSERT INTO `llx_projet_task` VALUES (2,'2',1,5,0,'2010-07-11 16:23:53','2013-09-08 23:06:14','2010-07-11 12:00:00','2011-07-14 12:00:00',NULL,'Heberger site RMLL','',0,0,0,0,1,NULL,0,NULL,NULL,0,NULL,NULL),(3,'TK1007-0001',1,1,0,'2014-12-21 13:52:41','2016-07-30 11:35:40','2014-12-21 16:52:00',NULL,NULL,'Analyze','',9000,36000,0,0,1,NULL,0,NULL,'gdfgdfgdf',0,NULL,NULL),(4,'TK1007-0002',1,1,0,'2014-12-21 13:55:39','2016-07-30 11:35:51','2014-12-21 16:55:00',NULL,NULL,'Specification','',7200,18000,25,0,1,NULL,0,NULL,NULL,0,NULL,NULL),(5,'TK1007-0003',1,1,0,'2014-12-21 14:16:58','2016-07-30 11:35:59','2014-12-21 17:16:00',NULL,NULL,'Development','',0,0,0,0,1,NULL,0,NULL,NULL,0,NULL,NULL),(6,'TK1607-0004',1,6,0,'2016-07-30 15:33:27','2016-07-30 11:34:47','2016-07-30 02:00:00',NULL,NULL,'Project preparation phase A','',75600,720000,10,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(7,'TK1607-0005',1,6,0,'2016-07-30 15:33:39','2017-01-30 11:23:39','2016-07-30 02:00:00',NULL,NULL,'Project preparation phase B','',40260,1080000,5,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(8,'TK1607-0006',1,6,0,'2016-07-30 15:33:53','2016-07-30 11:33:53','2016-07-30 02:00:00',NULL,NULL,'Project execution phase A','',0,162000,0,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(9,'TK1607-0007',1,6,0,'2016-07-30 15:34:09','2016-07-30 11:34:09','2016-10-27 02:00:00',NULL,NULL,'Project execution phase B','',0,2160000,0,0,12,NULL,0,NULL,NULL,0,NULL,NULL),(10,'TK1007-0008',1,1,0,'2016-07-30 15:36:31','2016-07-30 11:36:31','2016-07-30 02:00:00',NULL,NULL,'Tests','',0,316800,0,0,12,NULL,0,NULL,NULL,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_projet_task` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task_extrafields` +-- + +DROP TABLE IF EXISTS `llx_projet_task_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_projet_task_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task_extrafields` +-- + +LOCK TABLES `llx_projet_task_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_projet_task_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_projet_task_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_projet_task_time` +-- + +DROP TABLE IF EXISTS `llx_projet_task_time`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_projet_task_time` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_task` int(11) NOT NULL, + `task_date` date DEFAULT NULL, + `task_datehour` datetime DEFAULT NULL, + `task_date_withhour` int(11) DEFAULT '0', + `task_duration` double DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `thm` double(24,8) DEFAULT NULL, + `note` text, + `invoice_id` int(11) DEFAULT NULL, + `invoice_line_id` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `datec` date DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + KEY `idx_projet_task_time_task` (`fk_task`), + KEY `idx_projet_task_time_date` (`task_date`), + KEY `idx_projet_task_time_datehour` (`task_datehour`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_projet_task_time` +-- + +LOCK TABLES `llx_projet_task_time` WRITE; +/*!40000 ALTER TABLE `llx_projet_task_time` DISABLE KEYS */; +INSERT INTO `llx_projet_task_time` VALUES (2,4,'2014-12-21','2014-12-21 12:00:00',0,3600,1,NULL,'',NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(3,4,'2014-12-18','2014-12-18 12:00:00',0,3600,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(4,3,'2014-12-21','2014-12-21 12:00:00',0,3600,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(5,3,'2014-12-21','2014-12-21 12:00:00',0,1800,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(6,3,'2014-12-21','2014-12-21 12:00:00',0,3600,1,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(7,6,'2016-07-25','2016-07-25 00:00:00',0,18000,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(8,6,'2016-07-26','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(9,6,'2016-07-27','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(10,6,'2016-07-29','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(11,6,'2016-07-31','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(12,7,'2016-07-25','2016-07-25 00:00:00',0,10800,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(13,7,'2016-07-26','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(14,7,'2016-07-27','2016-07-25 00:00:00',0,14400,12,NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'),(15,7,'2017-01-30','2017-01-30 10:00:00',1,660,12,NULL,'',NULL,NULL,NULL,NULL,'0000-00-00 00:00:00'); +/*!40000 ALTER TABLE `llx_projet_task_time` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal` +-- + +DROP TABLE IF EXISTS `llx_propal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `ref_client` varchar(255) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `datep` date DEFAULT NULL, + `fin_validite` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `price` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `fk_availability` int(11) DEFAULT NULL, + `fk_delivery_address` int(11) DEFAULT NULL, + `fk_input_reason` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_propal_ref` (`ref`,`entity`), + KEY `idx_propal_fk_soc` (`fk_soc`), + KEY `idx_propal_fk_user_author` (`fk_user_author`), + KEY `idx_propal_fk_user_valid` (`fk_user_valid`), + KEY `idx_propal_fk_user_cloture` (`fk_user_cloture`), + KEY `idx_propal_fk_projet` (`fk_projet`), + KEY `idx_propal_fk_account` (`fk_account`), + KEY `idx_propal_fk_currency` (`fk_currency`), + CONSTRAINT `fk_propal_fk_projet` FOREIGN KEY (`fk_projet`) REFERENCES `llx_projet` (`rowid`), + CONSTRAINT `fk_propal_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_propal_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_propal_fk_user_cloture` FOREIGN KEY (`fk_user_cloture`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_propal_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal` +-- + +LOCK TABLES `llx_propal` WRITE; +/*!40000 ALTER TABLE `llx_propal` DISABLE KEYS */; +INSERT INTO `llx_propal` VALUES (1,2,NULL,'2016-07-30 15:56:45','PR1007-0001',1,NULL,NULL,'','2010-07-09 01:33:49','2016-07-09','2016-07-24 12:00:00','2017-08-08 14:24:18',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,30.00000000,3.84000000,0.00000000,0.00000000,33.84000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(2,1,NULL,'2016-07-30 15:56:54','PR1007-0002',1,NULL,NULL,'','2010-07-10 02:11:44','2016-07-10','2016-07-25 12:00:00','2016-07-10 02:12:55','2017-07-20 15:23:12',1,NULL,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,1,'','','azur',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(3,4,NULL,'2016-07-30 15:56:54','PR1007-0003',1,NULL,NULL,'','2010-07-18 11:35:11','2016-07-18','2016-08-02 12:00:00','2016-07-18 11:36:18','2017-07-20 15:21:15',1,NULL,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(5,19,NULL,'2016-07-30 15:56:54','PR1302-0005',1,NULL,NULL,'','2013-02-17 15:39:56','2016-02-17','2016-03-04 12:00:00','2018-11-15 23:27:10',NULL,1,NULL,12,NULL,1,0,NULL,NULL,0,10.00000000,2.00000000,0.00000000,0.00000000,12.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(6,19,NULL,'2016-07-30 15:56:54','PR1302-0006',1,NULL,NULL,'','2013-02-17 15:40:12','2016-02-17','2016-03-04 12:00:00',NULL,NULL,1,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(7,19,NULL,'2017-01-29 17:49:33','PR1302-0007',1,NULL,NULL,'','2013-02-17 15:41:15','2016-02-17','2016-03-04 12:00:00','2017-01-29 21:49:33',NULL,1,NULL,12,NULL,1,0,NULL,NULL,0,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,400.00000000,0.00000000,400.00000000),(8,19,NULL,'2016-07-30 15:56:39','PR1302-0008',1,NULL,NULL,'','2013-02-17 15:43:39','2016-02-17','2016-03-04 12:00:00',NULL,NULL,1,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(10,7,NULL,'2016-07-30 15:57:25','(PROV10)',1,NULL,NULL,'','2015-11-15 23:37:08','2015-11-15','2016-11-30 12:00:00',NULL,NULL,12,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,3,'','','azur',NULL,NULL,0,NULL,0,NULL,NULL,0,'',NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000),(11,1,NULL,'2017-02-16 00:44:58','PR1702-0009',1,NULL,NULL,'','2017-02-16 01:44:58','2015-05-13','2015-05-28 12:00:00','2017-02-16 01:44:58',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,60.00000000,0.00000000,0.00000000,0.00000000,60.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,60.00000000,0.00000000,60.00000000),(12,7,NULL,'2017-02-16 00:45:44','PR1702-0010',1,NULL,NULL,'','2017-02-16 01:45:44','2015-06-24','2015-07-09 12:00:00','2017-02-16 01:45:44',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,832.00000000,0.00000000,0.00000000,0.00000000,832.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,832.00000000,0.00000000,832.00000000),(13,26,NULL,'2017-02-16 00:46:15','PR1702-0011',1,NULL,NULL,'','2017-02-16 01:46:15','2015-04-03','2015-04-18 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,242.00000000,0.00000000,0.00000000,0.00000000,242.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,242.00000000,0.00000000,242.00000000),(14,3,NULL,'2017-02-16 00:46:15','PR1702-0012',1,NULL,NULL,'','2017-02-16 01:46:15','2016-06-19','2016-07-04 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,245.00000000,0.00000000,0.00000000,0.00000000,245.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,245.00000000,0.00000000,245.00000000),(15,26,NULL,'2017-02-16 00:46:15','PR1702-0013',1,NULL,NULL,'','2017-02-16 01:46:15','2016-05-01','2016-05-16 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,940.00000000,0.00000000,0.00000000,0.00000000,940.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,940.00000000,0.00000000,940.00000000),(16,1,NULL,'2017-02-16 00:46:15','PR1702-0014',1,NULL,NULL,'','2017-02-16 01:46:15','2015-05-13','2015-05-28 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,125.00000000,0.00000000,0.00000000,0.00000000,125.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,125.00000000,0.00000000,125.00000000),(17,1,NULL,'2017-02-16 00:46:15','PR1702-0015',1,NULL,NULL,'','2017-02-16 01:46:15','2016-07-23','2016-08-07 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,163.00000000,0.00000000,0.00000000,0.00000000,163.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,163.00000000,0.00000000,163.00000000),(18,26,NULL,'2017-02-16 00:46:15','PR1702-0016',1,NULL,NULL,'','2017-02-16 01:46:15','2015-02-13','2015-02-28 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,900.00000000,0.00000000,0.00000000,0.00000000,900.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000),(19,12,NULL,'2017-02-16 00:46:15','PR1702-0017',1,NULL,NULL,'','2017-02-16 01:46:15','2015-03-30','2015-04-14 12:00:00','2017-02-16 01:46:15',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000),(20,26,NULL,'2017-02-16 00:46:15','PR1702-0018',1,NULL,NULL,'','2017-02-16 01:46:15','2016-11-13','2016-11-28 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,830.00000000,0.00000000,0.00000000,0.00000000,830.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,830.00000000,0.00000000,830.00000000),(21,1,NULL,'2017-02-16 00:47:09','PR1702-0019',1,NULL,NULL,'','2017-02-16 01:46:15','2015-09-23','2018-10-08 12:00:00','2017-02-16 04:47:09',NULL,1,NULL,12,NULL,1,0,NULL,NULL,0,89.00000000,0.00000000,0.00000000,0.00000000,89.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,89.00000000,0.00000000,89.00000000),(22,26,NULL,'2017-02-16 00:47:13','PR1702-0020',1,NULL,NULL,'','2017-02-16 01:46:15','2016-11-13','2016-11-28 12:00:00','2017-02-16 01:46:15',NULL,1,NULL,1,NULL,0,0,NULL,NULL,0,70.00000000,0.00000000,0.00000000,0.00000000,70.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,70.00000000,0.00000000,70.00000000),(23,12,NULL,'2017-02-17 12:07:18','PR1702-0021',1,NULL,NULL,'','2017-02-16 01:46:17','2016-04-03','2016-04-18 12:00:00','2017-02-17 16:07:18',NULL,2,NULL,12,NULL,1,0,NULL,NULL,0,715.00000000,0.00000000,0.00000000,0.00000000,715.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,715.00000000,0.00000000,715.00000000),(24,7,NULL,'2017-02-16 00:46:17','PR1702-0022',1,NULL,NULL,'','2017-02-16 01:46:17','2016-11-13','2016-11-28 12:00:00','2017-02-16 01:46:17',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,250.00000000,0.00000000,0.00000000,0.00000000,250.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,250.00000000,0.00000000,250.00000000),(25,3,NULL,'2017-02-16 00:47:29','PR1702-0023',1,NULL,NULL,'','2017-02-16 01:46:17','2016-07-09','2016-07-24 12:00:00','2017-02-16 01:46:17','2017-02-16 04:47:29',1,NULL,1,12,4,0,NULL,NULL,0,1018.00000000,0.00000000,0.00000000,0.00000000,1018.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000),(26,1,NULL,'2017-02-16 00:46:18','PR1702-0024',1,NULL,NULL,'','2017-02-16 01:46:17','2016-04-03','2016-04-18 12:00:00','2017-02-16 01:46:18',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,710.00000000,0.00000000,0.00000000,0.00000000,710.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,710.00000000,0.00000000,710.00000000),(27,6,NULL,'2017-02-16 00:46:18','PR1702-0025',1,NULL,NULL,'','2017-02-16 01:46:18','2016-11-12','2016-11-27 12:00:00','2017-02-16 01:46:18',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,300.00000000,0.00000000,300.00000000),(28,19,NULL,'2017-02-16 00:46:31','PR1702-0026',1,NULL,NULL,'','2017-02-16 01:46:18','2015-07-30','2015-08-14 12:00:00','2017-02-16 01:46:18','2017-02-16 04:46:31',2,NULL,2,12,2,0,NULL,NULL,0,440.00000000,0.00000000,0.00000000,0.00000000,440.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000),(29,1,NULL,'2017-02-16 00:46:37','PR1702-0027',1,NULL,NULL,'','2017-02-16 01:46:18','2015-07-23','2015-08-07 12:00:00','2017-02-16 01:46:18','2017-02-16 04:46:37',2,NULL,2,12,2,0,NULL,NULL,0,1000.00000000,0.00000000,0.00000000,0.00000000,1000.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000),(30,1,NULL,'2017-02-16 00:46:42','PR1702-0028',1,NULL,NULL,'','2017-02-16 01:46:18','2016-05-01','2016-05-16 12:00:00','2017-02-16 01:46:18','2017-02-16 04:46:42',2,NULL,2,12,3,0,NULL,NULL,0,1200.00000000,0.00000000,0.00000000,0.00000000,1200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,0.00000000,1200.00000000),(31,11,NULL,'2017-02-16 00:46:18','PR1702-0029',1,NULL,NULL,'','2017-02-16 01:46:18','2016-06-24','2016-07-09 12:00:00','2017-02-16 01:46:18',NULL,1,NULL,1,NULL,1,0,NULL,NULL,0,720.00000000,0.00000000,0.00000000,0.00000000,720.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,720.00000000,0.00000000,720.00000000),(32,19,NULL,'2017-02-16 00:46:18','PR1702-0030',1,NULL,NULL,'','2017-02-16 01:46:18','2016-11-12','2016-11-27 12:00:00','2017-02-16 01:46:18',NULL,2,NULL,2,NULL,1,0,NULL,NULL,0,608.00000000,0.00000000,0.00000000,0.00000000,608.00000000,NULL,NULL,3,3,'','','',NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,608.00000000,0.00000000,608.00000000); +/*!40000 ALTER TABLE `llx_propal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal_extrafields` +-- + +DROP TABLE IF EXISTS `llx_propal_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_propal_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal_extrafields` +-- + +LOCK TABLES `llx_propal_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_propal_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propal_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propal_merge_pdf_product` +-- + +DROP TABLE IF EXISTS `llx_propal_merge_pdf_product`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propal_merge_pdf_product` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_product` int(11) NOT NULL, + `file_name` varchar(200) NOT NULL, + `lang` varchar(5) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_mod` int(11) NOT NULL, + `datec` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propal_merge_pdf_product` +-- + +LOCK TABLES `llx_propal_merge_pdf_product` WRITE; +/*!40000 ALTER TABLE `llx_propal_merge_pdf_product` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propal_merge_pdf_product` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propaldet` +-- + +DROP TABLE IF EXISTS `llx_propaldet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propaldet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_propal` int(11) DEFAULT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) NOT NULL DEFAULT '0', + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) NOT NULL DEFAULT '0', + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `date_start` datetime DEFAULT NULL, + `date_end` datetime DEFAULT NULL, + `info_bits` int(11) DEFAULT '0', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `special_code` int(10) unsigned DEFAULT '0', + `rang` int(11) DEFAULT '0', + `fk_unit` int(11) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`), + KEY `idx_propaldet_fk_propal` (`fk_propal`), + KEY `idx_propaldet_fk_product` (`fk_product`), + KEY `fk_propaldet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_propaldet_fk_propal` FOREIGN KEY (`fk_propal`) REFERENCES `llx_propal` (`rowid`), + CONSTRAINT `fk_propaldet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propaldet` +-- + +LOCK TABLES `llx_propaldet` WRITE; +/*!40000 ALTER TABLE `llx_propaldet` DISABLE KEYS */; +INSERT INTO `llx_propaldet` VALUES (1,1,NULL,NULL,NULL,'Une machine à café',NULL,12.500,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.25000000,0.00000000,0.00000000,11.25000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(2,2,NULL,NULL,NULL,'Product 1',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(3,2,NULL,2,NULL,'',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(4,3,NULL,NULL,NULL,'A new marvelous product',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(5,1,NULL,5,NULL,'cccc',NULL,19.600,'',0.000,'',0.000,'',1,0,0,NULL,10.00000000,10.00000000,1.96000000,0.00000000,0.00000000,11.96000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(11,1,NULL,4,NULL,'',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(12,1,NULL,4,NULL,'',NULL,0.000,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(13,1,NULL,4,NULL,'',NULL,12.500,'',0.000,'',0.000,'',1,0,0,NULL,5.00000000,5.00000000,0.63000000,0.00000000,0.00000000,5.63000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(24,5,NULL,NULL,NULL,'On demand Apple pie',NULL,20.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,2.00000000,0.00000000,0.00000000,12.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(25,7,NULL,NULL,NULL,'Help to setup Magic Food computer',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,400.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,1,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'',400.00000000,400.00000000,0.00000000,400.00000000),(26,11,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(27,11,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(28,12,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,5.00000000,0.00000000,5.00000000),(29,12,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(30,12,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(31,12,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(32,12,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(33,13,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(34,13,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(35,13,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,9.00000000,27.00000000,0.00000000,0.00000000,0.00000000,27.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',9.00000000,27.00000000,0.00000000,27.00000000),(36,13,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(37,14,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(38,14,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(39,15,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(40,15,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(41,15,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(42,15,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(43,16,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(44,16,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,10.00000000,40.00000000,0.00000000,0.00000000,0.00000000,40.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,40.00000000,0.00000000,40.00000000),(45,16,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(46,17,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(47,17,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(48,17,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(49,17,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(50,17,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(51,18,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(52,18,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(53,18,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(54,19,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(55,19,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(56,19,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(57,19,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(58,19,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(59,20,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(60,20,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(61,20,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(62,20,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(63,21,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(64,21,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,9.00000000,9.00000000,0.00000000,0.00000000,0.00000000,9.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,9.00000000,0.00000000,9.00000000),(65,21,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(66,21,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(67,22,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,10.00000000,50.00000000,0.00000000,0.00000000,0.00000000,50.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',10.00000000,50.00000000,0.00000000,50.00000000),(68,22,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,10.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,20.00000000,0.00000000,20.00000000),(69,23,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(70,23,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,5.00000000,15.00000000,0.00000000,0.00000000,0.00000000,15.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',5.00000000,15.00000000,0.00000000,15.00000000),(71,23,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(72,23,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(73,24,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,5.00000000,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,5.00000000,0.00000000,5.00000000),(74,24,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(75,24,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(76,24,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(77,25,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(78,25,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(79,25,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(80,25,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(81,25,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',9.00000000,18.00000000,0.00000000,18.00000000),(82,26,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(83,26,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,10.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,10.00000000,0.00000000,10.00000000),(84,26,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(85,26,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(86,26,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(87,27,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(88,27,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(89,28,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,5.00000000,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,10.00000000,0.00000000,10.00000000),(90,28,NULL,5,NULL,'DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
        \r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
        \r\n

        The advantage of DoliDroid are :
        \r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
        \r\n- Upgrading Dolibarr will not break DoliDroid.
        \r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
        \r\n- DoliDroid use internal cache for pages that should not change (like menu page)
        \r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
        \r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

        \r\n\r\n

        WARNING ! 

        \r\n\r\n

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

        ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,10.00000000,30.00000000,0.00000000,0.00000000,0.00000000,30.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',10.00000000,30.00000000,0.00000000,30.00000000),(91,28,NULL,2,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(92,28,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(93,29,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(94,29,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,100.00000000,500.00000000,0.00000000,0.00000000,0.00000000,500.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,500.00000000,0.00000000,500.00000000),(95,29,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(96,30,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(97,30,NULL,1,NULL,'A beatifull pink dress',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(98,30,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,100.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,200.00000000,0.00000000,200.00000000),(99,30,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(100,31,NULL,4,NULL,'Nice Bio Apple Pie.
        \r\n ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,5.00000000,20.00000000,0.00000000,0.00000000,0.00000000,20.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',5.00000000,20.00000000,0.00000000,20.00000000),(101,31,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(102,31,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',3,0,0,NULL,100.00000000,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',100.00000000,300.00000000,0.00000000,300.00000000),(103,31,NULL,3,NULL,'',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',0.00000000,0.00000000,0.00000000,0.00000000),(104,32,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,1,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(105,32,NULL,10,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,100.00000000,100.00000000,0.00000000,0.00000000,0.00000000,100.00000000,0,NULL,NULL,0,NULL,0.00000000,0,2,NULL,NULL,'EUR',100.00000000,100.00000000,0.00000000,100.00000000),(106,32,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',5,0,0,NULL,9.00000000,45.00000000,0.00000000,0.00000000,0.00000000,45.00000000,0,NULL,NULL,0,NULL,0.00000000,0,3,NULL,NULL,'EUR',9.00000000,45.00000000,0.00000000,45.00000000),(107,32,NULL,13,NULL,'A powerfull computer XP4523 ',NULL,0.000,'',0.000,'0',0.000,'0',4,0,0,NULL,100.00000000,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,0,NULL,NULL,0,NULL,0.00000000,0,4,NULL,NULL,'EUR',100.00000000,400.00000000,0.00000000,400.00000000),(108,32,NULL,12,NULL,'Cloud hosting of Dolibarr ERP and CRM software',NULL,0.000,'',0.000,'0',0.000,'0',2,0,0,NULL,9.00000000,18.00000000,0.00000000,0.00000000,0.00000000,18.00000000,0,NULL,NULL,0,NULL,0.00000000,0,5,NULL,NULL,'EUR',9.00000000,18.00000000,0.00000000,18.00000000); +/*!40000 ALTER TABLE `llx_propaldet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_propaldet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_propaldet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_propaldet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_propaldet_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_propaldet_extrafields` +-- + +LOCK TABLES `llx_propaldet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_propaldet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_propaldet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_resource` +-- + +DROP TABLE IF EXISTS `llx_resource`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_resource` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref` varchar(255) DEFAULT NULL, + `asset_number` varchar(255) DEFAULT NULL, + `description` text, + `fk_code_type_resource` varchar(32) DEFAULT NULL, + `note_public` text, + `note_private` text, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `fk_code_type_resource_idx` (`fk_code_type_resource`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_resource` +-- + +LOCK TABLES `llx_resource` WRITE; +/*!40000 ALTER TABLE `llx_resource` DISABLE KEYS */; +INSERT INTO `llx_resource` VALUES (1,1,'Car Kangoo 1',NULL,'Car number 1 - Num XDF-45-GH','RES_CARS',NULL,NULL,'2017-02-20 16:44:12',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL),(2,1,'Car Kangoo 2',NULL,'Car number 2 - Num GHY-78-JJ','RES_CARS',NULL,NULL,'2017-02-20 16:44:01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL),(3,1,'Meeting room - 14p',NULL,'Meeting room
        \r\n14 places','RES_ROOMS',NULL,NULL,'2017-02-20 16:44:38',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL),(4,1,'Meeting room - 8p',NULL,'Meeting room
        \r\n8 places','RES_ROOMS',NULL,NULL,'2017-02-20 16:45:00',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL); +/*!40000 ALTER TABLE `llx_resource` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_resource_extrafields` +-- + +DROP TABLE IF EXISTS `llx_resource_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_resource_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_resource_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_resource_extrafields` +-- + +LOCK TABLES `llx_resource_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_resource_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_resource_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_rights_def` +-- + +DROP TABLE IF EXISTS `llx_rights_def`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_rights_def` ( + `id` int(11) NOT NULL DEFAULT '0', + `libelle` varchar(255) DEFAULT NULL, + `module` varchar(64) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `perms` varchar(50) DEFAULT NULL, + `subperms` varchar(50) DEFAULT NULL, + `type` varchar(1) DEFAULT NULL, + `bydefault` tinyint(4) DEFAULT '0', + PRIMARY KEY (`id`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_rights_def` +-- + +LOCK TABLES `llx_rights_def` WRITE; +/*!40000 ALTER TABLE `llx_rights_def` DISABLE KEYS */; +INSERT INTO `llx_rights_def` VALUES (11,'Lire les factures','facture',1,'lire',NULL,'a',0),(11,'Lire les factures','facture',2,'lire',NULL,'a',1),(12,'Creer/modifier les factures','facture',1,'creer',NULL,'a',0),(12,'Creer/modifier les factures','facture',2,'creer',NULL,'a',0),(13,'Dévalider les factures','facture',1,'invoice_advance','unvalidate','a',0),(13,'Dévalider les factures','facture',2,'invoice_advance','unvalidate','a',0),(14,'Valider les factures','facture',1,'invoice_advance','validate','a',0),(14,'Valider les factures','facture',2,'valider',NULL,'a',0),(15,'Envoyer les factures par mail','facture',1,'invoice_advance','send','a',0),(15,'Envoyer les factures par mail','facture',2,'invoice_advance','send','a',0),(16,'Emettre des paiements sur les factures','facture',1,'paiement',NULL,'a',0),(16,'Emettre des paiements sur les factures','facture',2,'paiement',NULL,'a',0),(19,'Supprimer les factures','facture',1,'supprimer',NULL,'a',0),(19,'Supprimer les factures','facture',2,'supprimer',NULL,'a',0),(21,'Lire les propositions commerciales','propale',1,'lire',NULL,'r',1),(21,'Lire les propositions commerciales','propale',2,'lire',NULL,'r',1),(22,'Creer/modifier les propositions commerciales','propale',1,'creer',NULL,'w',0),(22,'Creer/modifier les propositions commerciales','propale',2,'creer',NULL,'w',0),(24,'Valider les propositions commerciales','propale',1,'propal_advance','validate','d',0),(24,'Valider les propositions commerciales','propale',2,'valider',NULL,'d',0),(25,'Envoyer les propositions commerciales aux clients','propale',1,'propal_advance','send','d',0),(25,'Envoyer les propositions commerciales aux clients','propale',2,'propal_advance','send','d',0),(26,'Cloturer les propositions commerciales','propale',1,'cloturer',NULL,'d',0),(26,'Cloturer les propositions commerciales','propale',2,'cloturer',NULL,'d',0),(27,'Supprimer les propositions commerciales','propale',1,'supprimer',NULL,'d',0),(27,'Supprimer les propositions commerciales','propale',2,'supprimer',NULL,'d',0),(28,'Exporter les propositions commerciales et attributs','propale',1,'export',NULL,'r',0),(28,'Exporter les propositions commerciales et attributs','propale',2,'export',NULL,'r',0),(31,'Lire les produits','produit',1,'lire',NULL,'r',1),(31,'Lire les produits','produit',2,'lire',NULL,'r',1),(32,'Creer/modifier les produits','produit',1,'creer',NULL,'w',0),(32,'Creer/modifier les produits','produit',2,'creer',NULL,'w',0),(34,'Supprimer les produits','produit',1,'supprimer',NULL,'d',0),(34,'Supprimer les produits','produit',2,'supprimer',NULL,'d',0),(38,'Exporter les produits','produit',1,'export',NULL,'r',0),(38,'Exporter les produits','produit',2,'export',NULL,'r',0),(41,'Read projects and tasks (shared projects or projects I am contact for). Can also enter time consumed on assigned tasks (timesheet)','projet',1,'lire',NULL,'r',1),(42,'Create/modify projects and tasks (shared projects or projects I am contact for)','projet',1,'creer',NULL,'w',0),(44,'Delete project and tasks (shared projects or projects I am contact for)','projet',1,'supprimer',NULL,'d',0),(45,'Export projects','projet',1,'export',NULL,'d',0),(61,'Lire les fiches d\'intervention','ficheinter',1,'lire',NULL,'r',1),(62,'Creer/modifier les fiches d\'intervention','ficheinter',1,'creer',NULL,'w',0),(64,'Supprimer les fiches d\'intervention','ficheinter',1,'supprimer',NULL,'d',0),(67,'Exporter les fiches interventions','ficheinter',1,'export',NULL,'r',0),(68,'Envoyer les fiches d\'intervention par courriel','ficheinter',1,'ficheinter_advance','send','r',0),(69,'Valider les fiches d\'intervention ','ficheinter',1,'ficheinter_advance','validate','a',0),(70,'Dévalider les fiches d\'intervention','ficheinter',1,'ficheinter_advance','unvalidate','a',0),(81,'Lire les commandes clients','commande',1,'lire',NULL,'r',0),(82,'Creer/modifier les commandes clients','commande',1,'creer',NULL,'w',0),(84,'Valider les commandes clients','commande',1,'order_advance','validate','d',0),(86,'Envoyer les commandes clients','commande',1,'order_advance','send','d',0),(87,'Cloturer les commandes clients','commande',1,'cloturer',NULL,'d',0),(88,'Annuler les commandes clients','commande',1,'order_advance','annuler','d',0),(89,'Supprimer les commandes clients','commande',1,'supprimer',NULL,'d',0),(91,'Lire les charges','tax',1,'charges','lire','r',0),(91,'Lire les charges','tax',2,'charges','lire','r',1),(92,'Creer/modifier les charges','tax',1,'charges','creer','w',0),(92,'Creer/modifier les charges','tax',2,'charges','creer','w',0),(93,'Supprimer les charges','tax',1,'charges','supprimer','d',0),(93,'Supprimer les charges','tax',2,'charges','supprimer','d',0),(94,'Exporter les charges','tax',1,'charges','export','r',0),(94,'Exporter les charges','tax',2,'charges','export','r',0),(101,'Lire les expeditions','expedition',1,'lire',NULL,'r',1),(102,'Creer modifier les expeditions','expedition',1,'creer',NULL,'w',0),(104,'Valider les expeditions','expedition',1,'shipping_advance','validate','d',0),(105,'Envoyer les expeditions aux clients','expedition',1,'shipping_advance','send','d',0),(106,'Exporter les expeditions','expedition',1,'shipment','export','r',0),(109,'Supprimer les expeditions','expedition',1,'supprimer',NULL,'d',0),(111,'Lire les comptes bancaires','banque',1,'lire',NULL,'r',0),(111,'Lire les comptes bancaires','banque',2,'lire',NULL,'r',1),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',1,'modifier',NULL,'w',0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',2,'modifier',NULL,'w',0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',1,'configurer',NULL,'a',0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',2,'configurer',NULL,'a',0),(114,'Rapprocher les ecritures bancaires','banque',1,'consolidate',NULL,'w',0),(114,'Rapprocher les ecritures bancaires','banque',2,'consolidate',NULL,'w',0),(115,'Exporter transactions et releves','banque',1,'export',NULL,'r',0),(115,'Exporter transactions et releves','banque',2,'export',NULL,'r',0),(116,'Virements entre comptes','banque',1,'transfer',NULL,'w',0),(116,'Virements entre comptes','banque',2,'transfer',NULL,'w',0),(117,'Gerer les envois de cheques','banque',1,'cheque',NULL,'w',0),(117,'Gerer les envois de cheques','banque',2,'cheque',NULL,'w',0),(121,'Lire les societes','societe',1,'lire',NULL,'r',0),(121,'Lire les societes','societe',2,'lire',NULL,'r',1),(122,'Creer modifier les societes','societe',1,'creer',NULL,'w',0),(122,'Creer modifier les societes','societe',2,'creer',NULL,'w',0),(125,'Supprimer les societes','societe',1,'supprimer',NULL,'d',0),(125,'Supprimer les societes','societe',2,'supprimer',NULL,'d',0),(126,'Exporter les societes','societe',1,'export',NULL,'r',0),(126,'Exporter les societes','societe',2,'export',NULL,'r',0),(141,'Read all projects and tasks (also private projects I am not contact for)','projet',1,'all','lire','r',0),(142,'Create/modify all projects and tasks (also private projects I am not contact for)','projet',1,'all','creer','w',0),(144,'Delete all projects and tasks (also private projects I am not contact for)','projet',1,'all','supprimer','d',0),(151,'Read withdrawals','prelevement',1,'bons','lire','r',1),(152,'Create/modify a withdrawals','prelevement',1,'bons','creer','w',0),(153,'Send withdrawals to bank','prelevement',1,'bons','send','a',0),(154,'credit/refuse withdrawals','prelevement',1,'bons','credit','a',0),(161,'Lire les contrats','contrat',1,'lire',NULL,'r',1),(162,'Creer / modifier les contrats','contrat',1,'creer',NULL,'w',0),(163,'Activer un service d\'un contrat','contrat',1,'activer',NULL,'w',0),(164,'Desactiver un service d\'un contrat','contrat',1,'desactiver',NULL,'w',0),(165,'Supprimer un contrat','contrat',1,'supprimer',NULL,'d',0),(167,'Export contracts','contrat',1,'export',NULL,'r',0),(221,'Consulter les mailings','mailing',1,'lire',NULL,'r',1),(221,'Consulter les mailings','mailing',2,'lire',NULL,'r',1),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',1,'creer',NULL,'w',0),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',2,'creer',NULL,'w',0),(223,'Valider les mailings (permet leur envoi)','mailing',1,'valider',NULL,'w',0),(223,'Valider les mailings (permet leur envoi)','mailing',2,'valider',NULL,'w',0),(229,'Supprimer les mailings','mailing',1,'supprimer',NULL,'d',0),(229,'Supprimer les mailings','mailing',2,'supprimer',NULL,'d',0),(237,'View recipients and info','mailing',1,'mailing_advance','recipient','r',0),(237,'View recipients and info','mailing',2,'mailing_advance','recipient','r',0),(238,'Manually send mailings','mailing',1,'mailing_advance','send','w',0),(238,'Manually send mailings','mailing',2,'mailing_advance','send','w',0),(239,'Delete mailings after validation and/or sent','mailing',1,'mailing_advance','delete','d',0),(239,'Delete mailings after validation and/or sent','mailing',2,'mailing_advance','delete','d',0),(241,'Lire les categories','categorie',1,'lire',NULL,'r',1),(242,'Creer/modifier les categories','categorie',1,'creer',NULL,'w',0),(243,'Supprimer les categories','categorie',1,'supprimer',NULL,'d',0),(251,'Consulter les autres utilisateurs','user',1,'user','lire','r',0),(252,'Consulter les permissions des autres utilisateurs','user',1,'user_advance','readperms','r',0),(253,'Creer/modifier utilisateurs internes et externes','user',1,'user','creer','w',0),(254,'Creer/modifier utilisateurs externes seulement','user',1,'user_advance','write','w',0),(255,'Modifier le mot de passe des autres utilisateurs','user',1,'user','password','w',0),(256,'Supprimer ou desactiver les autres utilisateurs','user',1,'user','supprimer','d',0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',1,'client','voir','r',0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',2,'client','voir','r',1),(281,'Lire les contacts','societe',1,'contact','lire','r',0),(281,'Lire les contacts','societe',2,'contact','lire','r',1),(282,'Creer modifier les contacts','societe',1,'contact','creer','w',0),(282,'Creer modifier les contacts','societe',2,'contact','creer','w',0),(283,'Supprimer les contacts','societe',1,'contact','supprimer','d',0),(283,'Supprimer les contacts','societe',2,'contact','supprimer','d',0),(286,'Exporter les contacts','societe',1,'contact','export','d',0),(286,'Exporter les contacts','societe',2,'contact','export','d',0),(300,'Read barcodes','barcode',1,'lire_advance',NULL,'r',1),(301,'Create/modify barcodes','barcode',1,'creer_advance',NULL,'w',0),(341,'Consulter ses propres permissions','user',1,'self_advance','readperms','r',0),(342,'Creer/modifier ses propres infos utilisateur','user',1,'self','creer','w',0),(343,'Modifier son propre mot de passe','user',1,'self','password','w',0),(344,'Modifier ses propres permissions','user',1,'self_advance','writeperms','w',0),(351,'Consulter les groupes','user',1,'group_advance','read','r',0),(352,'Consulter les permissions des groupes','user',1,'group_advance','readperms','r',0),(353,'Creer/modifier les groupes et leurs permissions','user',1,'group_advance','write','w',0),(354,'Supprimer ou desactiver les groupes','user',1,'group_advance','delete','d',0),(358,'Exporter les utilisateurs','user',1,'user','export','r',0),(510,'Read salaries','salaries',1,'read',NULL,'r',0),(511,'Read employee contracts/salaries','salaries',1,'read',NULL,'r',0),(512,'Create/modify salaries','salaries',1,'write',NULL,'w',0),(513,'Create/modify payment of salaries','salaries',1,'write',NULL,'w',0),(514,'Delete salaries','salaries',1,'delete',NULL,'d',0),(517,'Export salaries','salaries',1,'export',NULL,'r',0),(520,'Read loans','loan',1,'read',NULL,'r',0),(522,'Create/modify loans','loan',1,'write',NULL,'w',0),(524,'Delete loans','loan',1,'delete',NULL,'d',0),(525,'Access loan calculator','loan',1,'calc',NULL,'r',0),(527,'Export loans','loan',1,'export',NULL,'r',0),(531,'Lire les services','service',1,'lire',NULL,'r',0),(532,'Creer/modifier les services','service',1,'creer',NULL,'w',0),(534,'Supprimer les services','service',1,'supprimer',NULL,'d',0),(538,'Exporter les services','service',1,'export',NULL,'r',0),(701,'Lire les dons','don',1,'lire',NULL,'r',1),(701,'Lire les dons','don',2,'lire',NULL,'r',1),(702,'Creer/modifier les dons','don',1,'creer',NULL,'w',0),(702,'Creer/modifier les dons','don',2,'creer',NULL,'w',0),(703,'Supprimer les dons','don',1,'supprimer',NULL,'d',0),(703,'Supprimer les dons','don',2,'supprimer',NULL,'d',0),(771,'Read expense reports (yours and your subordinates)','expensereport',1,'lire',NULL,'r',1),(772,'Create/modify expense reports','expensereport',1,'creer',NULL,'w',0),(773,'Delete expense reports','expensereport',1,'supprimer',NULL,'d',0),(774,'Read all expense reports','expensereport',1,'readall',NULL,'r',1),(775,'Approve expense reports','expensereport',1,'approve',NULL,'w',0),(776,'Pay expense reports','expensereport',1,'to_paid',NULL,'w',0),(777,'Read expense reports of everybody','expensereport',1,'readall',NULL,'r',1),(778,'Create expense reports for everybody','expensereport',1,'writeall_advance',NULL,'w',0),(779,'Export expense reports','expensereport',1,'export',NULL,'r',0),(1001,'Lire les stocks','stock',1,'lire',NULL,'r',1),(1002,'Creer/Modifier les stocks','stock',1,'creer',NULL,'w',0),(1003,'Supprimer les stocks','stock',1,'supprimer',NULL,'d',0),(1004,'Lire mouvements de stocks','stock',1,'mouvement','lire','r',1),(1005,'Creer/modifier mouvements de stocks','stock',1,'mouvement','creer','w',0),(1101,'Lire les bons de livraison','expedition',1,'livraison','lire','r',1),(1102,'Creer modifier les bons de livraison','expedition',1,'livraison','creer','w',0),(1104,'Valider les bons de livraison','expedition',1,'livraison_advance','validate','d',0),(1109,'Supprimer les bons de livraison','expedition',1,'livraison','supprimer','d',0),(1121,'Read supplier proposals','supplier_proposal',1,'lire',NULL,'w',1),(1122,'Create/modify supplier proposals','supplier_proposal',1,'creer',NULL,'w',0),(1123,'Validate supplier proposals','supplier_proposal',1,'validate_advance',NULL,'w',0),(1124,'Envoyer les demandes fournisseurs','supplier_proposal',1,'send_advance',NULL,'w',0),(1125,'Delete supplier proposals','supplier_proposal',1,'supprimer',NULL,'w',0),(1126,'Close supplier price requests','supplier_proposal',1,'cloturer',NULL,'w',0),(1181,'Consulter les fournisseurs','fournisseur',1,'lire',NULL,'r',0),(1182,'Consulter les commandes fournisseur','fournisseur',1,'commande','lire','r',0),(1183,'Creer une commande fournisseur','fournisseur',1,'commande','creer','w',0),(1184,'Valider une commande fournisseur','fournisseur',1,'supplier_order_advance','validate','w',0),(1185,'Approuver une commande fournisseur','fournisseur',1,'commande','approuver','w',0),(1186,'Commander une commande fournisseur','fournisseur',1,'commande','commander','w',0),(1187,'Receptionner une commande fournisseur','fournisseur',1,'commande','receptionner','d',0),(1188,'Supprimer une commande fournisseur','fournisseur',1,'commande','supprimer','d',0),(1189,'Check/Uncheck a supplier order reception','fournisseur',1,'commande_advance','check','w',0),(1201,'Lire les exports','export',1,'lire',NULL,'r',1),(1202,'Creer/modifier un export','export',1,'creer',NULL,'w',0),(1231,'Consulter les factures fournisseur','fournisseur',1,'facture','lire','r',0),(1232,'Creer une facture fournisseur','fournisseur',1,'facture','creer','w',0),(1233,'Valider une facture fournisseur','fournisseur',1,'supplier_invoice_advance','validate','w',0),(1234,'Supprimer une facture fournisseur','fournisseur',1,'facture','supprimer','d',0),(1235,'Envoyer les factures par mail','fournisseur',1,'supplier_invoice_advance','send','a',0),(1236,'Exporter les factures fournisseurs, attributs et reglements','fournisseur',1,'facture','export','r',0),(1237,'Exporter les commande fournisseurs, attributs','fournisseur',1,'commande','export','r',0),(1251,'Run mass imports of external data (data load)','import',1,'run',NULL,'r',0),(1321,'Exporter les factures clients, attributs et reglements','facture',1,'facture','export','r',0),(1321,'Exporter les factures clients, attributs et reglements','facture',2,'facture','export','r',0),(1322,'Rouvrir une facture totalement réglée','facture',1,'invoice_advance','reopen','r',0),(1421,'Exporter les commandes clients et attributs','commande',1,'commande','export','r',0),(2401,'Read actions/tasks linked to his account','agenda',1,'myactions','read','r',0),(2401,'Read actions/tasks linked to his account','agenda',2,'myactions','read','r',1),(2402,'Create/modify actions/tasks linked to his account','agenda',1,'myactions','create','w',0),(2402,'Create/modify actions/tasks linked to his account','agenda',2,'myactions','create','w',0),(2403,'Delete actions/tasks linked to his account','agenda',1,'myactions','delete','w',0),(2403,'Delete actions/tasks linked to his account','agenda',2,'myactions','delete','w',0),(2411,'Read actions/tasks of others','agenda',1,'allactions','read','r',0),(2411,'Read actions/tasks of others','agenda',2,'allactions','read','r',0),(2412,'Create/modify actions/tasks of others','agenda',1,'allactions','create','w',0),(2412,'Create/modify actions/tasks of others','agenda',2,'allactions','create','w',0),(2413,'Delete actions/tasks of others','agenda',1,'allactions','delete','w',0),(2413,'Delete actions/tasks of others','agenda',2,'allactions','delete','w',0),(2414,'Export actions/tasks of others','agenda',1,'export',NULL,'w',0),(2501,'Consulter/Télécharger les documents','ecm',1,'read',NULL,'r',0),(2503,'Soumettre ou supprimer des documents','ecm',1,'upload',NULL,'w',0),(2515,'Administrer les rubriques de documents','ecm',1,'setup',NULL,'w',0),(20001,'Read your own holidays','holiday',1,'read',NULL,'w',0),(20001,'Créer / Modifier / Lire ses demandes de congés payés','holiday',2,'write',NULL,'w',1),(20002,'Create/modify your own holidays','holiday',1,'write',NULL,'w',0),(20002,'Lire / Modifier toutes les demandes de congés payés','holiday',2,'lire_tous',NULL,'w',0),(20003,'Delete holidays','holiday',1,'delete',NULL,'w',0),(20003,'Supprimer des demandes de congés payés','holiday',2,'delete',NULL,'w',0),(20004,'Read holidays for everybody','holiday',1,'read_all',NULL,'w',0),(20004,'Définir les congés payés des utilisateurs','holiday',2,'define_holiday',NULL,'w',0),(20005,'Create/modify holidays for everybody','holiday',1,'write_all',NULL,'w',0),(20005,'Voir les logs de modification des congés payés','holiday',2,'view_log',NULL,'w',0),(20006,'Setup holidays of users (setup and update balance)','holiday',1,'define_holiday',NULL,'w',0),(20006,'Accéder au rapport mensuel des congés payés','holiday',2,'month_report',NULL,'w',0),(23001,'Read cron jobs','cron',1,'read',NULL,'w',0),(23002,'Create cron Jobs','cron',1,'create',NULL,'w',0),(23003,'Delete cron Jobs','cron',1,'delete',NULL,'w',0),(23004,'Execute cron Jobs','cron',1,'execute',NULL,'w',0),(50101,'Use point of sale','cashdesk',1,'use',NULL,'a',1),(50401,'Bind products and invoices with accounting accounts','accounting',1,'bind','write','r',0),(50411,'Read operations in General Ledger','accounting',1,'mouvements','lire','r',0),(50412,'Write/Edit operations in General Ledger','accounting',1,'mouvements','creer','w',0),(50420,'Report and export reports (turnover, balance, journals, general ledger)','accounting',1,'comptarapport','lire','r',0),(50430,'Define and close a fiscal year','accounting',1,'fiscalyear',NULL,'r',0),(50440,'Manage chart of accounts, setup of accountancy','accounting',1,'chartofaccount',NULL,'r',0),(55001,'Read surveys','opensurvey',1,'read',NULL,'r',0),(55002,'Create/modify surveys','opensurvey',1,'write',NULL,'w',0),(59001,'Visualiser les marges','margins',1,'liretous',NULL,'r',1),(59002,'Définir les marges','margins',1,'creer',NULL,'w',0),(59003,'Read every user margin','margins',1,'read','all','r',0),(63001,'Read resources','resource',1,'read',NULL,'w',1),(63002,'Create/Modify resources','resource',1,'write',NULL,'w',0),(63003,'Delete resources','resource',1,'delete',NULL,'w',0),(63004,'Link resources','resource',1,'link',NULL,'w',0),(64001,'DirectPrint','printing',1,'read',NULL,'r',0),(101250,'Read surveys','opensurvey',2,'survey','read','r',0),(101251,'Create/modify surveys','opensurvey',2,'survey','write','w',0),(400051,'Use POS','pos',2,'frontend',NULL,'a',1),(400052,'Use Backend','pos',2,'backend',NULL,'a',1),(400053,'Make Transfers','pos',2,'transfer',NULL,'a',1),(400055,'Stats','pos',2,'stats',NULL,'a',1); +/*!40000 ALTER TABLE `llx_rights_def` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe` +-- + +DROP TABLE IF EXISTS `llx_societe`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `statut` tinyint(4) DEFAULT '0', + `parent` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `nom` varchar(128) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `ref_int` varchar(60) DEFAULT NULL, + `code_client` varchar(24) DEFAULT NULL, + `code_fournisseur` varchar(24) DEFAULT NULL, + `code_compta` varchar(24) DEFAULT NULL, + `code_compta_fournisseur` varchar(24) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_departement` int(11) DEFAULT '0', + `fk_pays` int(11) DEFAULT '0', + `phone` varchar(20) DEFAULT NULL, + `fax` varchar(20) DEFAULT NULL, + `url` varchar(255) DEFAULT NULL, + `email` varchar(128) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `fk_effectif` int(11) DEFAULT '0', + `fk_typent` int(11) DEFAULT '0', + `fk_forme_juridique` int(11) DEFAULT '0', + `fk_currency` varchar(3) DEFAULT NULL, + `siren` varchar(128) DEFAULT NULL, + `siret` varchar(128) DEFAULT NULL, + `ape` varchar(128) DEFAULT NULL, + `idprof4` varchar(128) DEFAULT NULL, + `tva_intra` varchar(20) DEFAULT NULL, + `capital` double DEFAULT NULL, + `fk_stcomm` int(11) NOT NULL DEFAULT '0', + `note_private` text, + `note_public` text, + `prefix_comm` varchar(5) DEFAULT NULL, + `client` tinyint(4) DEFAULT '0', + `fournisseur` tinyint(4) DEFAULT '0', + `supplier_account` varchar(32) DEFAULT NULL, + `fk_prospectlevel` varchar(12) DEFAULT NULL, + `customer_bad` tinyint(4) DEFAULT '0', + `customer_rate` double DEFAULT '0', + `supplier_rate` double DEFAULT '0', + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `remise_client` double DEFAULT '0', + `mode_reglement` tinyint(4) DEFAULT NULL, + `cond_reglement` tinyint(4) DEFAULT NULL, + `mode_reglement_supplier` int(11) DEFAULT NULL, + `outstanding_limit` double(24,8) DEFAULT NULL, + `cond_reglement_supplier` int(11) DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `tva_assuj` tinyint(4) DEFAULT '1', + `localtax1_assuj` tinyint(4) DEFAULT '0', + `localtax1_value` double(6,3) DEFAULT NULL, + `localtax2_assuj` tinyint(4) DEFAULT '0', + `localtax2_value` double(6,3) DEFAULT NULL, + `barcode` varchar(255) DEFAULT NULL, + `price_level` int(11) DEFAULT NULL, + `default_lang` varchar(6) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `status` tinyint(4) DEFAULT '1', + `logo` varchar(255) DEFAULT NULL, + `idprof5` varchar(128) DEFAULT NULL, + `idprof6` varchar(128) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT '0', + `webservices_url` varchar(255) DEFAULT NULL, + `webservices_key` varchar(128) DEFAULT NULL, + `name_alias` varchar(128) DEFAULT NULL, + `fk_incoterms` int(11) DEFAULT NULL, + `location_incoterms` varchar(255) DEFAULT NULL, + `model_pdf` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `fk_account` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_prefix_comm` (`prefix_comm`,`entity`), + UNIQUE KEY `uk_societe_code_client` (`code_client`,`entity`), + UNIQUE KEY `uk_societe_barcode` (`barcode`,`fk_barcode_type`,`entity`), + UNIQUE KEY `uk_societe_code_fournisseur` (`code_fournisseur`,`entity`), + KEY `idx_societe_user_creat` (`fk_user_creat`), + KEY `idx_societe_user_modif` (`fk_user_modif`), + KEY `idx_societe_barcode` (`barcode`) +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe` +-- + +LOCK TABLES `llx_societe` WRITE; +/*!40000 ALTER TABLE `llx_societe` DISABLE KEYS */; +INSERT INTO `llx_societe` VALUES (1,0,NULL,'2016-01-16 15:21:09','2010-07-08 14:21:44','Indian SAS',1,NULL,NULL,'CU1212-0007','SU1212-0005','7050','6050','1 alalah road',NULL,'Delhi',0,117,NULL,NULL,NULL,NULL,NULL,NULL,4,NULL,'0','','','','','',5000,1,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,'en_IN',NULL,NULL,1,'indiancompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(2,0,NULL,'2016-07-30 11:45:49','2010-07-08 14:23:48','Teclib',1,NULL,NULL,'CU1108-0001','SU1108-0001','411CU11080001','401SU11080001','',NULL,'Paris',0,1,NULL,NULL,'www.teclib.com',NULL,NULL,4,3,57,'0','123456789','','ACE14','','',400000,0,NULL,NULL,NULL,3,1,NULL,'',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,'fr_FR',NULL,NULL,1,'teclibcompany.png','','',0,NULL,NULL,'',0,NULL,NULL,0,'',NULL),(3,0,NULL,'2017-02-16 00:47:25','2010-07-08 22:42:12','Spanish Comp',1,NULL,NULL,'SPANISHCOMP','SU1601-0009',NULL,NULL,'1 via mallere',NULL,'Madrid',123,4,NULL,NULL,NULL,NULL,NULL,3,4,408,'0','','','','','',10000,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,'es_AR',NULL,NULL,1,'spanishcompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(4,0,NULL,'2016-01-22 17:24:53','2010-07-08 22:48:18','Prospector Vaalen',1,NULL,NULL,'CU1303-0014',NULL,NULL,NULL,'',NULL,'Bruxelles',103,2,NULL,NULL,NULL,NULL,NULL,3,4,201,'0','12345678','','','','',0,0,NULL,NULL,NULL,3,0,NULL,'PL_LOW',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'valeencompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(5,0,NULL,'2017-02-21 11:01:17','2010-07-08 23:22:57','NoCountry GmBh',1,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,0,NULL,'',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'nocountrycomp.png','','',0,NULL,NULL,'',0,NULL,NULL,1,'EUR',NULL),(6,0,NULL,'2016-01-16 15:35:56','2010-07-09 00:15:09','Swiss Touch',1,NULL,NULL,'CU1601-0018','SU1601-0010',NULL,NULL,'',NULL,'Genevia',0,6,NULL,NULL,NULL,'swisstouch@example.ch',NULL,2,2,601,'0','','','','','',56000,0,NULL,NULL,NULL,3,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'swisstouch.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(7,0,NULL,'2016-01-16 15:38:32','2010-07-09 01:24:26','Generic customer',1,NULL,NULL,'CU1302-0011',NULL,NULL,NULL,'',NULL,NULL,0,7,NULL,NULL,NULL,'ttt@ttt.com',NULL,NULL,8,NULL,'0','','','','','',0,0,'Generic customer to use for Point Of Sale module.
        ',NULL,NULL,1,0,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'genericcustomer.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(10,0,NULL,'2016-01-16 15:44:20','2010-07-10 15:13:08','NLTechno',1,NULL,NULL,'CU1212-0005','SU1601-0011',NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,'notanemail@nltechno.com',NULL,1,4,54,'0','493861496','49386149600039','6209Z','22-01-2007','FR123456789',10000,0,NULL,NULL,NULL,1,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,'123456789012',NULL,'fr_FR',NULL,NULL,1,'logo_nltechno_94x100.png','','',0,NULL,NULL,'The OpenSource company',0,NULL,NULL,NULL,NULL,NULL),(11,0,NULL,'2017-05-12 09:06:31','2010-07-10 18:35:57','Company Corp 1',1,NULL,NULL,'CU1510-0017',NULL,'7051',NULL,'21 Green Hill street','75500','Los Angeles',0,11,'444123456',NULL,'companycorp1.com','companycorp1@example.com','corp1',1,1,NULL,'0','AB1234567','','','','USABS123',10000,0,NULL,NULL,NULL,3,0,NULL,'PL_LOW',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,'en_US',NULL,NULL,1,'comapnycorp1company.png','','',0,NULL,NULL,'',0,NULL,NULL,1,'EUR',NULL),(12,0,NULL,'2016-01-22 16:41:56','2010-07-11 16:18:08','Dupont Alain',1,NULL,NULL,'CU1601-0019',NULL,NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,'dalain@example.com',NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'pierrecurie.jpg','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(13,0,NULL,'2016-01-22 17:13:16','2010-07-11 17:13:20','Company Corp 2',1,NULL,NULL,NULL,'SU1510-0008',NULL,NULL,'',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'companycorp2company.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(17,0,NULL,'2017-02-15 22:55:34','2011-08-01 02:41:26','Book Keeping Company',1,NULL,NULL,'CU1108-0004','SU1108-0004',NULL,'401SU11080004','The French Company',NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL,1,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,1,NULL,'',0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,0,0.000,NULL,0.000,NULL,NULL,NULL,NULL,NULL,1,'bookkeepercompany.png','','',0,NULL,NULL,'',0,NULL,NULL,1,'EUR',NULL),(19,0,NULL,'2017-02-21 11:51:40','2013-01-12 12:23:05','Magic Food Store',1,NULL,NULL,'CU1301-0008',NULL,NULL,NULL,'65 holdywood boulevard','123456','BigTown',0,4,NULL,'0101',NULL,'myemail@domain.com',NULL,NULL,0,NULL,'0','','','10/10/2010','','',0,0,NULL,NULL,NULL,1,0,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0.000,NULL,0.000,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,'magicfoodstore.png','','',0,NULL,NULL,'',0,NULL,'sepamandate',NULL,NULL,NULL),(25,0,NULL,'2016-01-22 17:21:17','2013-03-10 15:47:37','Print Company',1,NULL,NULL,'CU1303-0016','SU1303-0007',NULL,NULL,'21 Gutenberg street','45600','Berlin',0,5,NULL,NULL,NULL,'printcompany@example.com',NULL,NULL,0,NULL,'0','','','','','',0,0,NULL,NULL,NULL,0,1,NULL,NULL,0,0,0,1,12,0,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,0.000,NULL,0.000,NULL,NULL,'de_DE',NULL,NULL,1,'printcompany.png','','',0,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL),(26,0,NULL,'2017-02-21 00:05:05','2017-02-12 23:17:04','Patient SuperIll',1,NULL,NULL,'CU1702-0020',NULL,'411CU17020020',NULL,'',NULL,NULL,0,14,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,'','','','','',NULL,0,NULL,NULL,NULL,3,0,NULL,'',0,0,0,12,12,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.000,NULL,0.000,NULL,NULL,'en_US','patient@cabinetmed',NULL,1,NULL,'','',0,NULL,NULL,'',0,NULL,NULL,0,'',NULL); +/*!40000 ALTER TABLE `llx_societe` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_address` +-- + +DROP TABLE IF EXISTS `llx_societe_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_address` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `fk_soc` int(11) DEFAULT '0', + `name` varchar(60) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(10) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `phone` varchar(20) DEFAULT NULL, + `fax` varchar(20) DEFAULT NULL, + `note` text, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_address` +-- + +LOCK TABLES `llx_societe_address` WRITE; +/*!40000 ALTER TABLE `llx_societe_address` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_address` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_commerciaux` +-- + +DROP TABLE IF EXISTS `llx_societe_commerciaux`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_commerciaux` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_commerciaux` (`fk_soc`,`fk_user`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_commerciaux` +-- + +LOCK TABLES `llx_societe_commerciaux` WRITE; +/*!40000 ALTER TABLE `llx_societe_commerciaux` DISABLE KEYS */; +INSERT INTO `llx_societe_commerciaux` VALUES (1,2,2,NULL),(2,3,2,NULL),(5,17,1,NULL),(6,19,1,NULL),(8,19,3,NULL),(9,11,16,NULL),(10,13,17,NULL),(11,26,12,NULL); +/*!40000 ALTER TABLE `llx_societe_commerciaux` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_extrafields` +-- + +DROP TABLE IF EXISTS `llx_societe_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_societe_extrafields` (`fk_object`) +) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_extrafields` +-- + +LOCK TABLES `llx_societe_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_societe_extrafields` DISABLE KEYS */; +INSERT INTO `llx_societe_extrafields` VALUES (75,'2016-01-22 16:40:03',10,NULL),(77,'2016-01-22 16:41:56',12,NULL),(79,'2016-01-22 17:13:16',13,NULL),(81,'2016-01-22 17:18:08',19,NULL),(82,'2016-01-22 17:21:17',25,NULL),(83,'2016-01-22 17:21:51',1,NULL),(85,'2016-01-22 17:22:32',3,NULL),(86,'2016-01-22 17:24:53',4,NULL),(88,'2016-01-22 17:25:26',6,NULL),(89,'2016-01-22 17:25:41',7,NULL),(92,'2016-07-30 11:45:49',2,NULL),(94,'2017-02-15 22:55:34',17,NULL),(95,'2017-02-21 00:05:05',26,NULL),(96,'2017-02-21 11:01:17',5,NULL),(97,'2017-05-12 09:06:31',11,NULL); +/*!40000 ALTER TABLE `llx_societe_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_log` +-- + +DROP TABLE IF EXISTS `llx_societe_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datel` datetime DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_statut` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `author` varchar(30) DEFAULT NULL, + `label` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_log` +-- + +LOCK TABLES `llx_societe_log` WRITE; +/*!40000 ALTER TABLE `llx_societe_log` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_log` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_prices` +-- + +DROP TABLE IF EXISTS `llx_societe_prices`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_prices` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) DEFAULT '0', + `tms` timestamp NULL DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `price_level` tinyint(4) DEFAULT '1', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_prices` +-- + +LOCK TABLES `llx_societe_prices` WRITE; +/*!40000 ALTER TABLE `llx_societe_prices` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_prices` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_remise` +-- + +DROP TABLE IF EXISTS `llx_societe_remise`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_remise` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `remise_client` double(6,3) NOT NULL DEFAULT '0.000', + `note` text, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_remise` +-- + +LOCK TABLES `llx_societe_remise` WRITE; +/*!40000 ALTER TABLE `llx_societe_remise` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_societe_remise` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_remise_except` +-- + +DROP TABLE IF EXISTS `llx_societe_remise_except`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_remise_except` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `amount_ht` double(24,8) NOT NULL, + `amount_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `amount_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `tva_tx` double(6,3) NOT NULL DEFAULT '0.000', + `fk_user` int(11) NOT NULL, + `fk_facture_line` int(11) DEFAULT NULL, + `fk_facture` int(11) DEFAULT NULL, + `fk_facture_source` int(11) DEFAULT NULL, + `description` text NOT NULL, + `multicurrency_amount_ht` double(24,8) NOT NULL DEFAULT '0.00000000', + `multicurrency_amount_tva` double(24,8) NOT NULL DEFAULT '0.00000000', + `multicurrency_amount_ttc` double(24,8) NOT NULL DEFAULT '0.00000000', + `fk_invoice_supplier_line` int(11) DEFAULT NULL, + `fk_invoice_supplier` int(11) DEFAULT NULL, + `fk_invoice_supplier_source` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_societe_remise_except_fk_user` (`fk_user`), + KEY `idx_societe_remise_except_fk_soc` (`fk_soc`), + KEY `idx_societe_remise_except_fk_facture_line` (`fk_facture_line`), + KEY `idx_societe_remise_except_fk_facture` (`fk_facture`), + KEY `idx_societe_remise_except_fk_facture_source` (`fk_facture_source`), + KEY `fk_soc_remise_fk_invoice_supplier_line` (`fk_invoice_supplier_line`), + KEY `fk_societe_remise_fk_invoice_supplier_source` (`fk_invoice_supplier`), + CONSTRAINT `fk_societe_remise_fk_invoice_supplier_source` FOREIGN KEY (`fk_invoice_supplier`) REFERENCES `llx_facture_fourn` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture` FOREIGN KEY (`fk_facture`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture_line` FOREIGN KEY (`fk_facture_line`) REFERENCES `llx_facturedet` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_facture_source` FOREIGN KEY (`fk_facture_source`) REFERENCES `llx_facture` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_invoice_supplier` FOREIGN KEY (`fk_invoice_supplier`) REFERENCES `llx_facture_fourn` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_societe_remise_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_soc_remise_fk_facture_line` FOREIGN KEY (`fk_facture_line`) REFERENCES `llx_facturedet` (`rowid`), + CONSTRAINT `fk_soc_remise_fk_invoice_supplier_line` FOREIGN KEY (`fk_invoice_supplier_line`) REFERENCES `llx_facture_fourn_det` (`rowid`), + CONSTRAINT `fk_soc_remise_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_remise_except` +-- + +LOCK TABLES `llx_societe_remise_except` WRITE; +/*!40000 ALTER TABLE `llx_societe_remise_except` DISABLE KEYS */; +INSERT INTO `llx_societe_remise_except` VALUES (2,1,19,'2013-03-19 09:36:15',10.00000000,1.25000000,11.25000000,12.500,1,NULL,NULL,NULL,'hfghgf',0.00000000,0.00000000,0.00000000,NULL,NULL,NULL); +/*!40000 ALTER TABLE `llx_societe_remise_except` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_societe_rib` +-- + +DROP TABLE IF EXISTS `llx_societe_rib`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_societe_rib` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_soc` int(11) NOT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `bank` varchar(255) DEFAULT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(20) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` text, + `default_rib` tinyint(4) NOT NULL DEFAULT '0', + `rum` varchar(32) DEFAULT NULL, + `date_rum` date DEFAULT NULL, + `frstrecur` varchar(16) DEFAULT 'FRST', + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_societe_rib` +-- + +LOCK TABLES `llx_societe_rib` WRITE; +/*!40000 ALTER TABLE `llx_societe_rib` DISABLE KEYS */; +INSERT INTO `llx_societe_rib` VALUES (1,19,'2017-02-21 15:50:32','2017-02-21 11:53:08','Morgan Bank','Morgan Bank','','','','','PSPBFIHH','ES80 2310 0001 1800 0001 2345','Royal via,\r\nMadrid','Mr Esposito','10 via ferrata,\r\nMadrid',1,'RUM1301-0008-0',NULL,'FRST',NULL); +/*!40000 ALTER TABLE `llx_societe_rib` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_socpeople` +-- + +DROP TABLE IF EXISTS `llx_socpeople`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_socpeople` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_soc` int(11) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(128) DEFAULT NULL, + `civility` varchar(6) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` text, + `fk_departement` int(11) DEFAULT NULL, + `fk_pays` int(11) DEFAULT '0', + `birthday` date DEFAULT NULL, + `poste` varchar(80) DEFAULT NULL, + `phone` varchar(30) DEFAULT NULL, + `phone_perso` varchar(30) DEFAULT NULL, + `phone_mobile` varchar(30) DEFAULT NULL, + `fax` varchar(30) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `jabberid` varchar(255) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `priv` smallint(6) NOT NULL DEFAULT '0', + `no_email` smallint(6) NOT NULL DEFAULT '0', + `fk_user_creat` int(11) DEFAULT '0', + `fk_user_modif` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `default_lang` varchar(6) DEFAULT NULL, + `canvas` varchar(32) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `statut` tinyint(4) NOT NULL DEFAULT '1', + PRIMARY KEY (`rowid`), + KEY `idx_socpeople_fk_soc` (`fk_soc`), + KEY `idx_socpeople_fk_user_creat` (`fk_user_creat`), + CONSTRAINT `fk_socpeople_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_socpeople_user_creat_user_rowid` FOREIGN KEY (`fk_user_creat`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_socpeople` +-- + +LOCK TABLES `llx_socpeople` WRITE; +/*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +/*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_socpeople_extrafields` +-- + +DROP TABLE IF EXISTS `llx_socpeople_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_socpeople_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_socpeople_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_socpeople_extrafields` +-- + +LOCK TABLES `llx_socpeople_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_socpeople_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_socpeople_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_stock_mouvement` +-- + +DROP TABLE IF EXISTS `llx_stock_mouvement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_stock_mouvement` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datem` datetime DEFAULT NULL, + `fk_product` int(11) NOT NULL, + `fk_entrepot` int(11) NOT NULL, + `value` double DEFAULT NULL, + `price` double(24,8) DEFAULT '0.00000000', + `type_mouvement` smallint(6) DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `fk_origin` int(11) DEFAULT NULL, + `origintype` varchar(32) DEFAULT NULL, + `inventorycode` varchar(128) DEFAULT NULL, + `batch` varchar(30) DEFAULT NULL, + `eatby` date DEFAULT NULL, + `sellby` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_stock_mouvement_fk_product` (`fk_product`), + KEY `idx_stock_mouvement_fk_entrepot` (`fk_entrepot`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_stock_mouvement` +-- + +LOCK TABLES `llx_stock_mouvement` WRITE; +/*!40000 ALTER TABLE `llx_stock_mouvement` DISABLE KEYS */; +INSERT INTO `llx_stock_mouvement` VALUES (1,'2010-07-08 22:43:51','2010-07-09 00:43:51',2,2,1000,0.00000000,0,1,'Correct stock',NULL,NULL,NULL,NULL,NULL,NULL),(3,'2010-07-10 22:56:18','2010-07-11 00:56:18',4,2,500,0.00000000,0,1,'Init',NULL,NULL,NULL,NULL,NULL,NULL),(4,'2010-07-10 23:02:20','2010-07-11 01:02:20',4,2,500,0.00000000,0,1,'',NULL,NULL,NULL,NULL,NULL,NULL),(5,'2010-07-11 16:49:44','2010-07-11 18:49:44',4,1,2,10.00000000,3,1,'',NULL,NULL,NULL,NULL,NULL,NULL),(6,'2010-07-11 16:49:44','2010-07-11 18:49:44',1,1,4,0.00000000,3,1,'',NULL,NULL,NULL,NULL,NULL,NULL),(7,'2013-01-19 17:22:48','2013-01-19 18:22:48',11,1,-1,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(8,'2013-01-19 17:22:48','2013-01-19 18:22:48',4,1,-1,5.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(9,'2013-01-19 17:22:48','2013-01-19 18:22:48',1,1,-2,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(10,'2013-01-19 17:31:10','2013-01-19 18:31:10',2,1,-1,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(11,'2013-01-19 17:31:58','2013-01-19 18:31:58',2,1,-1,0.00000000,2,1,'Facture créée dans DoliPOS',NULL,NULL,NULL,NULL,NULL,NULL),(12,'2016-07-30 13:39:31','2016-07-30 17:39:31',10,2,50,0.00000000,0,12,'Stock correction for product COMP-XP4523',0,'',NULL,'5599887766452',NULL,NULL),(13,'2016-07-30 13:40:12','2016-07-30 17:40:12',10,2,60,0.00000000,0,12,'Stock correction for product COMP-XP4523',0,'',NULL,'4494487766452',NULL,NULL),(14,'2016-07-30 13:40:39','2016-07-30 17:40:39',10,2,-35,0.00000000,1,12,'Stock transfer of product COMP-XP4523 into another warehouse',0,'','160730174015','5599887766452',NULL,NULL),(15,'2016-07-30 13:40:39','2016-07-30 17:40:39',10,1,35,0.00000000,0,12,'Stock transfer of product COMP-XP4523 into another warehouse',0,'','160730174015','5599887766452',NULL,NULL),(16,'2017-02-15 23:58:08','2017-02-16 03:58:08',10,1,-1,100.00000000,2,12,'Expédition SH1702-0002 validée',3,'shipping',NULL,'5599887766452',NULL,NULL),(17,'2017-02-16 00:12:09','2017-02-16 04:12:09',10,1,1,0.00000000,3,12,'Expédition SH1702-0002 supprimée',0,'',NULL,'5599887766452',NULL,NULL); +/*!40000 ALTER TABLE `llx_stock_mouvement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_subscription` +-- + +DROP TABLE IF EXISTS `llx_subscription`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_subscription` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `fk_adherent` int(11) DEFAULT NULL, + `dateadh` datetime DEFAULT NULL, + `datef` date DEFAULT NULL, + `subscription` double DEFAULT NULL, + `fk_bank` int(11) DEFAULT NULL, + `note` text COLLATE utf8_unicode_ci, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_subscription` (`fk_adherent`,`dateadh`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_subscription` +-- + +LOCK TABLES `llx_subscription` WRITE; +/*!40000 ALTER TABLE `llx_subscription` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_subscription` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposal` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposal` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(30) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `ref_ext` varchar(255) DEFAULT NULL, + `ref_int` varchar(255) DEFAULT NULL, + `fk_soc` int(11) DEFAULT NULL, + `fk_projet` int(11) DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` datetime DEFAULT NULL, + `date_valid` datetime DEFAULT NULL, + `date_cloture` datetime DEFAULT NULL, + `fk_user_author` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `fk_user_cloture` int(11) DEFAULT NULL, + `fk_statut` smallint(6) NOT NULL DEFAULT '0', + `price` double DEFAULT '0', + `remise_percent` double DEFAULT '0', + `remise_absolue` double DEFAULT '0', + `remise` double DEFAULT '0', + `total_ht` double(24,8) DEFAULT '0.00000000', + `tva` double(24,8) DEFAULT '0.00000000', + `localtax1` double(24,8) DEFAULT '0.00000000', + `localtax2` double(24,8) DEFAULT '0.00000000', + `total` double(24,8) DEFAULT '0.00000000', + `fk_account` int(11) DEFAULT NULL, + `fk_currency` varchar(3) DEFAULT NULL, + `fk_cond_reglement` int(11) DEFAULT NULL, + `fk_mode_reglement` int(11) DEFAULT NULL, + `note_private` text, + `note_public` text, + `model_pdf` varchar(255) DEFAULT NULL, + `date_livraison` date DEFAULT NULL, + `fk_shipping_method` int(11) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `extraparams` varchar(255) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_tx` double(24,8) DEFAULT '1.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposal` +-- + +LOCK TABLES `llx_supplier_proposal` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposal` DISABLE KEYS */; +INSERT INTO `llx_supplier_proposal` VALUES (2,'(PROV2)',1,NULL,NULL,10,NULL,'2017-02-17 00:40:50','2017-02-17 04:40:14',NULL,NULL,12,NULL,NULL,NULL,0,0,NULL,NULL,0,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,NULL,NULL,2,7,'','','aurore','2017-02-17',1,NULL,NULL,1,'EUR',1.00000000,200.00000000,0.00000000,200.00000000); +/*!40000 ALTER TABLE `llx_supplier_proposal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposal_extrafields` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposal_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposal_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposal_extrafields` +-- + +LOCK TABLES `llx_supplier_proposal_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposal_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_supplier_proposal_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposaldet` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposaldet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposaldet` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_supplier_proposal` int(11) NOT NULL, + `fk_parent_line` int(11) DEFAULT NULL, + `fk_product` int(11) DEFAULT NULL, + `label` varchar(255) DEFAULT NULL, + `description` text, + `fk_remise_except` int(11) DEFAULT NULL, + `tva_tx` double(6,3) DEFAULT '0.000', + `vat_src_code` varchar(10) DEFAULT '', + `localtax1_tx` double(6,3) DEFAULT '0.000', + `localtax1_type` varchar(10) DEFAULT NULL, + `localtax2_tx` double(6,3) DEFAULT '0.000', + `localtax2_type` varchar(10) DEFAULT NULL, + `qty` double DEFAULT NULL, + `remise_percent` double DEFAULT '0', + `remise` double DEFAULT '0', + `price` double DEFAULT NULL, + `subprice` double(24,8) DEFAULT '0.00000000', + `total_ht` double(24,8) DEFAULT '0.00000000', + `total_tva` double(24,8) DEFAULT '0.00000000', + `total_localtax1` double(24,8) DEFAULT '0.00000000', + `total_localtax2` double(24,8) DEFAULT '0.00000000', + `total_ttc` double(24,8) DEFAULT '0.00000000', + `product_type` int(11) DEFAULT '0', + `info_bits` int(11) DEFAULT '0', + `buy_price_ht` double(24,8) DEFAULT '0.00000000', + `fk_product_fournisseur_price` int(11) DEFAULT NULL, + `special_code` int(11) DEFAULT '0', + `rang` int(11) DEFAULT '0', + `ref_fourn` varchar(30) DEFAULT NULL, + `fk_multicurrency` int(11) DEFAULT NULL, + `multicurrency_code` varchar(255) DEFAULT NULL, + `multicurrency_subprice` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ht` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_tva` double(24,8) DEFAULT '0.00000000', + `multicurrency_total_ttc` double(24,8) DEFAULT '0.00000000', + `fk_unit` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_supplier_proposaldet_fk_supplier_proposal` (`fk_supplier_proposal`), + KEY `idx_supplier_proposaldet_fk_product` (`fk_product`), + KEY `fk_supplier_proposaldet_fk_unit` (`fk_unit`), + CONSTRAINT `fk_supplier_proposaldet_fk_supplier_proposal` FOREIGN KEY (`fk_supplier_proposal`) REFERENCES `llx_supplier_proposal` (`rowid`), + CONSTRAINT `fk_supplier_proposaldet_fk_unit` FOREIGN KEY (`fk_unit`) REFERENCES `llx_c_units` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposaldet` +-- + +LOCK TABLES `llx_supplier_proposaldet` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposaldet` DISABLE KEYS */; +INSERT INTO `llx_supplier_proposaldet` VALUES (2,2,NULL,NULL,NULL,'A powerfull computer with 8Gb memory.',NULL,0.000,'',0.000,'0',0.000,'0',1,0,0,NULL,200.00000000,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,0,0,0.00000000,NULL,0,1,'',1,'EUR',200.00000000,200.00000000,0.00000000,200.00000000,NULL); +/*!40000 ALTER TABLE `llx_supplier_proposaldet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_supplier_proposaldet_extrafields` +-- + +DROP TABLE IF EXISTS `llx_supplier_proposaldet_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_supplier_proposaldet_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_supplier_proposaldet_extrafields` +-- + +LOCK TABLES `llx_supplier_proposaldet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_supplier_proposaldet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_supplier_proposaldet_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_tva` +-- + +DROP TABLE IF EXISTS `llx_tva`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_tva` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `datec` date DEFAULT NULL, + `datep` date DEFAULT NULL, + `datev` date DEFAULT NULL, + `amount` double NOT NULL DEFAULT '0', + `label` varchar(255) DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `note` text, + `fk_bank` int(11) DEFAULT NULL, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_typepayment` int(11) DEFAULT NULL, + `num_payment` varchar(50) DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_tva` +-- + +LOCK TABLES `llx_tva` WRITE; +/*!40000 ALTER TABLE `llx_tva` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_tva` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user` +-- + +DROP TABLE IF EXISTS `llx_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `login` varchar(24) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `civility` varchar(6) DEFAULT NULL, + `ref_ext` varchar(50) DEFAULT NULL, + `ref_int` varchar(50) DEFAULT NULL, + `employee` smallint(6) DEFAULT '1', + `fk_establishment` int(11) DEFAULT '0', + `pass` varchar(128) DEFAULT NULL, + `pass_crypted` varchar(128) DEFAULT NULL, + `pass_temp` varchar(128) DEFAULT NULL, + `api_key` varchar(128) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `job` varchar(128) DEFAULT NULL, + `skype` varchar(255) DEFAULT NULL, + `office_phone` varchar(20) DEFAULT NULL, + `office_fax` varchar(20) DEFAULT NULL, + `user_mobile` varchar(20) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `signature` text, + `admin` smallint(6) DEFAULT '0', + `webcal_login` varchar(25) DEFAULT NULL, + `module_comm` smallint(6) DEFAULT '1', + `module_compta` smallint(6) DEFAULT '1', + `fk_soc` int(11) DEFAULT NULL, + `fk_socpeople` int(11) DEFAULT NULL, + `fk_member` int(11) DEFAULT NULL, + `note` text, + `datelastlogin` datetime DEFAULT NULL, + `datepreviouslogin` datetime DEFAULT NULL, + `egroupware_id` int(11) DEFAULT NULL, + `ldap_sid` varchar(255) DEFAULT NULL, + `statut` tinyint(4) DEFAULT '1', + `photo` varchar(255) DEFAULT NULL, + `lang` varchar(6) DEFAULT NULL, + `openid` varchar(255) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `thm` double(24,8) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `zip` varchar(25) DEFAULT NULL, + `town` varchar(50) DEFAULT NULL, + `fk_state` int(11) DEFAULT '0', + `fk_country` int(11) DEFAULT '0', + `color` varchar(6) DEFAULT NULL, + `accountancy_code` varchar(32) DEFAULT NULL, + `barcode` varchar(255) DEFAULT NULL, + `fk_barcode_type` int(11) DEFAULT '0', + `nb_holiday` int(11) DEFAULT '0', + `salary` double(24,8) DEFAULT NULL, + `tjm` double(24,8) DEFAULT NULL, + `salaryextra` double(24,8) DEFAULT NULL, + `weeklyhours` double(16,8) DEFAULT NULL, + `gender` varchar(10) DEFAULT NULL, + `note_public` text, + `dateemployment` datetime DEFAULT NULL, + `import_key` varchar(14) DEFAULT NULL, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_login` (`login`,`entity`), + UNIQUE KEY `uk_user_fk_socpeople` (`fk_socpeople`), + UNIQUE KEY `uk_user_fk_member` (`fk_member`), + UNIQUE KEY `uk_user_api_key` (`api_key`), + KEY `idx_user_api_key` (`api_key`), + KEY `idx_user_fk_societe` (`fk_soc`) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user` +-- + +LOCK TABLES `llx_user` WRITE; +/*!40000 ALTER TABLE `llx_user` DISABLE KEYS */; +INSERT INTO `llx_user` VALUES (1,'2010-07-08 13:20:11','2017-02-01 15:06:04',NULL,NULL,'aeinstein',0,NULL,NULL,NULL,1,0,NULL,'11c9c772d6471aa24c27274bdd8a223b',NULL,NULL,'Einstein','Albert','','','123456789','','','aeinstein@example.com','',0,'',1,1,NULL,NULL,NULL,'','2015-10-05 08:32:44','2015-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(2,'2010-07-08 13:54:48','2017-02-01 15:06:04',NULL,NULL,'demo',1,NULL,NULL,NULL,1,0,NULL,'fe01ce2a7fbac8fafaed7c982a04e229',NULL,NULL,'Doe','David','','','09123123','','','daviddoe@mycompany.com','',0,'',1,1,NULL,NULL,NULL,'','2016-07-30 23:10:54','2016-07-30 23:04:17',NULL,'',1,'johndoe.png',NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(3,'2010-07-11 16:18:59','2017-02-01 15:06:04',NULL,NULL,'pcurie',1,NULL,NULL,NULL,1,0,NULL,'ab335b4eb4c3c99334f656e5db9584c9',NULL,NULL,'Curie','Pierre','','','','','','pcurie@example.com','',0,'',1,1,NULL,NULL,2,'','2012-12-21 17:38:55',NULL,NULL,'',1,'pierrecurie.jpg',NULL,NULL,14,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'2013-01-23 17:52:27','2017-02-01 15:06:04',NULL,NULL,'bbookkeeper',1,NULL,NULL,NULL,1,0,NULL,'a7d30b58d647fcf59b7163f9592b1dbb',NULL,NULL,'Bookkeeper','Bob','Bookkeeper','','','','','','',0,'',1,1,17,6,NULL,'','2013-02-25 10:18:41','2013-01-23 17:53:20',NULL,'',1,NULL,NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(10,'2015-10-03 11:47:41','2017-02-01 15:06:04',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'52cda011808bb282d1d3625ab607a145',NULL,'t3mnkbhs','Curie','Marie','','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,0,NULL,NULL,NULL,NULL,'woman',NULL,NULL,NULL,NULL),(11,'2015-10-05 09:07:52','2017-02-01 15:06:04',NULL,NULL,'zzeceo',1,NULL,NULL,NULL,1,0,NULL,'92af989c4c3a5140fb5d73eb77a52454',NULL,'cq78nf9m','Zeceo','Zack','President','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'','2015-10-05 22:48:08','2015-10-05 21:18:46',NULL,'',1,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'2015-10-05 09:09:46','2017-02-01 15:06:04',NULL,NULL,'admin',0,NULL,NULL,NULL,1,0,NULL,'21232f297a57a5a743894a0e4a801fc3',NULL,'nd6hgbcr','Adminson','Alice','Admin Technical','','','','','','',1,NULL,1,1,NULL,NULL,NULL,'','2017-08-27 17:29:16','2017-05-12 13:02:48',NULL,'',1,'mariecurie.jpg',NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'woman',NULL,NULL,NULL,NULL),(13,'2015-10-05 21:29:35','2017-02-01 15:06:04',NULL,NULL,'ccommercy',1,NULL,NULL,NULL,1,0,NULL,'179858e041af35e8f4c81d68c55fe9da',NULL,'y451ksdv','Commercy','Charle','Commercial leader','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(14,'2015-10-05 21:33:33','2017-02-01 15:06:04',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'39bee07ac42f31c98e79cdcd5e5fe4c5',NULL,'s2hp8bxd','Scientol','Sam','Scientist leader','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,11,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'2015-10-05 22:47:52','2017-02-20 16:49:00',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'d68005ccf362b82d084551b6291792a3',NULL,'cx9y1dk0','Charle1','Commerson','Sale representative','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'','2015-10-05 23:46:24','2015-10-05 23:37:31',NULL,'',1,NULL,NULL,NULL,13,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'2015-10-05 22:48:39','2017-02-01 15:06:04',NULL,NULL,'cc2',1,NULL,NULL,NULL,1,0,NULL,'a964065211872fb76f876c6c3e952ea3',NULL,'gw8cb7xj','Charle2','Commerson','Sale representative','','','','','','',0,NULL,1,1,NULL,NULL,NULL,'','2015-10-05 23:16:06',NULL,NULL,'',0,NULL,NULL,NULL,13,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(18,'2016-01-22 17:27:02','2017-02-01 15:06:04',NULL,NULL,'ldestailleur',1,NULL,NULL,NULL,1,0,NULL,'1bb7805145a7a5066df9e6d585b8b645',NULL,'87g06wbx','Destailleur','Laurent','Project leader of Dolibarr ERP CRM','','','','','ldestailleur@example.com','
        Laurent DESTAILLEUR
        \r\n\r\n
        \r\n
        Project Director
        \r\nldestailleur@example.com
        \r\n\r\n
         
        \r\n\r\n\r\n
        ',0,NULL,1,1,10,10,NULL,'More information on http://www.destailleur.fr','2016-07-30 22:26:58',NULL,NULL,'',1,'ldestailleur_200x200.jpg',NULL,NULL,NULL,NULL,'','','',NULL,NULL,'007f7f','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL),(19,'2017-02-02 03:55:44','2017-02-01 23:56:50',NULL,NULL,'aboston',1,NULL,NULL,NULL,1,0,NULL,'a7a77a5aff2d5fc2f75f2f61507c88d4',NULL,NULL,'Boston','Alex','','','','','','aboston@example.com','Alex Boston
        \r\nAdmin support service - 555 01 02 03 04',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,12,25.00000000,'','','',NULL,NULL,'ff00ff','',NULL,0,0,NULL,NULL,NULL,32.00000000,NULL,NULL,'2014-11-04 00:00:00',NULL,NULL); +/*!40000 ALTER TABLE `llx_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_alert` +-- + +DROP TABLE IF EXISTS `llx_user_alert`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_alert` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `type` int(11) DEFAULT NULL, + `fk_contact` int(11) DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_alert` +-- + +LOCK TABLES `llx_user_alert` WRITE; +/*!40000 ALTER TABLE `llx_user_alert` DISABLE KEYS */; +INSERT INTO `llx_user_alert` VALUES (1,1,1,1),(2,1,10,12); +/*!40000 ALTER TABLE `llx_user_alert` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_clicktodial` +-- + +DROP TABLE IF EXISTS `llx_user_clicktodial`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_clicktodial` ( + `fk_user` int(11) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `login` varchar(32) DEFAULT NULL, + `pass` varchar(64) DEFAULT NULL, + `poste` varchar(20) DEFAULT NULL, + PRIMARY KEY (`fk_user`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_clicktodial` +-- + +LOCK TABLES `llx_user_clicktodial` WRITE; +/*!40000 ALTER TABLE `llx_user_clicktodial` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_clicktodial` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_employment` +-- + +DROP TABLE IF EXISTS `llx_user_employment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_employment` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `ref` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `ref_ext` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `fk_user` int(11) DEFAULT NULL, + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_creat` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `job` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `status` int(11) NOT NULL, + `salary` double(24,8) DEFAULT NULL, + `salaryextra` double(24,8) DEFAULT NULL, + `weeklyhours` double(16,8) DEFAULT NULL, + `dateemployment` date DEFAULT NULL, + `dateemploymentend` date DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_employment` (`ref`,`entity`), + KEY `fk_user_employment_fk_user` (`fk_user`), + CONSTRAINT `fk_user_employment_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_employment` +-- + +LOCK TABLES `llx_user_employment` WRITE; +/*!40000 ALTER TABLE `llx_user_employment` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_employment` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_extrafields` +-- + +DROP TABLE IF EXISTS `llx_user_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_user_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_extrafields` +-- + +LOCK TABLES `llx_user_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_user_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_param` +-- + +DROP TABLE IF EXISTS `llx_user_param`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_param` ( + `fk_user` int(11) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `param` varchar(255) NOT NULL, + `value` text NOT NULL, + UNIQUE KEY `uk_user_param` (`fk_user`,`param`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_param` +-- + +LOCK TABLES `llx_user_param` WRITE; +/*!40000 ALTER TABLE `llx_user_param` DISABLE KEYS */; +INSERT INTO `llx_user_param` VALUES (1,1,'MAIN_BOXES_0','1'),(1,1,'MAIN_THEME','eldy'),(1,3,'THEME_ELDY_ENABLE_PERSONALIZED','1'),(1,1,'THEME_ELDY_RGB','ded0ed'),(1,3,'THEME_ELDY_RGB','d0ddc3'),(2,1,'MAIN_BOXES_0','1'),(11,1,'MAIN_BOXES_0','1'),(12,1,'MAIN_BOXES_0','1'),(12,1,'MAIN_LANG_DEFAULT','en_US'),(12,1,'MAIN_SELECTEDFIELDS_/dolibarr_4.0/htdocs/adherents/list.php','d.zip,d.ref,d.lastname,d.firstname,d.company,d.login,d.morphy,t.libelle,d.email,d.datefin,d.statut,'),(12,1,'MAIN_SELECTEDFIELDS_invoicelist','rtp,f.facnumber,f.ref_client,f.date,f.date_lim_reglement,s.nom,s.town,s.zip,f.fk_mode_reglement,f.total_ht,f.fk_statut,'),(12,1,'MAIN_SELECTEDFIELDS_projectlist','p.budget_amount,p.ref,p.title,s.nom,commercial,p.dateo,p.datee,p.public,p.opp_amount,p.fk_opp_status,p.opp_percent,p.fk_statut,ef.priority,'),(12,1,'MAIN_SELECTEDFIELDS_proposallist','p.datec,p.ref,p.ref_client,s.nom,s.town,s.zip,p.date,p.fin_validite,p.total_ht,u.login,p.fk_statut,'),(12,1,'MAIN_SELECTEDFIELDS_servicelist','p.ref,p.label,p.duration,p.sellprice,p.minbuyprice,p.tosell,p.tobuy,'); +/*!40000 ALTER TABLE `llx_user_param` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_rib` +-- + +DROP TABLE IF EXISTS `llx_user_rib`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_rib` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_user` int(11) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `label` varchar(30) DEFAULT NULL, + `bank` varchar(255) DEFAULT NULL, + `code_banque` varchar(128) DEFAULT NULL, + `code_guichet` varchar(6) DEFAULT NULL, + `number` varchar(255) DEFAULT NULL, + `cle_rib` varchar(5) DEFAULT NULL, + `bic` varchar(11) DEFAULT NULL, + `iban_prefix` varchar(34) DEFAULT NULL, + `domiciliation` varchar(255) DEFAULT NULL, + `proprio` varchar(60) DEFAULT NULL, + `owner_address` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_rib` +-- + +LOCK TABLES `llx_user_rib` WRITE; +/*!40000 ALTER TABLE `llx_user_rib` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_user_rib` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_user_rights` +-- + +DROP TABLE IF EXISTS `llx_user_rights`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_user_rights` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_user` int(11) NOT NULL, + `fk_id` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_user_rights` (`entity`,`fk_user`,`fk_id`), + KEY `fk_user_rights_fk_user_user` (`fk_user`), + CONSTRAINT `fk_user_rights_fk_user_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=15673 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_user_rights` +-- + +LOCK TABLES `llx_user_rights` WRITE; +/*!40000 ALTER TABLE `llx_user_rights` DISABLE KEYS */; +INSERT INTO `llx_user_rights` VALUES (12402,1,1,11),(12380,1,1,12),(12385,1,1,13),(12389,1,1,14),(12393,1,1,15),(12398,1,1,16),(12404,1,1,19),(9726,1,1,21),(9700,1,1,22),(9706,1,1,24),(9711,1,1,25),(9716,1,1,26),(9722,1,1,27),(9728,1,1,28),(9978,1,1,31),(9968,1,1,32),(9974,1,1,34),(1910,1,1,36),(9980,1,1,38),(11573,1,1,41),(11574,1,1,42),(11575,1,1,44),(11576,1,1,45),(7184,1,1,61),(7181,1,1,62),(7183,1,1,64),(7185,1,1,67),(7186,1,1,68),(1678,1,1,71),(1673,1,1,72),(1675,1,1,74),(1679,1,1,75),(1677,1,1,76),(1681,1,1,78),(1682,1,1,79),(12322,1,1,81),(12309,1,1,82),(12312,1,1,84),(12314,1,1,86),(12317,1,1,87),(12320,1,1,88),(12323,1,1,89),(11580,1,1,91),(11581,1,1,92),(11582,1,1,93),(11583,1,1,94),(10097,1,1,95),(10099,1,1,96),(10103,1,1,97),(10104,1,1,98),(7139,1,1,101),(7134,1,1,102),(7136,1,1,104),(7137,1,1,105),(7138,1,1,106),(7140,1,1,109),(10229,1,1,111),(10201,1,1,112),(10207,1,1,113),(10213,1,1,114),(10219,1,1,115),(10225,1,1,116),(10231,1,1,117),(12518,1,1,121),(12508,1,1,122),(12514,1,1,125),(12520,1,1,126),(11577,1,1,141),(11578,1,1,142),(11579,1,1,144),(2307,1,1,151),(2304,1,1,152),(2306,1,1,153),(2308,1,1,154),(10092,1,1,161),(10093,1,1,162),(10094,1,1,163),(10095,1,1,164),(10096,1,1,165),(1585,1,1,170),(12342,1,1,171),(12331,1,1,172),(12335,1,1,173),(12339,1,1,174),(12343,1,1,178),(10000,1,1,221),(9990,1,1,222),(9996,1,1,223),(10002,1,1,229),(10007,1,1,237),(10011,1,1,238),(10015,1,1,239),(1686,1,1,241),(1685,1,1,242),(1687,1,1,243),(12604,1,1,251),(12566,1,1,252),(12569,1,1,253),(12572,1,1,254),(12575,1,1,255),(12579,1,1,256),(1617,1,1,258),(12525,1,1,262),(12544,1,1,281),(12534,1,1,282),(12540,1,1,283),(12546,1,1,286),(12288,1,1,300),(12290,1,1,301),(11591,1,1,302),(1763,1,1,331),(1762,1,1,332),(1764,1,1,333),(12582,1,1,341),(12584,1,1,342),(12586,1,1,343),(12588,1,1,344),(12600,1,1,351),(12593,1,1,352),(12597,1,1,353),(12601,1,1,354),(12605,1,1,358),(12560,1,1,531),(12553,1,1,532),(12557,1,1,534),(1625,1,1,536),(12561,1,1,538),(12358,1,1,700),(12348,1,1,701),(12354,1,1,702),(12360,1,1,703),(1755,1,1,1001),(1754,1,1,1002),(1756,1,1,1003),(1758,1,1,1004),(1759,1,1,1005),(7146,1,1,1101),(7143,1,1,1102),(7145,1,1,1104),(7147,1,1,1109),(12412,1,1,1181),(12458,1,1,1182),(12417,1,1,1183),(12420,1,1,1184),(12423,1,1,1185),(12427,1,1,1186),(12431,1,1,1187),(12437,1,1,1188),(12434,1,1,1189),(1578,1,1,1201),(1579,1,1,1202),(12454,1,1,1231),(12443,1,1,1232),(12446,1,1,1233),(12449,1,1,1234),(12452,1,1,1235),(12455,1,1,1236),(12459,1,1,1237),(1736,1,1,1251),(12409,1,1,1321),(12326,1,1,1421),(8190,1,1,1791),(8187,1,1,1792),(8191,1,1,1793),(12264,1,1,2401),(12260,1,1,2402),(12266,1,1,2403),(12280,1,1,2411),(12276,1,1,2412),(12282,1,1,2413),(12286,1,1,2414),(1618,1,1,2500),(12370,1,1,2501),(12367,1,1,2503),(12371,1,1,2515),(9610,1,1,5001),(9611,1,1,5002),(12490,1,1,20001),(12468,1,1,20002),(12474,1,1,20003),(12480,1,1,20004),(12486,1,1,20005),(12492,1,1,20006),(12302,1,1,23001),(12295,1,1,23002),(12299,1,1,23003),(12303,1,1,23004),(7701,1,1,50101),(4984,1,1,50401),(4983,1,1,50402),(4985,1,1,50403),(4987,1,1,50411),(4988,1,1,50412),(4989,1,1,50415),(12498,1,1,55001),(12499,1,1,55002),(3564,1,1,100700),(3565,1,1,100701),(9596,1,1,101051),(9598,1,1,101052),(9600,1,1,101053),(9604,1,1,101060),(9605,1,1,101061),(7177,1,1,101201),(7178,1,1,101202),(10353,1,1,101250),(10355,1,1,101251),(8980,1,1,101261),(8981,1,1,101262),(7616,1,1,101331),(10030,1,1,101701),(10031,1,1,101702),(3582,1,1,102000),(3583,1,1,102001),(9819,1,1,400051),(9823,1,1,400052),(9827,1,1,400053),(9831,1,1,400055),(132,1,2,11),(133,1,2,12),(134,1,2,13),(135,1,2,14),(136,1,2,16),(137,1,2,19),(138,1,2,21),(139,1,2,22),(140,1,2,24),(141,1,2,25),(142,1,2,26),(143,1,2,27),(10359,1,2,31),(145,1,2,32),(10361,1,2,34),(146,1,2,36),(147,1,2,41),(148,1,2,42),(149,1,2,44),(150,1,2,61),(151,1,2,62),(152,1,2,64),(153,1,2,71),(154,1,2,72),(155,1,2,74),(156,1,2,75),(157,1,2,78),(158,1,2,79),(159,1,2,81),(160,1,2,82),(161,1,2,84),(162,1,2,86),(163,1,2,87),(164,1,2,88),(165,1,2,89),(166,1,2,91),(167,1,2,92),(168,1,2,93),(2475,1,2,95),(2476,1,2,96),(2477,1,2,97),(2478,1,2,98),(169,1,2,101),(170,1,2,102),(171,1,2,104),(172,1,2,109),(173,1,2,111),(174,1,2,112),(175,1,2,113),(176,1,2,114),(177,1,2,116),(178,1,2,117),(179,1,2,121),(180,1,2,122),(181,1,2,125),(182,1,2,141),(183,1,2,142),(184,1,2,144),(2479,1,2,151),(2480,1,2,152),(2481,1,2,153),(2482,1,2,154),(185,1,2,161),(186,1,2,162),(187,1,2,163),(188,1,2,164),(189,1,2,165),(190,1,2,170),(2471,1,2,171),(192,1,2,172),(2472,1,2,173),(193,1,2,221),(194,1,2,222),(195,1,2,229),(196,1,2,241),(197,1,2,242),(198,1,2,243),(199,1,2,251),(201,1,2,262),(202,1,2,281),(203,1,2,282),(204,1,2,283),(205,1,2,331),(15072,1,2,510),(2483,1,2,531),(207,1,2,532),(2484,1,2,534),(208,1,2,536),(2473,1,2,700),(210,1,2,701),(211,1,2,702),(2474,1,2,703),(15064,1,2,771),(15057,1,2,772),(15059,1,2,773),(15061,1,2,774),(15063,1,2,775),(15065,1,2,776),(212,1,2,1001),(213,1,2,1002),(214,1,2,1003),(215,1,2,1004),(216,1,2,1005),(217,1,2,1101),(218,1,2,1102),(219,1,2,1104),(220,1,2,1109),(15073,1,2,1121),(15074,1,2,1122),(15075,1,2,1123),(15076,1,2,1124),(15077,1,2,1125),(15078,1,2,1126),(221,1,2,1181),(222,1,2,1182),(223,1,2,1183),(224,1,2,1184),(225,1,2,1185),(226,1,2,1186),(227,1,2,1187),(228,1,2,1188),(229,1,2,1201),(230,1,2,1202),(231,1,2,1231),(232,1,2,1232),(233,1,2,1233),(234,1,2,1234),(235,1,2,1421),(236,1,2,2401),(237,1,2,2402),(238,1,2,2403),(239,1,2,2411),(240,1,2,2412),(241,1,2,2413),(242,1,2,2500),(2470,1,2,2501),(243,1,2,2515),(10363,1,2,20001),(10364,1,2,20002),(10365,1,2,20003),(10366,1,2,20004),(10367,1,2,20005),(10368,1,2,20006),(15054,1,2,23001),(10362,1,2,50101),(15067,1,2,55001),(15066,1,2,59001),(15068,1,2,63001),(15069,1,2,63002),(15070,1,2,63003),(15071,1,2,63004),(10372,1,2,101250),(1807,1,3,11),(1808,1,3,31),(1809,1,3,36),(1810,1,3,41),(1811,1,3,61),(1812,1,3,71),(1813,1,3,72),(1814,1,3,74),(1815,1,3,75),(1816,1,3,78),(1817,1,3,79),(1818,1,3,91),(1819,1,3,95),(1820,1,3,97),(1821,1,3,111),(1822,1,3,121),(1823,1,3,122),(1824,1,3,125),(1825,1,3,161),(1826,1,3,170),(1827,1,3,171),(1828,1,3,172),(1829,1,3,221),(1830,1,3,222),(1831,1,3,229),(1832,1,3,241),(1833,1,3,242),(1834,1,3,243),(1835,1,3,251),(1836,1,3,255),(1837,1,3,256),(1838,1,3,262),(1839,1,3,281),(1840,1,3,282),(1841,1,3,283),(1842,1,3,331),(1843,1,3,531),(1844,1,3,536),(1845,1,3,700),(1846,1,3,1001),(1847,1,3,1002),(1848,1,3,1003),(1849,1,3,1004),(1850,1,3,1005),(1851,1,3,1181),(1852,1,3,1182),(1853,1,3,1201),(1854,1,3,1202),(1855,1,3,1231),(1856,1,3,2401),(1857,1,3,2402),(1858,1,3,2403),(1859,1,3,2411),(1860,1,3,2412),(1861,1,3,2413),(1862,1,3,2500),(1863,1,3,2515),(8026,1,4,11),(8027,1,4,21),(8028,1,4,31),(8029,1,4,41),(8030,1,4,61),(8031,1,4,71),(8032,1,4,72),(8033,1,4,74),(8034,1,4,75),(8035,1,4,78),(8036,1,4,79),(8037,1,4,81),(8038,1,4,91),(8039,1,4,95),(8040,1,4,97),(8041,1,4,101),(8042,1,4,111),(8043,1,4,121),(8044,1,4,151),(8045,1,4,161),(8046,1,4,171),(8047,1,4,221),(8048,1,4,222),(8049,1,4,229),(8050,1,4,241),(8051,1,4,242),(8052,1,4,243),(8146,1,4,251),(8147,1,4,253),(8053,1,4,262),(8054,1,4,281),(8055,1,4,331),(8056,1,4,341),(8057,1,4,342),(8058,1,4,343),(8059,1,4,344),(8060,1,4,531),(8061,1,4,700),(8062,1,4,1001),(8063,1,4,1002),(8064,1,4,1003),(8065,1,4,1004),(8066,1,4,1005),(8067,1,4,1101),(8068,1,4,1181),(8069,1,4,1182),(8070,1,4,1201),(8071,1,4,1202),(8072,1,4,1231),(8073,1,4,2401),(8074,1,4,2501),(8075,1,4,2503),(8076,1,4,2515),(8077,1,4,20001),(8078,1,4,50101),(8079,1,4,101201),(8080,1,4,101261),(8081,1,4,102000),(8082,1,4,400051),(8083,1,4,400052),(8084,1,4,400053),(8085,1,4,400055),(12608,1,10,11),(12609,1,10,21),(12610,1,10,31),(12611,1,10,41),(12612,1,10,61),(12613,1,10,71),(12614,1,10,72),(12615,1,10,74),(12616,1,10,75),(12617,1,10,78),(12618,1,10,79),(12619,1,10,81),(12620,1,10,91),(12621,1,10,95),(12622,1,10,97),(12623,1,10,101),(12624,1,10,111),(12625,1,10,121),(12626,1,10,151),(12627,1,10,161),(12628,1,10,171),(12629,1,10,221),(12630,1,10,222),(12631,1,10,229),(12632,1,10,241),(12633,1,10,242),(12634,1,10,243),(12635,1,10,262),(12636,1,10,281),(12637,1,10,300),(12638,1,10,331),(12639,1,10,341),(12640,1,10,342),(12641,1,10,343),(12642,1,10,344),(12643,1,10,531),(12644,1,10,700),(12645,1,10,1001),(12646,1,10,1002),(12647,1,10,1003),(12648,1,10,1004),(12649,1,10,1005),(12650,1,10,1101),(12651,1,10,1181),(12652,1,10,1182),(12653,1,10,1201),(12654,1,10,1202),(12655,1,10,1231),(12656,1,10,2401),(12657,1,10,2501),(12658,1,10,2503),(12659,1,10,2515),(12660,1,10,20001),(12661,1,10,20002),(12662,1,10,23001),(12663,1,10,50101),(12664,1,11,11),(12665,1,11,21),(12666,1,11,31),(12667,1,11,41),(12668,1,11,61),(12669,1,11,71),(12670,1,11,72),(12671,1,11,74),(12672,1,11,75),(12673,1,11,78),(12674,1,11,79),(12675,1,11,81),(12676,1,11,91),(12677,1,11,95),(12678,1,11,97),(12679,1,11,101),(12680,1,11,111),(12681,1,11,121),(12682,1,11,151),(12683,1,11,161),(12684,1,11,171),(12685,1,11,221),(12686,1,11,222),(12687,1,11,229),(12688,1,11,241),(12689,1,11,242),(12690,1,11,243),(12691,1,11,262),(12692,1,11,281),(12693,1,11,300),(12694,1,11,331),(12695,1,11,341),(12696,1,11,342),(12697,1,11,343),(12698,1,11,344),(12699,1,11,531),(12700,1,11,700),(12701,1,11,1001),(12702,1,11,1002),(12703,1,11,1003),(12704,1,11,1004),(12705,1,11,1005),(12706,1,11,1101),(12707,1,11,1181),(12708,1,11,1182),(12709,1,11,1201),(12710,1,11,1202),(12711,1,11,1231),(12712,1,11,2401),(12713,1,11,2501),(12714,1,11,2503),(12715,1,11,2515),(12716,1,11,20001),(12717,1,11,20002),(12718,1,11,23001),(12719,1,11,50101),(15569,1,12,11),(15559,1,12,12),(15561,1,12,13),(15563,1,12,14),(15565,1,12,15),(15568,1,12,16),(15571,1,12,19),(14146,1,12,21),(14135,1,12,22),(14137,1,12,24),(14139,1,12,25),(14142,1,12,26),(14145,1,12,27),(14148,1,12,28),(14930,1,12,31),(14926,1,12,32),(14929,1,12,34),(14932,1,12,38),(13816,1,12,41),(13813,1,12,42),(13815,1,12,44),(13817,1,12,45),(14094,1,12,61),(14091,1,12,62),(14093,1,12,64),(14095,1,12,67),(14096,1,12,68),(13891,1,12,71),(13886,1,12,72),(13888,1,12,74),(13892,1,12,75),(13890,1,12,76),(13894,1,12,78),(13895,1,12,79),(15539,1,12,81),(15533,1,12,82),(15534,1,12,84),(15535,1,12,86),(15537,1,12,87),(15538,1,12,88),(15540,1,12,89),(15401,1,12,91),(15397,1,12,92),(15400,1,12,93),(15403,1,12,94),(13990,1,12,95),(12734,1,12,97),(14939,1,12,101),(14935,1,12,102),(14936,1,12,104),(14937,1,12,105),(14938,1,12,106),(14940,1,12,109),(15390,1,12,111),(15377,1,12,112),(15380,1,12,113),(15383,1,12,114),(15386,1,12,115),(15389,1,12,116),(15392,1,12,117),(15628,1,12,121),(15624,1,12,122),(15627,1,12,125),(15630,1,12,126),(13821,1,12,141),(13820,1,12,142),(13822,1,12,144),(13912,1,12,151),(13909,1,12,152),(13911,1,12,153),(13913,1,12,154),(14063,1,12,161),(14056,1,12,162),(14058,1,12,163),(14060,1,12,164),(14062,1,12,165),(14064,1,12,167),(13350,1,12,171),(13345,1,12,172),(13347,1,12,173),(13349,1,12,174),(13351,1,12,178),(13838,1,12,221),(13834,1,12,222),(13837,1,12,223),(13840,1,12,229),(13842,1,12,237),(13844,1,12,238),(13846,1,12,239),(13516,1,12,241),(13515,1,12,242),(13517,1,12,243),(15671,1,12,251),(15652,1,12,252),(15654,1,12,253),(15655,1,12,254),(15657,1,12,255),(15659,1,12,256),(15632,1,12,262),(15641,1,12,281),(15637,1,12,282),(15640,1,12,283),(15643,1,12,286),(15522,1,12,300),(15523,1,12,301),(14126,1,12,331),(14125,1,12,332),(14127,1,12,333),(15660,1,12,341),(15661,1,12,342),(15662,1,12,343),(15663,1,12,344),(15669,1,12,351),(15666,1,12,352),(15668,1,12,353),(15670,1,12,354),(15672,1,12,358),(13865,1,12,510),(13862,1,12,512),(13864,1,12,514),(13866,1,12,517),(15291,1,12,520),(15286,1,12,522),(15288,1,12,524),(15290,1,12,525),(15292,1,12,527),(15649,1,12,531),(15646,1,12,532),(15648,1,12,534),(15650,1,12,538),(13358,1,12,700),(15547,1,12,701),(15546,1,12,702),(15549,1,12,703),(15090,1,12,771),(15081,1,12,772),(15083,1,12,773),(15085,1,12,774),(15087,1,12,775),(15089,1,12,776),(15091,1,12,779),(14917,1,12,1001),(14916,1,12,1002),(14918,1,12,1003),(14920,1,12,1004),(14921,1,12,1005),(14945,1,12,1101),(14943,1,12,1102),(14944,1,12,1104),(14946,1,12,1109),(14762,1,12,1121),(14755,1,12,1122),(14757,1,12,1123),(14759,1,12,1124),(14761,1,12,1125),(14763,1,12,1126),(15575,1,12,1181),(15598,1,12,1182),(15578,1,12,1183),(15579,1,12,1184),(15581,1,12,1185),(15583,1,12,1186),(15585,1,12,1187),(15588,1,12,1188),(15586,1,12,1189),(13827,1,12,1201),(13828,1,12,1202),(15596,1,12,1231),(15591,1,12,1232),(15592,1,12,1233),(15594,1,12,1234),(15595,1,12,1235),(15597,1,12,1236),(15599,1,12,1237),(13829,1,12,1251),(15573,1,12,1321),(15574,1,12,1322),(15541,1,12,1421),(15510,1,12,2401),(15509,1,12,2402),(15512,1,12,2403),(15518,1,12,2411),(15517,1,12,2412),(15520,1,12,2413),(15521,1,12,2414),(15553,1,12,2501),(15552,1,12,2503),(15554,1,12,2515),(15435,1,12,5001),(15436,1,12,5002),(15614,1,12,20001),(15604,1,12,20002),(15607,1,12,20003),(15610,1,12,20004),(15613,1,12,20005),(15616,1,12,20006),(15529,1,12,23001),(15526,1,12,23002),(15528,1,12,23003),(15530,1,12,23004),(13712,1,12,50101),(15499,1,12,50401),(15501,1,12,50411),(15502,1,12,50412),(15503,1,12,50420),(15504,1,12,50430),(15498,1,12,50440),(15618,1,12,55001),(15619,1,12,55002),(14128,1,12,59001),(14129,1,12,59002),(14130,1,12,59003),(14818,1,12,63001),(14815,1,12,63002),(14817,1,12,63003),(14819,1,12,63004),(15241,1,12,64001),(15438,1,12,101701),(15439,1,12,101702),(12776,1,13,11),(12777,1,13,21),(12778,1,13,31),(12779,1,13,41),(12780,1,13,61),(12781,1,13,71),(12782,1,13,72),(12783,1,13,74),(12784,1,13,75),(12785,1,13,78),(12786,1,13,79),(12787,1,13,81),(12788,1,13,91),(12789,1,13,95),(12790,1,13,97),(12791,1,13,101),(12792,1,13,111),(12793,1,13,121),(12794,1,13,151),(12795,1,13,161),(12796,1,13,171),(12797,1,13,221),(12798,1,13,222),(12799,1,13,229),(12800,1,13,241),(12801,1,13,242),(12802,1,13,243),(12803,1,13,262),(12804,1,13,281),(12805,1,13,300),(12806,1,13,331),(12807,1,13,341),(12808,1,13,342),(12809,1,13,343),(12810,1,13,344),(12811,1,13,531),(12812,1,13,700),(12813,1,13,1001),(12814,1,13,1002),(12815,1,13,1003),(12816,1,13,1004),(12817,1,13,1005),(12818,1,13,1101),(12819,1,13,1181),(12820,1,13,1182),(12821,1,13,1201),(12822,1,13,1202),(12823,1,13,1231),(12824,1,13,2401),(12825,1,13,2501),(12826,1,13,2503),(12827,1,13,2515),(12828,1,13,20001),(12829,1,13,20002),(12830,1,13,23001),(12831,1,13,50101),(12832,1,14,11),(12833,1,14,21),(12834,1,14,31),(12835,1,14,41),(12836,1,14,61),(12837,1,14,71),(12838,1,14,72),(12839,1,14,74),(12840,1,14,75),(12841,1,14,78),(12842,1,14,79),(12843,1,14,81),(12844,1,14,91),(12845,1,14,95),(12846,1,14,97),(12847,1,14,101),(12848,1,14,111),(12849,1,14,121),(12850,1,14,151),(12851,1,14,161),(12852,1,14,171),(12853,1,14,221),(12854,1,14,222),(12855,1,14,229),(12856,1,14,241),(12857,1,14,242),(12858,1,14,243),(12859,1,14,262),(12860,1,14,281),(12861,1,14,300),(12862,1,14,331),(12863,1,14,341),(12864,1,14,342),(12865,1,14,343),(12866,1,14,344),(12867,1,14,531),(12868,1,14,700),(12869,1,14,1001),(12870,1,14,1002),(12871,1,14,1003),(12872,1,14,1004),(12873,1,14,1005),(12874,1,14,1101),(12875,1,14,1181),(12876,1,14,1182),(12877,1,14,1201),(12878,1,14,1202),(12879,1,14,1231),(12880,1,14,2401),(12881,1,14,2501),(12882,1,14,2503),(12883,1,14,2515),(12884,1,14,20001),(12885,1,14,20002),(12886,1,14,23001),(12887,1,14,50101),(12944,1,16,11),(12945,1,16,21),(12946,1,16,31),(13056,1,16,41),(13057,1,16,42),(13058,1,16,44),(13059,1,16,45),(12948,1,16,61),(12949,1,16,71),(12950,1,16,72),(12951,1,16,74),(12952,1,16,75),(12953,1,16,78),(12954,1,16,79),(12955,1,16,81),(12956,1,16,91),(12957,1,16,95),(12958,1,16,97),(12959,1,16,101),(12960,1,16,111),(12961,1,16,121),(13060,1,16,141),(13061,1,16,142),(13062,1,16,144),(12962,1,16,151),(12963,1,16,161),(12964,1,16,171),(12965,1,16,221),(12966,1,16,222),(12967,1,16,229),(12968,1,16,241),(12969,1,16,242),(12970,1,16,243),(13128,1,16,251),(13064,1,16,262),(12972,1,16,281),(12973,1,16,300),(12974,1,16,331),(12975,1,16,341),(12976,1,16,342),(12977,1,16,343),(12978,1,16,344),(12979,1,16,531),(12980,1,16,700),(12981,1,16,1001),(12982,1,16,1002),(12983,1,16,1003),(12984,1,16,1004),(12985,1,16,1005),(12986,1,16,1101),(12987,1,16,1181),(12988,1,16,1182),(12989,1,16,1201),(12990,1,16,1202),(12991,1,16,1231),(12992,1,16,2401),(12993,1,16,2501),(12994,1,16,2503),(12995,1,16,2515),(12996,1,16,20001),(12997,1,16,20002),(12998,1,16,23001),(12999,1,16,50101),(13000,1,17,11),(13001,1,17,21),(13002,1,17,31),(13065,1,17,41),(13066,1,17,42),(13067,1,17,44),(13068,1,17,45),(13004,1,17,61),(13005,1,17,71),(13006,1,17,72),(13007,1,17,74),(13008,1,17,75),(13009,1,17,78),(13010,1,17,79),(13011,1,17,81),(13012,1,17,91),(13013,1,17,95),(13014,1,17,97),(13015,1,17,101),(13016,1,17,111),(13017,1,17,121),(13069,1,17,141),(13070,1,17,142),(13071,1,17,144),(13018,1,17,151),(13019,1,17,161),(13020,1,17,171),(13021,1,17,221),(13022,1,17,222),(13023,1,17,229),(13024,1,17,241),(13025,1,17,242),(13026,1,17,243),(13028,1,17,281),(13029,1,17,300),(13030,1,17,331),(13031,1,17,341),(13032,1,17,342),(13033,1,17,343),(13034,1,17,344),(13035,1,17,531),(13036,1,17,700),(13037,1,17,1001),(13038,1,17,1002),(13039,1,17,1003),(13040,1,17,1004),(13041,1,17,1005),(13042,1,17,1101),(13043,1,17,1181),(13044,1,17,1182),(13045,1,17,1201),(13046,1,17,1202),(13047,1,17,1231),(13048,1,17,2401),(13049,1,17,2501),(13050,1,17,2503),(13051,1,17,2515),(13052,1,17,20001),(13053,1,17,20002),(13054,1,17,23001),(13055,1,17,50101),(14504,1,18,11),(14505,1,18,21),(14506,1,18,31),(14507,1,18,41),(14508,1,18,61),(14509,1,18,71),(14510,1,18,78),(14511,1,18,81),(14512,1,18,91),(14513,1,18,95),(14514,1,18,101),(14515,1,18,111),(14516,1,18,121),(14517,1,18,151),(14518,1,18,161),(14519,1,18,221),(14520,1,18,241),(14521,1,18,262),(14522,1,18,281),(14523,1,18,300),(14524,1,18,331),(14525,1,18,332),(14526,1,18,333),(14527,1,18,341),(14528,1,18,342),(14529,1,18,343),(14530,1,18,344),(14531,1,18,531),(14532,1,18,701),(14533,1,18,771),(14534,1,18,774),(14535,1,18,1001),(14536,1,18,1004),(14537,1,18,1101),(14538,1,18,1181),(14539,1,18,1182),(14540,1,18,1201),(14541,1,18,1231),(14542,1,18,2401),(14543,1,18,2501),(14544,1,18,2503),(14545,1,18,2515),(14546,1,18,20001),(14547,1,18,20002),(14548,1,18,50101),(14549,1,18,59001),(15242,1,19,21),(15243,1,19,31),(15244,1,19,41),(15245,1,19,61),(15246,1,19,71),(15247,1,19,78),(15248,1,19,81),(15249,1,19,101),(15250,1,19,121),(15251,1,19,151),(15252,1,19,161),(15253,1,19,221),(15254,1,19,241),(15255,1,19,262),(15256,1,19,281),(15257,1,19,300),(15258,1,19,331),(15259,1,19,332),(15260,1,19,341),(15261,1,19,342),(15262,1,19,343),(15263,1,19,344),(15264,1,19,531),(15265,1,19,701),(15266,1,19,771),(15267,1,19,774),(15268,1,19,777),(15269,1,19,1001),(15270,1,19,1004),(15271,1,19,1101),(15272,1,19,1121),(15273,1,19,1181),(15274,1,19,1182),(15275,1,19,1201),(15276,1,19,1231),(15277,1,19,2401),(15278,1,19,2501),(15279,1,19,20001),(15280,1,19,20002),(15281,1,19,50101),(15282,1,19,59001),(15283,1,19,63001); +/*!40000 ALTER TABLE `llx_user_rights` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup` +-- + +DROP TABLE IF EXISTS `llx_usergroup`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `nom` varchar(255) NOT NULL, + `entity` int(11) NOT NULL DEFAULT '1', + `datec` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `note` text, + `model_pdf` varchar(255) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_name` (`nom`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup` +-- + +LOCK TABLES `llx_usergroup` WRITE; +/*!40000 ALTER TABLE `llx_usergroup` DISABLE KEYS */; +INSERT INTO `llx_usergroup` VALUES (1,'Sale representatives',1,'2013-01-16 20:48:08','2015-10-03 09:44:44','All sales representative users',NULL),(2,'Management',1,'2015-10-03 11:46:25','2015-10-03 09:46:25','',NULL),(3,'Scientists',1,'2015-10-03 11:46:46','2015-10-03 09:46:46','',NULL),(4,'Commercial',1,'2015-10-05 21:30:13','2015-10-05 19:30:13','',NULL); +/*!40000 ALTER TABLE `llx_usergroup` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_extrafields` +-- + +DROP TABLE IF EXISTS `llx_usergroup_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) DEFAULT NULL, + PRIMARY KEY (`rowid`), + KEY `idx_usergroup_extrafields` (`fk_object`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_extrafields` +-- + +LOCK TABLES `llx_usergroup_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_usergroup_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_rights` +-- + +DROP TABLE IF EXISTS `llx_usergroup_rights`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_rights` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_usergroup` int(11) NOT NULL, + `fk_id` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_rights` (`entity`,`fk_usergroup`,`fk_id`), + KEY `fk_usergroup_rights_fk_usergroup` (`fk_usergroup`), + CONSTRAINT `fk_usergroup_rights_fk_usergroup` FOREIGN KEY (`fk_usergroup`) REFERENCES `llx_usergroup` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=200 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_rights` +-- + +LOCK TABLES `llx_usergroup_rights` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_rights` DISABLE KEYS */; +INSERT INTO `llx_usergroup_rights` VALUES (1,1,1,2401),(2,1,1,2402),(3,1,1,2403),(4,1,1,2411),(5,1,1,2412),(6,1,1,2413),(78,1,2,11),(79,1,2,12),(80,1,2,13),(81,1,2,14),(82,1,2,15),(83,1,2,16),(84,1,2,19),(144,1,2,21),(145,1,2,22),(146,1,2,24),(147,1,2,25),(148,1,2,26),(149,1,2,27),(150,1,2,28),(133,1,2,31),(134,1,2,32),(135,1,2,34),(136,1,2,38),(137,1,2,41),(138,1,2,42),(139,1,2,44),(140,1,2,45),(86,1,2,61),(87,1,2,62),(88,1,2,64),(89,1,2,67),(90,1,2,68),(7,1,2,71),(8,1,2,72),(9,1,2,74),(10,1,2,75),(11,1,2,76),(12,1,2,78),(13,1,2,79),(32,1,2,81),(33,1,2,82),(34,1,2,84),(35,1,2,86),(36,1,2,87),(37,1,2,88),(38,1,2,89),(173,1,2,91),(174,1,2,92),(175,1,2,93),(176,1,2,94),(40,1,2,95),(41,1,2,96),(42,1,2,97),(43,1,2,98),(66,1,2,101),(67,1,2,102),(68,1,2,104),(69,1,2,105),(70,1,2,106),(71,1,2,109),(21,1,2,111),(22,1,2,112),(23,1,2,113),(24,1,2,114),(25,1,2,115),(26,1,2,116),(27,1,2,117),(164,1,2,121),(165,1,2,122),(166,1,2,125),(167,1,2,126),(141,1,2,141),(142,1,2,142),(143,1,2,144),(129,1,2,151),(130,1,2,152),(131,1,2,153),(132,1,2,154),(44,1,2,161),(45,1,2,162),(46,1,2,163),(47,1,2,164),(48,1,2,165),(49,1,2,167),(54,1,2,171),(55,1,2,172),(56,1,2,173),(57,1,2,174),(58,1,2,178),(120,1,2,221),(121,1,2,222),(122,1,2,223),(123,1,2,229),(124,1,2,237),(125,1,2,238),(126,1,2,239),(29,1,2,241),(30,1,2,242),(31,1,2,243),(182,1,2,251),(183,1,2,252),(184,1,2,253),(185,1,2,254),(186,1,2,255),(187,1,2,256),(168,1,2,262),(169,1,2,281),(170,1,2,282),(171,1,2,283),(172,1,2,286),(197,1,2,331),(198,1,2,332),(199,1,2,333),(188,1,2,341),(189,1,2,342),(190,1,2,343),(191,1,2,344),(192,1,2,351),(193,1,2,352),(194,1,2,353),(195,1,2,354),(196,1,2,358),(151,1,2,531),(152,1,2,532),(153,1,2,534),(154,1,2,538),(59,1,2,700),(60,1,2,701),(61,1,2,702),(62,1,2,703),(177,1,2,1001),(178,1,2,1002),(179,1,2,1003),(180,1,2,1004),(181,1,2,1005),(72,1,2,1101),(73,1,2,1102),(74,1,2,1104),(75,1,2,1109),(91,1,2,1181),(92,1,2,1182),(93,1,2,1183),(94,1,2,1184),(95,1,2,1185),(96,1,2,1186),(97,1,2,1187),(98,1,2,1188),(99,1,2,1189),(76,1,2,1201),(77,1,2,1202),(100,1,2,1231),(101,1,2,1232),(102,1,2,1233),(103,1,2,1234),(104,1,2,1235),(105,1,2,1236),(106,1,2,1237),(113,1,2,1251),(85,1,2,1321),(39,1,2,1421),(14,1,2,2401),(15,1,2,2402),(16,1,2,2403),(17,1,2,2411),(18,1,2,2412),(19,1,2,2413),(20,1,2,2414),(63,1,2,2501),(64,1,2,2503),(65,1,2,2515),(114,1,2,20001),(115,1,2,20002),(116,1,2,20003),(117,1,2,20004),(118,1,2,20005),(119,1,2,20006),(50,1,2,23001),(51,1,2,23002),(52,1,2,23003),(53,1,2,23004),(28,1,2,50101),(127,1,2,55001),(128,1,2,55002); +/*!40000 ALTER TABLE `llx_usergroup_rights` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_usergroup_user` +-- + +DROP TABLE IF EXISTS `llx_usergroup_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_usergroup_user` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT '1', + `fk_user` int(11) NOT NULL, + `fk_usergroup` int(11) NOT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_usergroup_user` (`entity`,`fk_user`,`fk_usergroup`), + KEY `fk_usergroup_user_fk_user` (`fk_user`), + KEY `fk_usergroup_user_fk_usergroup` (`fk_usergroup`), + CONSTRAINT `fk_usergroup_user_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_usergroup_user_fk_usergroup` FOREIGN KEY (`fk_usergroup`) REFERENCES `llx_usergroup` (`rowid`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_usergroup_user` +-- + +LOCK TABLES `llx_usergroup_user` WRITE; +/*!40000 ALTER TABLE `llx_usergroup_user` DISABLE KEYS */; +INSERT INTO `llx_usergroup_user` VALUES (2,1,1,3),(12,1,2,4),(3,1,3,3),(4,1,11,2),(13,1,12,1),(5,1,13,4),(6,1,16,1),(7,1,17,1),(11,1,18,1),(8,1,18,2),(9,1,18,3),(10,1,18,4); +/*!40000 ALTER TABLE `llx_usergroup_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_website` +-- + +DROP TABLE IF EXISTS `llx_website`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_website` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) DEFAULT '1', + `ref` varchar(24) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `fk_default_home` int(11) DEFAULT NULL, + `virtualhost` varchar(255) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_modification` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `fk_user_create` int(11) DEFAULT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_website_ref` (`ref`,`entity`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_website` +-- + +LOCK TABLES `llx_website` WRITE; +/*!40000 ALTER TABLE `llx_website` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_website` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_website_page` +-- + +DROP TABLE IF EXISTS `llx_website_page`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_website_page` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `fk_website` int(11) NOT NULL, + `pageurl` varchar(16) NOT NULL, + `title` varchar(255) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `keywords` varchar(255) DEFAULT NULL, + `content` mediumtext, + `status` int(11) DEFAULT NULL, + `date_creation` datetime DEFAULT NULL, + `date_modification` datetime DEFAULT NULL, + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_website_page_url` (`fk_website`,`pageurl`), + CONSTRAINT `fk_website_page_website` FOREIGN KEY (`fk_website`) REFERENCES `llx_website` (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_website_page` +-- + +LOCK TABLES `llx_website_page` WRITE; +/*!40000 ALTER TABLE `llx_website_page` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_website_page` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2017-08-27 15:46:40 diff --git a/dev/initdemo/savedemo.sh b/dev/initdemo/savedemo.sh index fe9cba72c43..fd3f8caafd5 100755 --- a/dev/initdemo/savedemo.sh +++ b/dev/initdemo/savedemo.sh @@ -192,6 +192,7 @@ export list=" --ignore-table=$base.llx_cabinetmed_c_ccam --ignore-table=$base.llx_cabinetmed_c_examconclusion --ignore-table=$base.llx_cabinetmed_cons + --ignore-table=$base.llx_cabinetmed_cons_extrafields --ignore-table=$base.llx_cabinetmed_diaglec --ignore-table=$base.llx_cabinetmed_examaut --ignore-table=$base.llx_cabinetmed_exambio @@ -207,7 +208,18 @@ export list=" --ignore-table=$base.llx_dolicloud_customers --ignore-table=$base.llx_dolicloud_stats --ignore-table=$base.llx_dolicloud_emailstemplates + --ignore-table=$base.llx_dolireport_column + --ignore-table=$base.llx_dolireport_criteria + --ignore-table=$base.llx_dolireport_graph + --ignore-table=$base.llx_dolireport_plot + --ignore-table=$base.llx_dolireport_report --ignore-table=$base.llx_domain + --ignore-table=$base.llx_ecommerce_commande + --ignore-table=$base.llx_ecommerce_facture + --ignore-table=$base.llx_ecommerce_product + --ignore-table=$base.llx_ecommerce_site + --ignore-table=$base.llx_ecommerce_societe + --ignore-table=$base.llx_ecommerce_socpeople --ignore-table=$base.llx_element_rang --ignore-table=$base.llx_entity --ignore-table=$base.llx_filemanager_roots @@ -215,6 +227,8 @@ export list=" --ignore-table=$base.llx_google_maps --ignore-table=$base.llx_milestone --ignore-table=$base.llx_monitoring_probes + --ignore-table=$base.llx_m + --ignore-table=$base.llx_m_extrafields --ignore-table=$base.llx_notes --ignore-table=$base.llx_pos_cash --ignore-table=$base.llx_pos_control_cash From 52a20731521751bb0d8c812e97d5cb0854be36e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 15:51:44 +0200 Subject: [PATCH 0176/1137] Add demo file for 6.0 --- dev/initdemo/mysqldump_dolibarr_6.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/initdemo/mysqldump_dolibarr_6.0.0.sql b/dev/initdemo/mysqldump_dolibarr_6.0.0.sql index 0d1c6352a27..3e75108bc89 100644 --- a/dev/initdemo/mysqldump_dolibarr_6.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_6.0.0.sql @@ -314,7 +314,7 @@ CREATE TABLE `llx_actioncomm` ( LOCK TABLES `llx_actioncomm` WRITE; /*!40000 ALTER TABLE `llx_actioncomm` DISABLE KEYS */; -INSERT INTO `llx_actioncomm` VALUES (1,NULL,1,'2010-07-08 14:21:44','2010-07-08 14:21:44',50,NULL,'Company AAA and Co added into Dolibarr','2010-07-08 14:21:44','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company AAA and Co added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,NULL,1,'2010-07-08 14:23:48','2010-07-08 14:23:48',50,NULL,'Company Belin SARL added into Dolibarr','2010-07-08 14:23:48','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Belin SARL added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,NULL,1,'2010-07-08 22:42:12','2010-07-08 22:42:12',50,NULL,'Company Spanish Comp added into Dolibarr','2010-07-08 22:42:12','2014-12-21 12:50:33',1,NULL,NULL,3,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Spanish Comp added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,NULL,1,'2010-07-08 22:48:18','2010-07-08 22:48:18',50,NULL,'Company Prospector Vaalen added into Dolibarr','2010-07-08 22:48:18','2014-12-21 12:50:33',1,NULL,NULL,4,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Prospector Vaalen added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,NULL,1,'2010-07-08 23:22:57','2010-07-08 23:22:57',50,NULL,'Company NoCountry Co added into Dolibarr','2010-07-08 23:22:57','2014-12-21 12:50:33',1,NULL,NULL,5,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company NoCountry Co added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,NULL,1,'2010-07-09 00:15:09','2010-07-09 00:15:09',50,NULL,'Company Swiss customer added into Dolibarr','2010-07-09 00:15:09','2014-12-21 12:50:33',1,NULL,NULL,6,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Swiss customer added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,NULL,1,'2010-07-09 01:24:26','2010-07-09 01:24:26',50,NULL,'Company Generic customer added into Dolibarr','2010-07-09 01:24:26','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Generic customer added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,NULL,1,'2010-07-10 14:54:27','2010-07-10 14:54:27',50,NULL,'Société Client salon ajoutée dans Dolibarr','2010-07-10 14:54:27','2014-12-21 12:50:33',1,NULL,NULL,8,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,NULL,1,'2010-07-10 14:54:44','2010-07-10 14:54:44',50,NULL,'Société Client salon invidivdu ajoutée dans Doliba','2010-07-10 14:54:44','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon invidivdu ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,NULL,1,'2010-07-10 14:56:10','2010-07-10 14:56:10',50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:56:10','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,NULL,1,'2010-07-10 14:58:53','2010-07-10 14:58:53',50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:58:53','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,NULL,1,'2010-07-10 15:00:55','2010-07-10 15:00:55',50,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr','2010-07-10 15:00:55','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,NULL,1,'2010-07-10 15:13:08','2010-07-10 15:13:08',50,NULL,'Société Smith Vick ajoutée dans Dolibarr','2010-07-10 15:13:08','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Smith Vick ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,NULL,1,'2010-07-10 15:21:00','2010-07-10 16:21:00',5,NULL,'RDV avec mon chef','2010-07-10 15:21:48','2010-07-10 13:21:48',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'',3600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,NULL,1,'2010-07-10 18:18:16','2010-07-10 18:18:16',50,NULL,'Contrat CONTRAT1 validé dans Dolibarr','2010-07-10 18:18:16','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Contrat CONTRAT1 validé dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,NULL,1,'2010-07-10 18:35:57','2010-07-10 18:35:57',50,NULL,'Société Mon client ajoutée dans Dolibarr','2010-07-10 18:35:57','2014-12-21 12:50:33',1,NULL,NULL,11,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Mon client ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,NULL,1,'2010-07-11 16:18:08','2010-07-11 16:18:08',50,NULL,'Société Dupont Alain ajoutée dans Dolibarr','2010-07-11 16:18:08','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Dupont Alain ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,NULL,1,'2010-07-11 17:11:00','2010-07-11 17:17:00',5,NULL,'Rendez-vous','2010-07-11 17:11:22','2010-07-11 15:11:22',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'gfgdfgdf',360,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,NULL,1,'2010-07-11 17:13:20','2010-07-11 17:13:20',50,NULL,'Société Vendeur de chips ajoutée dans Dolibarr','2010-07-11 17:13:20','2014-12-21 12:50:33',1,NULL,NULL,13,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Vendeur de chips ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,NULL,1,'2010-07-11 17:15:42','2010-07-11 17:15:42',50,NULL,'Commande CF1007-0001 validée','2010-07-11 17:15:42','2014-12-21 12:50:33',1,NULL,NULL,13,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0001 validée\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,NULL,1,'2010-07-11 18:47:33','2010-07-11 18:47:33',50,NULL,'Commande CF1007-0002 validée','2010-07-11 18:47:33','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0002 validée\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,NULL,1,'2010-07-18 11:36:18','2010-07-18 11:36:18',50,NULL,'Proposition PR1007-0003 validée','2010-07-18 11:36:18','2014-12-21 12:50:33',1,NULL,NULL,4,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Proposition PR1007-0003 validée\nAuteur: admin',3,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,NULL,1,'2011-07-18 20:49:58','2011-07-18 20:49:58',50,NULL,'Invoice FA1007-0002 validated in Dolibarr','2011-07-18 20:49:58','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 validated in Dolibarr\nAuthor: admin',2,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,NULL,1,'2011-07-28 01:37:00',NULL,1,NULL,'Phone call','2011-07-28 01:37:48','2011-07-27 23:37:48',1,NULL,NULL,NULL,2,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,NULL,1,'2011-08-01 02:31:24','2011-08-01 02:31:24',50,NULL,'Company mmm added into Dolibarr','2011-08-01 02:31:24','2014-12-21 12:50:33',1,NULL,NULL,15,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company mmm added into Dolibarr\nAuthor: admin',15,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,NULL,1,'2011-08-01 02:31:43','2011-08-01 02:31:43',50,NULL,'Company ppp added into Dolibarr','2011-08-01 02:31:43','2014-12-21 12:50:33',1,NULL,NULL,16,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ppp added into Dolibarr\nAuthor: admin',16,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,NULL,1,'2011-08-01 02:41:26','2011-08-01 02:41:26',50,NULL,'Company aaa added into Dolibarr','2011-08-01 02:41:26','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company aaa added into Dolibarr\nAuthor: admin',17,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 validated in Dolibarr\nAuthor: admin',5,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 changed to paid in Dolibarr\nAuthor: admin',5,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 validated in Dolibarr\nAuthor: admin',6,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 changed to paid in Dolibarr\nAuthor: admin',6,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,NULL,1,'2011-08-08 02:41:55','2011-08-08 02:41:55',50,NULL,'Invoice FA1108-0005 validated in Dolibarr','2011-08-08 02:41:55','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 validated in Dolibarr\nAuthor: admin',8,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(40,NULL,1,'2011-08-08 02:53:40','2011-08-08 02:53:40',50,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr','2011-08-08 02:53:40','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr\nAuthor: admin',8,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(41,NULL,1,'2011-08-08 02:54:05','2011-08-08 02:54:05',50,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr','2011-08-08 02:54:05','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr\nAuthor: admin',2,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(42,NULL,1,'2011-08-08 02:55:04','2011-08-08 02:55:04',50,NULL,'Invoice FA1107-0006 validated in Dolibarr','2011-08-08 02:55:04','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 validated in Dolibarr\nAuthor: admin',3,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(43,NULL,1,'2011-08-08 02:55:26','2011-08-08 02:55:26',50,NULL,'Invoice FA1108-0007 validated in Dolibarr','2011-08-08 02:55:26','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0007 validated in Dolibarr\nAuthor: admin',9,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(44,NULL,1,'2011-08-08 02:55:58','2011-08-08 02:55:58',50,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr','2011-08-08 02:55:58','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr\nAuthor: admin',3,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(45,NULL,1,'2011-08-08 03:04:22','2011-08-08 03:04:22',50,NULL,'Order CO1108-0001 validated','2011-08-08 03:04:22','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1108-0001 validated\nAuthor: admin',5,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(46,NULL,1,'2011-08-08 13:59:09','2011-08-08 13:59:09',50,NULL,'Order CO1107-0002 validated','2011-08-08 13:59:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1107-0002 validated\nAuthor: admin',1,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(47,NULL,1,'2011-08-08 14:24:18','2011-08-08 14:24:18',50,NULL,'Proposal PR1007-0001 validated','2011-08-08 14:24:18','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1007-0001 validated\nAuthor: admin',1,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(48,NULL,1,'2011-08-08 14:24:24','2011-08-08 14:24:24',50,NULL,'Proposal PR1108-0004 validated','2011-08-08 14:24:24','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1108-0004 validated\nAuthor: admin',4,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(49,NULL,1,'2011-08-08 15:04:37','2011-08-08 15:04:37',50,NULL,'Order CF1108-0003 validated','2011-08-08 15:04:37','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CF1108-0003 validated\nAuthor: admin',6,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(50,NULL,1,'2012-12-08 17:56:47','2012-12-08 17:56:47',40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:56:47','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(51,NULL,1,'2012-12-08 17:57:11','2012-12-08 17:57:11',40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:57:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(52,NULL,1,'2012-12-08 17:58:27','2012-12-08 17:58:27',40,NULL,'Facture FA1212-0008 validée dans Dolibarr','2012-12-08 17:58:27','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0008 validée dans Dolibarr\nAuteur: admin',11,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(53,NULL,1,'2012-12-08 18:20:49','2012-12-08 18:20:49',40,NULL,'Facture AV1212-0002 validée dans Dolibarr','2012-12-08 18:20:49','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 validée dans Dolibarr\nAuteur: admin',12,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(54,NULL,1,'2012-12-09 18:35:07','2012-12-09 18:35:07',40,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr','2012-12-09 18:35:07','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr\nAuteur: admin',12,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(55,NULL,1,'2012-12-09 20:14:42','2012-12-09 20:14:42',40,NULL,'Société doe john ajoutée dans Dolibarr','2012-12-09 20:14:42','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société doe john ajoutée dans Dolibarr\nAuteur: admin',18,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(56,NULL,1,'2012-12-12 18:54:19','2012-12-12 18:54:19',40,NULL,'Facture FA1212-0009 validée dans Dolibarr','2012-12-12 18:54:19','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0009 validée dans Dolibarr\nAuteur: admin',55,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(121,NULL,1,'2012-12-06 10:00:00',NULL,50,NULL,'aaab','2012-12-21 17:48:08','2012-12-21 16:54:07',3,1,NULL,NULL,NULL,0,3,NULL,NULL,1,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(122,NULL,1,'2012-12-21 18:09:52','2012-12-21 18:09:52',40,NULL,'Facture client FA1007-0001 envoyée par EMail','2012-12-21 18:09:52','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Mail envoyé par Firstname SuperAdminName à laurent@destailleur.fr.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2014-12-21 12:50:33',1,NULL,NULL,20,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2014-12-21 12:50:33',1,NULL,NULL,21,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,NULL,1,'2013-01-23 17:34:00',NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2014-12-21 12:50:33',1,1,NULL,7,NULL,0,1,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
        \r\nAuteur: admin',13,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2014-12-21 12:50:33',1,NULL,NULL,22,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2014-12-21 12:50:33',1,NULL,NULL,24,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2014-12-21 12:50:33',1,NULL,NULL,25,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2014-12-21 12:50:33',1,NULL,NULL,27,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2014-12-21 12:50:33',1,NULL,NULL,28,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2014-12-21 12:50:33',1,NULL,NULL,29,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2014-12-21 12:50:33',1,NULL,NULL,30,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2014-12-21 12:50:33',1,NULL,NULL,31,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2014-12-21 12:50:33',1,NULL,NULL,32,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2014-12-21 12:50:33',1,NULL,NULL,33,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,NULL,1,'2014-03-02 17:24:04','2014-03-02 17:24:04',40,'AC_BILL_VALIDATE','Invoice FA1302-0022 validated','2014-03-02 17:24:04','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1302-0022 validated\nAuthor: admin',157,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,NULL,1,'2014-03-02 17:24:28','2014-03-02 17:24:28',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 17:24:28','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,NULL,1,'2014-03-05 10:00:00','2014-03-05 10:00:00',5,NULL,'RDV John','2014-03-02 19:54:48','2014-03-02 18:55:29',1,1,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,NULL,NULL,NULL,'gfdgdfgdf',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(223,NULL,1,'2014-03-13 10:00:00','2014-03-17 00:00:00',50,NULL,'Congress','2014-03-02 19:55:11','2014-03-02 18:55:11',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,'',309600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,NULL,1,'2014-03-14 10:00:00',NULL,1,NULL,'Call john','2014-03-02 19:55:56','2014-03-02 18:55:56',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,0,'',NULL,NULL,'tttt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(225,NULL,1,'2014-03-02 20:11:31','2014-03-02 20:11:31',40,'AC_BILL_UNVALIDATE','Invoice FA1303-0020 go back to draft status','2014-03-02 20:11:31','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 go back to draft status\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,NULL,1,'2014-03-02 20:13:39','2014-03-02 20:13:39',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 20:13:39','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,NULL,1,'2014-03-03 19:20:10','2014-03-03 19:20:10',40,'AC_BILL_VALIDATE','Invoice FA1212-0023 validated','2014-03-03 19:20:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 validated\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(228,NULL,1,'2014-03-03 19:20:25','2014-03-03 19:20:25',40,'AC_BILL_CANCEL','Invoice FA1212-0023 canceled in Dolibarr','2014-03-03 19:20:25','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 canceled in Dolibarr\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(229,NULL,1,'2014-03-03 19:20:56','2014-03-03 19:20:56',40,'AC_BILL_VALIDATE','Invoice AV1403-0003 validated','2014-03-03 19:20:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 validated\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(230,NULL,1,'2014-03-03 19:21:29','2014-03-03 19:21:29',40,'AC_BILL_UNVALIDATE','Invoice AV1403-0003 go back to draft status','2014-03-03 19:21:29','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 go back to draft status\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(231,NULL,1,'2014-03-03 19:22:16','2014-03-03 19:22:16',40,'AC_BILL_VALIDATE','Invoice AV1303-0003 validated','2014-03-03 19:22:16','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1303-0003 validated\nAuthor: admin',213,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(232,NULL,1,'2016-01-22 18:54:39','2016-01-22 18:54:39',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:39','2016-01-22 17:54:39',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(233,NULL,1,'2016-01-22 18:54:46','2016-01-22 18:54:46',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:46','2016-01-22 17:54:46',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(234,NULL,1,'2016-07-05 10:00:00','2016-07-05 11:19:00',5,'AC_RDV','Meeting with my boss','2016-07-31 18:19:48','2016-07-31 14:19:48',12,NULL,NULL,NULL,NULL,0,12,1,NULL,0,0,1,-1,'',4740,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(235,NULL,1,'2016-07-13 00:00:00','2016-07-14 23:59:59',50,'AC_OTH','Trip at Las Vegas','2016-07-31 18:20:36','2016-07-31 14:20:36',12,NULL,4,NULL,2,0,12,1,NULL,0,1,1,-1,'',172799,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(236,NULL,1,'2016-07-29 10:00:00',NULL,4,'AC_EMAIL','Remind to send an email','2016-07-31 18:21:04','2016-07-31 14:21:04',12,NULL,NULL,NULL,NULL,0,4,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(237,NULL,1,'2016-07-01 10:00:00',NULL,1,'AC_TEL','Phone call with Mr Vaalen','2016-07-31 18:22:04','2016-07-31 14:22:04',12,NULL,6,4,NULL,0,13,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(238,NULL,1,'2016-08-02 10:00:00','2016-08-02 12:00:00',5,'AC_RDV','Meeting on radium','2016-08-01 01:15:50','2016-07-31 21:15:50',12,NULL,8,10,10,0,12,1,NULL,0,0,1,-1,'',7200,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(239,NULL,1,'2017-01-29 21:49:33','2017-01-29 21:49:33',40,'AC_OTH_AUTO','Proposal PR1302-0007 validated','2017-01-29 21:49:33','2017-01-29 17:49:33',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1302-0007 validated\nAuthor: admin',7,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(240,NULL,1,'2017-01-31 20:52:00',NULL,1,'AC_TEL','Call the boss','2017-01-31 20:52:10','2017-01-31 16:52:25',12,12,6,NULL,NULL,0,12,1,NULL,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(242,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 validated','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 validated\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(243,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 approved','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 approved\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(245,NULL,1,'2017-02-01 18:52:32','2017-02-01 18:52:32',40,'AC_OTH_AUTO','Supplier order CF1007-0001 submited','2017-02-01 18:52:32','2017-02-01 14:52:32',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 submited\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(249,NULL,1,'2017-02-01 18:54:01','2017-02-01 18:54:01',40,'AC_OTH_AUTO','Supplier order CF1007-0001 received','2017-02-01 18:54:01','2017-02-01 14:54:01',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 received \nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(250,NULL,1,'2017-02-01 18:54:42','2017-02-01 18:54:42',40,'AC_OTH_AUTO','Email sent by MyBigCompany To mycustomer@example.com','2017-02-01 18:54:42','2017-02-01 14:54:42',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
        \nReceiver(s): mycustomer@example.com
        \nEMail topic: Submission of order CF1007-0001
        \nEmail body:
        \nYou will find here our order CF1007-0001
        \r\n
        \r\nSincerely
        \n
        \nAttached files and documents: CF1007-0001.pdf',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(251,NULL,1,'2017-02-01 19:02:21','2017-02-01 19:02:21',40,'AC_OTH_AUTO','Invoice SI1702-0001 validated','2017-02-01 19:02:21','2017-02-01 15:02:21',12,NULL,5,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice SI1702-0001 validated\nAuthor: admin',20,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(252,NULL,1,'2017-02-12 23:17:04','2017-02-12 23:17:04',40,'AC_OTH_AUTO','Patient créé','2017-02-12 23:17:04','2017-02-12 19:17:04',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuthor: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(253,NULL,1,'2017-02-12 23:18:33','2017-02-12 23:18:33',40,'AC_OTH_AUTO','Consultation 2 recorded (aaa)','2017-02-12 23:18:33','2017-02-12 19:18:33',12,NULL,NULL,NULL,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Consultation 2 recorded (aaa)\nAuthor: admin',2,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(254,NULL,1,'2017-02-15 23:28:41','2017-02-15 23:28:41',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:28:41','2017-02-15 22:28:41',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,NULL,1,'2017-02-15 23:28:56','2017-02-15 23:28:56',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:28:56','2017-02-15 22:28:56',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',8,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(256,NULL,1,'2017-02-15 23:34:33','2017-02-15 23:34:33',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:34:33','2017-02-15 22:34:33',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',9,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,NULL,1,'2017-02-15 23:35:03','2017-02-15 23:35:03',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-15 23:35:03','2017-02-15 22:35:03',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',10,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(263,NULL,1,'2017-02-15 23:50:34','2017-02-15 23:50:34',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:50:34','2017-02-15 22:50:34',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',17,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(264,NULL,1,'2017-02-15 23:51:23','2017-02-15 23:51:23',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:51:23','2017-02-15 22:51:23',12,NULL,NULL,7,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',18,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(265,NULL,1,'2017-02-15 23:54:51','2017-02-15 23:54:51',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:54:51','2017-02-15 22:54:51',12,NULL,NULL,17,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',19,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(266,NULL,1,'2017-02-15 23:55:52','2017-02-15 23:55:52',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:55:52','2017-02-15 22:55:52',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',20,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(267,NULL,1,'2017-02-16 00:03:44','2017-02-16 00:03:44',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-16 00:03:44','2017-02-15 23:03:44',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',29,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(268,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0009 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0009 validated\nAuthor: admin',34,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(269,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0010 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0010 validated\nAuthor: admin',38,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(270,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0011 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0011 validated\nAuthor: admin',40,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0012 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0012 validated\nAuthor: admin',43,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(272,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0013 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0013 validated\nAuthor: admin',47,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0014 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0014 validated\nAuthor: admin',48,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(274,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0015 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0015 validated\nAuthor: admin',50,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(275,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0016 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0016 validated\nAuthor: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(277,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0018 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0018 validated\nAuthor: admin',62,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(278,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0019 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0019 validated\nAuthor: admin',68,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(279,NULL,1,'2017-02-16 00:05:36','2017-02-16 00:05:36',40,'AC_OTH_AUTO','Order CO7001-0020 validated','2017-02-16 00:05:36','2017-02-15 23:05:36',12,NULL,NULL,6,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0020 validated\nAuthor: admin',72,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(281,NULL,1,'2017-02-16 00:05:37','2017-02-16 00:05:37',40,'AC_OTH_AUTO','Order CO7001-0022 validated','2017-02-16 00:05:37','2017-02-15 23:05:37',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0022 validated\nAuthor: admin',78,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(282,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0023 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0023 validated\nAuthor: admin',81,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(283,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0024 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0024 validated\nAuthor: admin',83,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(284,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0025 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,2,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0025 validated\nAuthor: admin',84,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(285,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0026 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0026 validated\nAuthor: admin',85,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(286,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0027 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0027 validated\nAuthor: admin',88,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(287,NULL,1,'2017-02-16 03:05:56','2017-02-16 03:05:56',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Livrée','2017-02-16 03:05:56','2017-02-15 23:05:56',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Livrée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(288,NULL,1,'2017-02-16 03:06:01','2017-02-16 03:06:01',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Facturée','2017-02-16 03:06:01','2017-02-15 23:06:01',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Facturée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(294,NULL,1,'2017-02-16 03:53:04','2017-02-16 03:53:04',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 03:53:04','2017-02-15 23:53:04',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(295,NULL,1,'2017-02-16 03:58:08','2017-02-16 03:58:08',40,'AC_OTH_AUTO','Expédition SH1702-0002 validée','2017-02-16 03:58:08','2017-02-15 23:58:08',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Expédition SH1702-0002 validée\nAuteur: admin',3,'shipping',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(296,NULL,1,'2017-02-16 04:12:29','2017-02-16 04:12:29',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:12:29','2017-02-16 00:12:29',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(297,NULL,1,'2017-02-16 04:14:20','2017-02-16 04:14:20',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:14:20','2017-02-16 00:14:20',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(298,NULL,1,'2017-02-16 01:44:58','2017-02-16 01:44:58',40,'AC_OTH_AUTO','Proposal PR1702-0009 validated','2017-02-16 01:44:58','2017-02-16 00:44:58',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0009 validated\nAuthor: aeinstein',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(299,NULL,1,'2017-02-16 01:45:44','2017-02-16 01:45:44',40,'AC_OTH_AUTO','Proposal PR1702-0010 validated','2017-02-16 01:45:44','2017-02-16 00:45:44',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0010 validated\nAuthor: demo',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(300,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0011 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0011 validated\nAuthor: aeinstein',13,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(301,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0012 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,3,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0012 validated\nAuthor: demo',14,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(302,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0013 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0013 validated\nAuthor: demo',15,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(303,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0014 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0014 validated\nAuthor: demo',16,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(304,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0015 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0015 validated\nAuthor: aeinstein',17,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(305,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0016 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0016 validated\nAuthor: demo',18,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(306,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0017 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0017 validated\nAuthor: demo',19,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(307,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0018 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0018 validated\nAuthor: aeinstein',20,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(308,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0019 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0019 validated\nAuthor: aeinstein',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(309,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0020 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0020 validated\nAuthor: aeinstein',22,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(310,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0021 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0021 validated\nAuthor: demo',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(311,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0022 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0022 validated\nAuthor: demo',24,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(312,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0023 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',1,NULL,NULL,3,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0023 validated\nAuthor: aeinstein',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(313,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0024 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0024 validated\nAuthor: demo',26,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(314,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0025 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,6,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0025 validated\nAuthor: aeinstein',27,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(315,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0026 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0026 validated\nAuthor: demo',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(316,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0027 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0027 validated\nAuthor: demo',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(317,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0028 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0028 validated\nAuthor: demo',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(318,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0029 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,11,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0029 validated\nAuthor: aeinstein',31,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(319,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0030 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0030 validated\nAuthor: demo',32,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(320,NULL,1,'2017-02-16 04:46:31','2017-02-16 04:46:31',40,'AC_OTH_AUTO','Proposition PR1702-0026 signée','2017-02-16 04:46:31','2017-02-16 00:46:31',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0026 signée\nAuteur: admin',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(321,NULL,1,'2017-02-16 04:46:37','2017-02-16 04:46:37',40,'AC_OTH_AUTO','Proposition PR1702-0027 signée','2017-02-16 04:46:37','2017-02-16 00:46:37',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0027 signée\nAuteur: admin',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(322,NULL,1,'2017-02-16 04:46:42','2017-02-16 04:46:42',40,'AC_OTH_AUTO','Proposition PR1702-0028 refusée','2017-02-16 04:46:42','2017-02-16 00:46:42',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0028 refusée\nAuteur: admin',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(323,NULL,1,'2017-02-16 04:47:09','2017-02-16 04:47:09',40,'AC_OTH_AUTO','Proposition PR1702-0019 validée','2017-02-16 04:47:09','2017-02-16 00:47:09',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0019 validée\nAuteur: admin',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(324,NULL,1,'2017-02-16 04:47:25','2017-02-16 04:47:25',40,'AC_OTH_AUTO','Proposition PR1702-0023 signée','2017-02-16 04:47:25','2017-02-16 00:47:25',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 signée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(325,NULL,1,'2017-02-16 04:47:29','2017-02-16 04:47:29',40,'AC_OTH_AUTO','Proposition PR1702-0023 classée payée','2017-02-16 04:47:29','2017-02-16 00:47:29',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 classée payée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(326,NULL,1,'2017-02-17 16:07:18','2017-02-17 16:07:18',40,'AC_OTH_AUTO','Proposition PR1702-0021 validée','2017-02-17 16:07:18','2017-02-17 12:07:18',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0021 validée\nAuteur: admin',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(327,NULL,1,'2017-05-12 13:53:44','2017-05-12 13:53:44',40,'AC_OTH_AUTO','Email sent by MyBigCompany To Einstein','2017-05-12 13:53:44','2017-05-12 09:53:44',12,NULL,NULL,11,12,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
        \nReceiver(s): Einstein <genius@example.com>
        \nBcc: Einstein <genius@example.com>
        \nEMail topic: Test
        \nEmail body:
        \nTest\nAuthor: admin',11,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO `llx_actioncomm` VALUES (1,NULL,1,'2010-07-08 14:21:44','2010-07-08 14:21:44',50,NULL,'Company AAA and Co added into Dolibarr','2010-07-08 14:21:44','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company AAA and Co added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,NULL,1,'2010-07-08 14:23:48','2010-07-08 14:23:48',50,NULL,'Company Belin SARL added into Dolibarr','2010-07-08 14:23:48','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Belin SARL added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,NULL,1,'2010-07-08 22:42:12','2010-07-08 22:42:12',50,NULL,'Company Spanish Comp added into Dolibarr','2010-07-08 22:42:12','2014-12-21 12:50:33',1,NULL,NULL,3,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Spanish Comp added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,NULL,1,'2010-07-08 22:48:18','2010-07-08 22:48:18',50,NULL,'Company Prospector Vaalen added into Dolibarr','2010-07-08 22:48:18','2014-12-21 12:50:33',1,NULL,NULL,4,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Prospector Vaalen added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,NULL,1,'2010-07-08 23:22:57','2010-07-08 23:22:57',50,NULL,'Company NoCountry Co added into Dolibarr','2010-07-08 23:22:57','2014-12-21 12:50:33',1,NULL,NULL,5,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company NoCountry Co added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,NULL,1,'2010-07-09 00:15:09','2010-07-09 00:15:09',50,NULL,'Company Swiss customer added into Dolibarr','2010-07-09 00:15:09','2014-12-21 12:50:33',1,NULL,NULL,6,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Swiss customer added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,NULL,1,'2010-07-09 01:24:26','2010-07-09 01:24:26',50,NULL,'Company Generic customer added into Dolibarr','2010-07-09 01:24:26','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Company Generic customer added into Dolibarr\nAuthor: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,NULL,1,'2010-07-10 14:54:27','2010-07-10 14:54:27',50,NULL,'Société Client salon ajoutée dans Dolibarr','2010-07-10 14:54:27','2014-12-21 12:50:33',1,NULL,NULL,8,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,NULL,1,'2010-07-10 14:54:44','2010-07-10 14:54:44',50,NULL,'Société Client salon invidivdu ajoutée dans Doliba','2010-07-10 14:54:44','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon invidivdu ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,NULL,1,'2010-07-10 14:56:10','2010-07-10 14:56:10',50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:56:10','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,NULL,1,'2010-07-10 14:58:53','2010-07-10 14:58:53',50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:58:53','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,NULL,1,'2010-07-10 15:00:55','2010-07-10 15:00:55',50,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr','2010-07-10 15:00:55','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr\nAuteur: admin',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,NULL,1,'2010-07-10 15:13:08','2010-07-10 15:13:08',50,NULL,'Société Smith Vick ajoutée dans Dolibarr','2010-07-10 15:13:08','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Smith Vick ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,NULL,1,'2010-07-10 15:21:00','2010-07-10 16:21:00',5,NULL,'RDV avec mon chef','2010-07-10 15:21:48','2010-07-10 13:21:48',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'',3600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,NULL,1,'2010-07-10 18:18:16','2010-07-10 18:18:16',50,NULL,'Contrat CONTRAT1 validé dans Dolibarr','2010-07-10 18:18:16','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Contrat CONTRAT1 validé dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,NULL,1,'2010-07-10 18:35:57','2010-07-10 18:35:57',50,NULL,'Société Mon client ajoutée dans Dolibarr','2010-07-10 18:35:57','2014-12-21 12:50:33',1,NULL,NULL,11,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Mon client ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,NULL,1,'2010-07-11 16:18:08','2010-07-11 16:18:08',50,NULL,'Société Dupont Alain ajoutée dans Dolibarr','2010-07-11 16:18:08','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Dupont Alain ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,NULL,1,'2010-07-11 17:11:00','2010-07-11 17:17:00',5,NULL,'Rendez-vous','2010-07-11 17:11:22','2010-07-11 15:11:22',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'gfgdfgdf',360,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,NULL,1,'2010-07-11 17:13:20','2010-07-11 17:13:20',50,NULL,'Société Vendeur de chips ajoutée dans Dolibarr','2010-07-11 17:13:20','2014-12-21 12:50:33',1,NULL,NULL,13,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Société Vendeur de chips ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,NULL,1,'2010-07-11 17:15:42','2010-07-11 17:15:42',50,NULL,'Commande CF1007-0001 validée','2010-07-11 17:15:42','2014-12-21 12:50:33',1,NULL,NULL,13,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0001 validée\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,NULL,1,'2010-07-11 18:47:33','2010-07-11 18:47:33',50,NULL,'Commande CF1007-0002 validée','2010-07-11 18:47:33','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0002 validée\nAuteur: admin',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,NULL,1,'2010-07-18 11:36:18','2010-07-18 11:36:18',50,NULL,'Proposition PR1007-0003 validée','2010-07-18 11:36:18','2014-12-21 12:50:33',1,NULL,NULL,4,NULL,0,1,NULL,1,0,0,1,100,'',NULL,NULL,'Proposition PR1007-0003 validée\nAuteur: admin',3,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,NULL,1,'2011-07-18 20:49:58','2011-07-18 20:49:58',50,NULL,'Invoice FA1007-0002 validated in Dolibarr','2011-07-18 20:49:58','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 validated in Dolibarr\nAuthor: admin',2,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,NULL,1,'2011-07-28 01:37:00',NULL,1,NULL,'Phone call','2011-07-28 01:37:48','2011-07-27 23:37:48',1,NULL,NULL,NULL,2,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,NULL,1,'2011-08-01 02:31:24','2011-08-01 02:31:24',50,NULL,'Company mmm added into Dolibarr','2011-08-01 02:31:24','2014-12-21 12:50:33',1,NULL,NULL,15,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company mmm added into Dolibarr\nAuthor: admin',15,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,NULL,1,'2011-08-01 02:31:43','2011-08-01 02:31:43',50,NULL,'Company ppp added into Dolibarr','2011-08-01 02:31:43','2014-12-21 12:50:33',1,NULL,NULL,16,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ppp added into Dolibarr\nAuthor: admin',16,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,NULL,1,'2011-08-01 02:41:26','2011-08-01 02:41:26',50,NULL,'Company aaa added into Dolibarr','2011-08-01 02:41:26','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company aaa added into Dolibarr\nAuthor: admin',17,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 validated in Dolibarr\nAuthor: admin',5,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 changed to paid in Dolibarr\nAuthor: admin',5,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 validated in Dolibarr\nAuthor: admin',6,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2014-12-21 12:50:33',1,NULL,NULL,7,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 changed to paid in Dolibarr\nAuthor: admin',6,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,NULL,1,'2011-08-08 02:41:55','2011-08-08 02:41:55',50,NULL,'Invoice FA1108-0005 validated in Dolibarr','2011-08-08 02:41:55','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 validated in Dolibarr\nAuthor: admin',8,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(40,NULL,1,'2011-08-08 02:53:40','2011-08-08 02:53:40',50,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr','2011-08-08 02:53:40','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr\nAuthor: admin',8,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(41,NULL,1,'2011-08-08 02:54:05','2011-08-08 02:54:05',50,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr','2011-08-08 02:54:05','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr\nAuthor: admin',2,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(42,NULL,1,'2011-08-08 02:55:04','2011-08-08 02:55:04',50,NULL,'Invoice FA1107-0006 validated in Dolibarr','2011-08-08 02:55:04','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 validated in Dolibarr\nAuthor: admin',3,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(43,NULL,1,'2011-08-08 02:55:26','2011-08-08 02:55:26',50,NULL,'Invoice FA1108-0007 validated in Dolibarr','2011-08-08 02:55:26','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0007 validated in Dolibarr\nAuthor: admin',9,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(44,NULL,1,'2011-08-08 02:55:58','2011-08-08 02:55:58',50,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr','2011-08-08 02:55:58','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr\nAuthor: admin',3,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(45,NULL,1,'2011-08-08 03:04:22','2011-08-08 03:04:22',50,NULL,'Order CO1108-0001 validated','2011-08-08 03:04:22','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1108-0001 validated\nAuthor: admin',5,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(46,NULL,1,'2011-08-08 13:59:09','2011-08-08 13:59:09',50,NULL,'Order CO1107-0002 validated','2011-08-08 13:59:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1107-0002 validated\nAuthor: admin',1,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(47,NULL,1,'2011-08-08 14:24:18','2011-08-08 14:24:18',50,NULL,'Proposal PR1007-0001 validated','2011-08-08 14:24:18','2014-12-21 12:50:33',1,NULL,NULL,2,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1007-0001 validated\nAuthor: admin',1,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(48,NULL,1,'2011-08-08 14:24:24','2011-08-08 14:24:24',50,NULL,'Proposal PR1108-0004 validated','2011-08-08 14:24:24','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1108-0004 validated\nAuthor: admin',4,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(49,NULL,1,'2011-08-08 15:04:37','2011-08-08 15:04:37',50,NULL,'Order CF1108-0003 validated','2011-08-08 15:04:37','2014-12-21 12:50:33',1,NULL,NULL,17,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CF1108-0003 validated\nAuthor: admin',6,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(50,NULL,1,'2012-12-08 17:56:47','2012-12-08 17:56:47',40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:56:47','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(51,NULL,1,'2012-12-08 17:57:11','2012-12-08 17:57:11',40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:57:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(52,NULL,1,'2012-12-08 17:58:27','2012-12-08 17:58:27',40,NULL,'Facture FA1212-0008 validée dans Dolibarr','2012-12-08 17:58:27','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0008 validée dans Dolibarr\nAuteur: admin',11,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(53,NULL,1,'2012-12-08 18:20:49','2012-12-08 18:20:49',40,NULL,'Facture AV1212-0002 validée dans Dolibarr','2012-12-08 18:20:49','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 validée dans Dolibarr\nAuteur: admin',12,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(54,NULL,1,'2012-12-09 18:35:07','2012-12-09 18:35:07',40,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr','2012-12-09 18:35:07','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr\nAuteur: admin',12,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(55,NULL,1,'2012-12-09 20:14:42','2012-12-09 20:14:42',40,NULL,'Société doe john ajoutée dans Dolibarr','2012-12-09 20:14:42','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société doe john ajoutée dans Dolibarr\nAuteur: admin',18,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(56,NULL,1,'2012-12-12 18:54:19','2012-12-12 18:54:19',40,NULL,'Facture FA1212-0009 validée dans Dolibarr','2012-12-12 18:54:19','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0009 validée dans Dolibarr\nAuteur: admin',55,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(121,NULL,1,'2012-12-06 10:00:00',NULL,50,NULL,'aaab','2012-12-21 17:48:08','2012-12-21 16:54:07',3,1,NULL,NULL,NULL,0,3,NULL,NULL,1,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(122,NULL,1,'2012-12-21 18:09:52','2012-12-21 18:09:52',40,NULL,'Facture client FA1007-0001 envoyée par EMail','2012-12-21 18:09:52','2014-12-21 12:50:33',1,NULL,NULL,9,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Mail envoyé par Firstname SuperAdminName à bidon@destailleur.fr.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2014-12-21 12:50:33',1,NULL,NULL,20,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2014-12-21 12:50:33',1,NULL,NULL,21,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(134,NULL,1,'2013-01-23 17:34:00',NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2014-12-21 12:50:33',1,1,NULL,7,NULL,0,1,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
        \r\nAuteur: admin',13,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2014-12-21 12:50:33',1,NULL,NULL,22,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2014-12-21 12:50:33',1,NULL,NULL,24,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2014-12-21 12:50:33',1,NULL,NULL,23,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2014-12-21 12:50:33',1,NULL,NULL,25,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2014-12-21 12:50:33',1,NULL,NULL,26,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2014-12-21 12:50:33',1,NULL,NULL,10,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2014-12-21 12:50:33',1,NULL,NULL,12,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2014-12-21 12:50:33',1,NULL,NULL,27,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2014-12-21 12:50:33',1,NULL,NULL,28,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2014-12-21 12:50:33',1,NULL,NULL,29,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2014-12-21 12:50:33',1,NULL,NULL,30,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2014-12-21 12:50:33',1,NULL,NULL,31,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2014-12-21 12:50:33',1,NULL,NULL,32,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2014-12-21 12:50:33',1,NULL,NULL,33,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,NULL,1,'2014-03-02 17:24:04','2014-03-02 17:24:04',40,'AC_BILL_VALIDATE','Invoice FA1302-0022 validated','2014-03-02 17:24:04','2014-12-21 12:50:33',1,NULL,NULL,18,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1302-0022 validated\nAuthor: admin',157,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,NULL,1,'2014-03-02 17:24:28','2014-03-02 17:24:28',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 17:24:28','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,NULL,1,'2014-03-05 10:00:00','2014-03-05 10:00:00',5,NULL,'RDV John','2014-03-02 19:54:48','2014-03-02 18:55:29',1,1,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,NULL,NULL,NULL,'gfdgdfgdf',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(223,NULL,1,'2014-03-13 10:00:00','2014-03-17 00:00:00',50,NULL,'Congress','2014-03-02 19:55:11','2014-03-02 18:55:11',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,-1,'',309600,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,NULL,1,'2014-03-14 10:00:00',NULL,1,NULL,'Call john','2014-03-02 19:55:56','2014-03-02 18:55:56',1,NULL,NULL,NULL,NULL,0,1,0,NULL,0,0,1,0,'',NULL,NULL,'tttt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(225,NULL,1,'2014-03-02 20:11:31','2014-03-02 20:11:31',40,'AC_BILL_UNVALIDATE','Invoice FA1303-0020 go back to draft status','2014-03-02 20:11:31','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 go back to draft status\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,NULL,1,'2014-03-02 20:13:39','2014-03-02 20:13:39',40,'AC_BILL_VALIDATE','Invoice FA1303-0020 validated','2014-03-02 20:13:39','2014-12-21 12:50:33',1,NULL,NULL,19,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1303-0020 validated\nAuthor: admin',211,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,NULL,1,'2014-03-03 19:20:10','2014-03-03 19:20:10',40,'AC_BILL_VALIDATE','Invoice FA1212-0023 validated','2014-03-03 19:20:10','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 validated\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(228,NULL,1,'2014-03-03 19:20:25','2014-03-03 19:20:25',40,'AC_BILL_CANCEL','Invoice FA1212-0023 canceled in Dolibarr','2014-03-03 19:20:25','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1212-0023 canceled in Dolibarr\nAuthor: admin',33,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(229,NULL,1,'2014-03-03 19:20:56','2014-03-03 19:20:56',40,'AC_BILL_VALIDATE','Invoice AV1403-0003 validated','2014-03-03 19:20:56','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 validated\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(230,NULL,1,'2014-03-03 19:21:29','2014-03-03 19:21:29',40,'AC_BILL_UNVALIDATE','Invoice AV1403-0003 go back to draft status','2014-03-03 19:21:29','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1403-0003 go back to draft status\nAuthor: admin',212,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(231,NULL,1,'2014-03-03 19:22:16','2014-03-03 19:22:16',40,'AC_BILL_VALIDATE','Invoice AV1303-0003 validated','2014-03-03 19:22:16','2014-12-21 12:50:33',1,NULL,NULL,1,NULL,0,1,0,1,0,0,1,-1,'',NULL,NULL,'Invoice AV1303-0003 validated\nAuthor: admin',213,'invoice',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(232,NULL,1,'2016-01-22 18:54:39','2016-01-22 18:54:39',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:39','2016-01-22 17:54:39',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(233,NULL,1,'2016-01-22 18:54:46','2016-01-22 18:54:46',40,'AC_OTH_AUTO','Invoice 16 validated','2016-01-22 18:54:46','2016-01-22 17:54:46',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice 16 validated\nAuthor: admin',16,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(234,NULL,1,'2016-07-05 10:00:00','2016-07-05 11:19:00',5,'AC_RDV','Meeting with my boss','2016-07-31 18:19:48','2016-07-31 14:19:48',12,NULL,NULL,NULL,NULL,0,12,1,NULL,0,0,1,-1,'',4740,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(235,NULL,1,'2016-07-13 00:00:00','2016-07-14 23:59:59',50,'AC_OTH','Trip at Las Vegas','2016-07-31 18:20:36','2016-07-31 14:20:36',12,NULL,4,NULL,2,0,12,1,NULL,0,1,1,-1,'',172799,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(236,NULL,1,'2016-07-29 10:00:00',NULL,4,'AC_EMAIL','Remind to send an email','2016-07-31 18:21:04','2016-07-31 14:21:04',12,NULL,NULL,NULL,NULL,0,4,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(237,NULL,1,'2016-07-01 10:00:00',NULL,1,'AC_TEL','Phone call with Mr Vaalen','2016-07-31 18:22:04','2016-07-31 14:22:04',12,NULL,6,4,NULL,0,13,0,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(238,NULL,1,'2016-08-02 10:00:00','2016-08-02 12:00:00',5,'AC_RDV','Meeting on radium','2016-08-01 01:15:50','2016-07-31 21:15:50',12,NULL,8,10,10,0,12,1,NULL,0,0,1,-1,'',7200,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(239,NULL,1,'2017-01-29 21:49:33','2017-01-29 21:49:33',40,'AC_OTH_AUTO','Proposal PR1302-0007 validated','2017-01-29 21:49:33','2017-01-29 17:49:33',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1302-0007 validated\nAuthor: admin',7,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(240,NULL,1,'2017-01-31 20:52:00',NULL,1,'AC_TEL','Call the boss','2017-01-31 20:52:10','2017-01-31 16:52:25',12,12,6,NULL,NULL,0,12,1,NULL,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(242,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 validated','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 validated\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(243,NULL,1,'2017-02-01 18:52:04','2017-02-01 18:52:04',40,'AC_OTH_AUTO','Order CF1007-0001 approved','2017-02-01 18:52:04','2017-02-01 14:52:04',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CF1007-0001 approved\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(245,NULL,1,'2017-02-01 18:52:32','2017-02-01 18:52:32',40,'AC_OTH_AUTO','Supplier order CF1007-0001 submited','2017-02-01 18:52:32','2017-02-01 14:52:32',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 submited\nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(249,NULL,1,'2017-02-01 18:54:01','2017-02-01 18:54:01',40,'AC_OTH_AUTO','Supplier order CF1007-0001 received','2017-02-01 18:54:01','2017-02-01 14:54:01',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Supplier order CF1007-0001 received \nAuthor: admin',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(250,NULL,1,'2017-02-01 18:54:42','2017-02-01 18:54:42',40,'AC_OTH_AUTO','Email sent by MyBigCompany To mycustomer@example.com','2017-02-01 18:54:42','2017-02-01 14:54:42',12,NULL,NULL,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
        \nReceiver(s): mycustomer@example.com
        \nEMail topic: Submission of order CF1007-0001
        \nEmail body:
        \nYou will find here our order CF1007-0001
        \r\n
        \r\nSincerely
        \n
        \nAttached files and documents: CF1007-0001.pdf',1,'order_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(251,NULL,1,'2017-02-01 19:02:21','2017-02-01 19:02:21',40,'AC_OTH_AUTO','Invoice SI1702-0001 validated','2017-02-01 19:02:21','2017-02-01 15:02:21',12,NULL,5,13,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Invoice SI1702-0001 validated\nAuthor: admin',20,'invoice_supplier',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(252,NULL,1,'2017-02-12 23:17:04','2017-02-12 23:17:04',40,'AC_OTH_AUTO','Patient créé','2017-02-12 23:17:04','2017-02-12 19:17:04',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuthor: admin',26,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(253,NULL,1,'2017-02-12 23:18:33','2017-02-12 23:18:33',40,'AC_OTH_AUTO','Consultation 2 recorded (aaa)','2017-02-12 23:18:33','2017-02-12 19:18:33',12,NULL,NULL,NULL,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Consultation 2 recorded (aaa)\nAuthor: admin',2,'cabinetmed_cons',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(254,NULL,1,'2017-02-15 23:28:41','2017-02-15 23:28:41',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:28:41','2017-02-15 22:28:41',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',7,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(255,NULL,1,'2017-02-15 23:28:56','2017-02-15 23:28:56',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:28:56','2017-02-15 22:28:56',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',8,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(256,NULL,1,'2017-02-15 23:34:33','2017-02-15 23:34:33',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:34:33','2017-02-15 22:34:33',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',9,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(257,NULL,1,'2017-02-15 23:35:03','2017-02-15 23:35:03',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-15 23:35:03','2017-02-15 22:35:03',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',10,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(263,NULL,1,'2017-02-15 23:50:34','2017-02-15 23:50:34',40,'AC_OTH_AUTO','Order CO7001-0005 validated','2017-02-15 23:50:34','2017-02-15 22:50:34',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0005 validated\nAuthor: admin',17,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(264,NULL,1,'2017-02-15 23:51:23','2017-02-15 23:51:23',40,'AC_OTH_AUTO','Order CO7001-0006 validated','2017-02-15 23:51:23','2017-02-15 22:51:23',12,NULL,NULL,7,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0006 validated\nAuthor: admin',18,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(265,NULL,1,'2017-02-15 23:54:51','2017-02-15 23:54:51',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:54:51','2017-02-15 22:54:51',12,NULL,NULL,17,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',19,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(266,NULL,1,'2017-02-15 23:55:52','2017-02-15 23:55:52',40,'AC_OTH_AUTO','Order CO7001-0007 validated','2017-02-15 23:55:52','2017-02-15 22:55:52',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0007 validated\nAuthor: admin',20,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(267,NULL,1,'2017-02-16 00:03:44','2017-02-16 00:03:44',40,'AC_OTH_AUTO','Order CO7001-0008 validated','2017-02-16 00:03:44','2017-02-15 23:03:44',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0008 validated\nAuthor: admin',29,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(268,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0009 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0009 validated\nAuthor: admin',34,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(269,NULL,1,'2017-02-16 00:05:01','2017-02-16 00:05:01',40,'AC_OTH_AUTO','Order CO7001-0010 validated','2017-02-16 00:05:01','2017-02-15 23:05:01',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0010 validated\nAuthor: admin',38,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(270,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0011 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0011 validated\nAuthor: admin',40,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(271,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0012 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0012 validated\nAuthor: admin',43,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(272,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0013 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0013 validated\nAuthor: admin',47,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(273,NULL,1,'2017-02-16 00:05:11','2017-02-16 00:05:11',40,'AC_OTH_AUTO','Order CO7001-0014 validated','2017-02-16 00:05:11','2017-02-15 23:05:11',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0014 validated\nAuthor: admin',48,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(274,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0015 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0015 validated\nAuthor: admin',50,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(275,NULL,1,'2017-02-16 00:05:26','2017-02-16 00:05:26',40,'AC_OTH_AUTO','Order CO7001-0016 validated','2017-02-16 00:05:26','2017-02-15 23:05:26',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0016 validated\nAuthor: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(277,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0018 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0018 validated\nAuthor: admin',62,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(278,NULL,1,'2017-02-16 00:05:35','2017-02-16 00:05:35',40,'AC_OTH_AUTO','Order CO7001-0019 validated','2017-02-16 00:05:35','2017-02-15 23:05:35',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0019 validated\nAuthor: admin',68,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(279,NULL,1,'2017-02-16 00:05:36','2017-02-16 00:05:36',40,'AC_OTH_AUTO','Order CO7001-0020 validated','2017-02-16 00:05:36','2017-02-15 23:05:36',12,NULL,NULL,6,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0020 validated\nAuthor: admin',72,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(281,NULL,1,'2017-02-16 00:05:37','2017-02-16 00:05:37',40,'AC_OTH_AUTO','Order CO7001-0022 validated','2017-02-16 00:05:37','2017-02-15 23:05:37',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0022 validated\nAuthor: admin',78,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(282,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0023 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,11,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0023 validated\nAuthor: admin',81,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(283,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0024 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,26,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0024 validated\nAuthor: admin',83,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(284,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0025 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,2,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0025 validated\nAuthor: admin',84,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(285,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0026 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0026 validated\nAuthor: admin',85,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(286,NULL,1,'2017-02-16 00:05:38','2017-02-16 00:05:38',40,'AC_OTH_AUTO','Order CO7001-0027 validated','2017-02-16 00:05:38','2017-02-15 23:05:38',12,NULL,NULL,10,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Order CO7001-0027 validated\nAuthor: admin',88,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(287,NULL,1,'2017-02-16 03:05:56','2017-02-16 03:05:56',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Livrée','2017-02-16 03:05:56','2017-02-15 23:05:56',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Livrée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(288,NULL,1,'2017-02-16 03:06:01','2017-02-16 03:06:01',40,'AC_OTH_AUTO','Commande CO7001-0016 classée Facturée','2017-02-16 03:06:01','2017-02-15 23:06:01',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0016 classée Facturée\nAuteur: admin',54,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(294,NULL,1,'2017-02-16 03:53:04','2017-02-16 03:53:04',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 03:53:04','2017-02-15 23:53:04',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(295,NULL,1,'2017-02-16 03:58:08','2017-02-16 03:58:08',40,'AC_OTH_AUTO','Expédition SH1702-0002 validée','2017-02-16 03:58:08','2017-02-15 23:58:08',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Expédition SH1702-0002 validée\nAuteur: admin',3,'shipping',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(296,NULL,1,'2017-02-16 04:12:29','2017-02-16 04:12:29',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:12:29','2017-02-16 00:12:29',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(297,NULL,1,'2017-02-16 04:14:20','2017-02-16 04:14:20',40,'AC_OTH_AUTO','Commande CO7001-0021 validée','2017-02-16 04:14:20','2017-02-16 00:14:20',12,NULL,NULL,4,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Commande CO7001-0021 validée\nAuteur: admin',75,'order',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(298,NULL,1,'2017-02-16 01:44:58','2017-02-16 01:44:58',40,'AC_OTH_AUTO','Proposal PR1702-0009 validated','2017-02-16 01:44:58','2017-02-16 00:44:58',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0009 validated\nAuthor: aeinstein',11,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(299,NULL,1,'2017-02-16 01:45:44','2017-02-16 01:45:44',40,'AC_OTH_AUTO','Proposal PR1702-0010 validated','2017-02-16 01:45:44','2017-02-16 00:45:44',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0010 validated\nAuthor: demo',12,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(300,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0011 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0011 validated\nAuthor: aeinstein',13,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(301,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0012 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,3,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0012 validated\nAuthor: demo',14,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(302,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0013 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0013 validated\nAuthor: demo',15,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(303,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0014 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0014 validated\nAuthor: demo',16,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(304,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0015 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0015 validated\nAuthor: aeinstein',17,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(305,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0016 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,26,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0016 validated\nAuthor: demo',18,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(306,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0017 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0017 validated\nAuthor: demo',19,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(307,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0018 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0018 validated\nAuthor: aeinstein',20,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(308,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0019 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,1,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0019 validated\nAuthor: aeinstein',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(309,NULL,1,'2017-02-16 01:46:15','2017-02-16 01:46:15',40,'AC_OTH_AUTO','Proposal PR1702-0020 validated','2017-02-16 01:46:15','2017-02-16 00:46:15',1,NULL,NULL,26,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0020 validated\nAuthor: aeinstein',22,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(310,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0021 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,12,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0021 validated\nAuthor: demo',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(311,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0022 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',2,NULL,NULL,7,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0022 validated\nAuthor: demo',24,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(312,NULL,1,'2017-02-16 01:46:17','2017-02-16 01:46:17',40,'AC_OTH_AUTO','Proposal PR1702-0023 validated','2017-02-16 01:46:17','2017-02-16 00:46:17',1,NULL,NULL,3,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0023 validated\nAuthor: aeinstein',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(313,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0024 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0024 validated\nAuthor: demo',26,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(314,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0025 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,6,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0025 validated\nAuthor: aeinstein',27,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(315,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0026 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0026 validated\nAuthor: demo',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(316,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0027 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0027 validated\nAuthor: demo',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(317,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0028 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,1,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0028 validated\nAuthor: demo',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(318,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0029 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',1,NULL,NULL,11,NULL,0,1,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0029 validated\nAuthor: aeinstein',31,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(319,NULL,1,'2017-02-16 01:46:18','2017-02-16 01:46:18',40,'AC_OTH_AUTO','Proposal PR1702-0030 validated','2017-02-16 01:46:18','2017-02-16 00:46:18',2,NULL,NULL,19,NULL,0,2,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposal PR1702-0030 validated\nAuthor: demo',32,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(320,NULL,1,'2017-02-16 04:46:31','2017-02-16 04:46:31',40,'AC_OTH_AUTO','Proposition PR1702-0026 signée','2017-02-16 04:46:31','2017-02-16 00:46:31',12,NULL,NULL,19,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0026 signée\nAuteur: admin',28,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(321,NULL,1,'2017-02-16 04:46:37','2017-02-16 04:46:37',40,'AC_OTH_AUTO','Proposition PR1702-0027 signée','2017-02-16 04:46:37','2017-02-16 00:46:37',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0027 signée\nAuteur: admin',29,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(322,NULL,1,'2017-02-16 04:46:42','2017-02-16 04:46:42',40,'AC_OTH_AUTO','Proposition PR1702-0028 refusée','2017-02-16 04:46:42','2017-02-16 00:46:42',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0028 refusée\nAuteur: admin',30,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(323,NULL,1,'2017-02-16 04:47:09','2017-02-16 04:47:09',40,'AC_OTH_AUTO','Proposition PR1702-0019 validée','2017-02-16 04:47:09','2017-02-16 00:47:09',12,NULL,NULL,1,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0019 validée\nAuteur: admin',21,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(324,NULL,1,'2017-02-16 04:47:25','2017-02-16 04:47:25',40,'AC_OTH_AUTO','Proposition PR1702-0023 signée','2017-02-16 04:47:25','2017-02-16 00:47:25',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 signée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(325,NULL,1,'2017-02-16 04:47:29','2017-02-16 04:47:29',40,'AC_OTH_AUTO','Proposition PR1702-0023 classée payée','2017-02-16 04:47:29','2017-02-16 00:47:29',12,NULL,NULL,3,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0023 classée payée\nAuteur: admin',25,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(326,NULL,1,'2017-02-17 16:07:18','2017-02-17 16:07:18',40,'AC_OTH_AUTO','Proposition PR1702-0021 validée','2017-02-17 16:07:18','2017-02-17 12:07:18',12,NULL,NULL,12,NULL,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Proposition PR1702-0021 validée\nAuteur: admin',23,'propal',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(327,NULL,1,'2017-05-12 13:53:44','2017-05-12 13:53:44',40,'AC_OTH_AUTO','Email sent by MyBigCompany To Einstein','2017-05-12 13:53:44','2017-05-12 09:53:44',12,NULL,NULL,11,12,0,12,0,NULL,0,0,1,-1,'',NULL,NULL,'Sender: MyBigCompany <myemail@mybigcompany.com>
        \nReceiver(s): Einstein <genius@example.com>
        \nBcc: Einstein <genius@example.com>
        \nEMail topic: Test
        \nEmail body:
        \nTest\nAuthor: admin',11,'societe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_actioncomm` ENABLE KEYS */; UNLOCK TABLES; From 4c5bf884921753bdfeeb78758a446f7df75fe61b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 27 Aug 2017 17:52:44 +0200 Subject: [PATCH 0177/1137] New use numbering mask on validate --- .../class/expensereport.class.php | 183 +++++++++--------- 1 file changed, 93 insertions(+), 90 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index eb6116f4edf..05e008e9dab 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1048,111 +1048,114 @@ class ExpenseReport extends CommonObject */ function setValidate($fuser, $notrigger=0) { - global $conf,$langs; + global $conf,$langs,$user; $error = 0; - $this->oldref = $this->ref; - $expld_car = (empty($conf->global->NDF_EXPLODE_CHAR))?"-":$conf->global->NDF_EXPLODE_CHAR; - - // Sélection de la date de début de la NDF - $sql = 'SELECT date_debut'; - $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element; - $sql.= ' WHERE rowid = '.$this->id; - $result = $this->db->query($sql); - $objp = $this->db->fetch_object($result); - $this->date_debut = $this->db->jdate($objp->date_debut); - - $update_number_int = false; - - // Create next ref if ref is PROVxx - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) + + // Protection + if ($this->statut == self::STATUS_VALIDATED) { - // Sélection du numéro de ref suivant - $ref_next = $this->getNextNumRef(); - $ref_number_int = ($this->ref+1)-1; - $update_number_int = true; - // Création du ref_number suivant - if($ref_next) - { - $prefix="ER"; - if (! empty($conf->global->EXPENSE_REPORT_PREFIX)) $prefix=$conf->global->EXPENSE_REPORT_PREFIX; - $this->ref = str_replace(' ','_', $this->user_author_infos).$expld_car.$prefix.$this->ref.$expld_car.dol_print_date($this->date_debut,'%y%m%d'); - } - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - // We rename directory in order to avoid losing the attachments - $oldref = dol_sanitizeFileName($this->oldref); - $newref = dol_sanitizeFileName($this->ref); - $dirsource = $conf->expensereport->dir_output.'/'.$oldref; - $dirdest = $conf->expensereport->dir_output.'/'.$newref; - if (file_exists($dirsource)) - { - dol_syslog(get_class($this)."::setValidate() rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) - { - dol_syslog("Rename ok"); - // Rename docs starting with $oldref with $newref - $listoffiles=dol_dir_list($conf->expensereport->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/')); - foreach($listoffiles as $fileentry) - { - $dirsource=$fileentry['name']; - $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource); - $dirsource=$fileentry['path'].'/'.$dirsource; - $dirdest=$fileentry['path'].'/'.$dirdest; - @rename($dirsource, $dirdest); - } - } - } + dol_syslog(get_class($this)."::valid action abandonned: already validated", LOG_WARNING); + return 0; } - if ($this->fk_statut != 2) + + // Define new ref + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { - $now = dol_now(); - $this->db->begin(); + $num = $this->getNextNumRef(); + } + else + { + $num = $this->ref; + } + $this->newref = $num; + + $now = dol_now(); + $this->db->begin(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = 2, fk_user_valid = ".$fuser->id.", date_valid='".$this->db->idate($now)."'"; - if ($update_number_int) { - $sql.= ", ref_number_int = ".$ref_number_int; - } - $sql.= ' WHERE rowid = '.$this->id; + // Validate + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; + $sql.= " SET ref = '".$num."',"; + $sql.= " fk_statut = ".self::STATUS_VALIDATED.","; + $sql.= " date_valid='".$this->db->idate($now)."',"; + $sql.= " fk_user_valid = ".$user->id; + $sql.= " WHERE rowid = ".$this->id; - $resql=$this->db->query($sql); - if ($resql) - { - if (!$notrigger) - { - // Call trigger - $result=$this->call_trigger('EXPENSE_REPORT_VALIDATE',$fuser); + $resql=$this->db->query($sql); + if ($resql) + { + if (!$notrigger) + { + // Call trigger + $result=$this->call_trigger('EXPENSE_REPORT_VALIDATE',$fuser); - if ($result < 0) { - $error++; + if ($result < 0) { + $error++; + } + // End call triggers + } + + if (! $error) + { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) + // in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->expensereport->dir_output.'/'.$oldref; + $dirdest = $conf->expensereport->dir_output.'/'.$newref; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles=dol_dir_list($conf->expensereport->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/')); + foreach($listoffiles as $fileentry) + { + $dirsource=$fileentry['name']; + $dirdest=preg_replace('/^'.preg_quote($oldref,'/').'/',$newref, $dirsource); + $dirsource=$fileentry['path'].'/'.$dirsource; + $dirdest=$fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } } - // End call triggers } + } - if (empty($error)) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - $this->error=$this->db->error(); - return -2; - } - } - else - { + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->statut = self::STATUS_VALIDATED; + } + + if (empty($error)) + { + $this->db->commit(); + return 1; + } + else + { $this->db->rollback(); - $this->error=$this->db->lasterror(); - return -1; - } + $this->error=$this->db->error(); + return -2; + } } else { - dol_syslog(get_class($this)."::setValidate expensereport already with validated status", LOG_WARNING); + $this->db->rollback(); + $this->error=$this->db->lasterror(); + return -1; } return 0; From a288ee65e07f596dbbcca773d2055737f9886a13 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 27 Aug 2017 18:02:35 +0200 Subject: [PATCH 0178/1137] Add lang trans --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b4cce97957a..b8a6f3e0701 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1632,6 +1632,7 @@ ExpenseReportsSetup=Setup of module Expense Reports TemplatePDFExpenseReports=Document templates to generate expense report document ExpenseReportsIkSetup=Setup of module Expense Reports - Milles index ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules +ExpenseReportNumberingModules=Expense reports numbering module NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only. YouMayFindNotificationsFeaturesIntoModuleNotification=You may find options for EMail notifications by enabling and configuring the module "Notification". ListOfNotificationsPerUser=List of notifications per user* From f33289ed6a486671d7e7cd777b3f04634a430123 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 19:15:06 +0200 Subject: [PATCH 0179/1137] Better examples --- htdocs/core/modules/DolibarrModules.class.php | 9 ++++++- .../core/modules/modMyModule.class.php | 25 +++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 7ef1143b9f8..c1c42d2fb40 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1486,7 +1486,14 @@ class DolibarrModules // Can not be abstract, because we need to insta $sql.= ")"; dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG); - $this->db->query($sql); + $resql = $this->db->query($sql); + if (! $resql) + { + $err++; + $this->error = $this->db->lasterror(); + $this->errors[] = $this->db->lasterror(); + break; + } } $i++; } diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 00199f1d3a4..6892bcab104 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -125,13 +125,22 @@ class modMyModule extends DolibarrModules 1=>array('MYMODULE_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) ); + + if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled)) + { + $conf->mymodule=new stdClass(); + $conf->mymodule->enabled=0; + } + + // Array to add new pages in new tabs - // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 - // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. - // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname - // Can also be: $this->tabs = array('data'=>'...', 'entity'=>0); + $this->tabs = array(); + // Example: + // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 + // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname // - // where objecttype can be + // Where objecttype can be // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) // 'contact' to add a tab in contact view // 'contract' to add a tab in contract view @@ -151,13 +160,7 @@ class modMyModule extends DolibarrModules // 'stock' to add a tab in stock view // 'thirdparty' to add a tab in third party view // 'user' to add a tab in user view - $this->tabs = array(); - if (! isset($conf->mymodule) || ! isset($conf->mymodule->enabled)) - { - $conf->mymodule=new stdClass(); - $conf->mymodule->enabled=0; - } // Dictionaries $this->dictionaries=array(); From 1b1ce4fdf577fcc9218005d415d6bf403aeecfd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2017 19:40:43 +0200 Subject: [PATCH 0180/1137] Code comment --- htdocs/core/lib/functions.lib.php | 1 + htdocs/core/modules/DolibarrModules.class.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7d654104257..419c8ec18de 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5889,6 +5889,7 @@ function picto_from_langcode($codelang) * 'supplier_invoice' to add a tab in supplier invoice view * 'invoice' to add a tab in customer invoice view * 'order' to add a tab in customer order view + * 'contract' to add a tabl in contract view * 'product' to add a tab in product view * 'propal' to add a tab in propal view * 'user' to add a tab in user view diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index c1c42d2fb40..c41a889d10e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1489,10 +1489,14 @@ class DolibarrModules // Can not be abstract, because we need to insta $resql = $this->db->query($sql); if (! $resql) { - $err++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->db->lasterror(); - break; + dol_syslog($this->db->lasterror(), LOG_ERR); + if ($this->db->lasterrno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $this->error = $this->db->lasterror(); + $this->errors[] = $this->db->lasterror(); + $err++; + break; + } } } $i++; From b12800d174e92dfda5d34e8c22f22e793ee786da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Aug 2017 00:06:19 +0200 Subject: [PATCH 0181/1137] FIX link in to email and option for tls --- htdocs/core/class/CMailFile.class.php | 10 ++++++++++ htdocs/core/class/smtps.class.php | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index b05b8a162a1..d4d0206b965 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -170,6 +170,16 @@ class CMailFile $this->msgishtml = $msgishtml; } + global $dolibarr_main_url_root; + + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + // Replace relative /viewimage to absolute path + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html. // Detect images diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index cfaa88363a4..7ddb71315b7 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -455,7 +455,21 @@ class SMTPs $this->_setErr(131, 'STARTTLS connection is not supported.'); return $_retVal; } - if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + + // Before 5.6.7: + // STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_SSLv2_CLIENT|STREAM_CRYPTO_METHOD_SSLv3_CLIENT + // STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + // PHP >= 5.6.7: + // STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + // STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT + + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + if (!stream_socket_enable_crypto($this->socket, true, $crypto_method)) { $this->_setErr(132, 'STARTTLS connection failed.'); return $_retVal; From b4769d37d69bd1f8a0e70950a75cb328ebd5565b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Aug 2017 00:06:38 +0200 Subject: [PATCH 0182/1137] Increase emailing title length --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 5 ++++- htdocs/install/mysql/tables/llx_mailing.sql | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 68cfa63fa16..d2ce0d2f525 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -25,7 +25,10 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); -ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64); +ALTER TABLE llx_mailing MODIFY COLUMN titre varchar(128); +ALTER TABLE llx_mailing MODIFY COLUMN sujet varchar(128); + +ALTER TABLE llx_mailing MODIFY COLUMN langs varchar(64); ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL; ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date; diff --git a/htdocs/install/mysql/tables/llx_mailing.sql b/htdocs/install/mysql/tables/llx_mailing.sql index 33d14856f5c..a365aba0be1 100644 --- a/htdocs/install/mysql/tables/llx_mailing.sql +++ b/htdocs/install/mysql/tables/llx_mailing.sql @@ -27,9 +27,9 @@ create table llx_mailing ( rowid integer AUTO_INCREMENT PRIMARY KEY, statut smallint DEFAULT 0, -- - titre varchar(60), -- Ref of mailing + titre varchar(128), -- Ref of mailing entity integer DEFAULT 1 NOT NULL, -- multi company id - sujet varchar(60), -- Sujet of mailing + sujet varchar(128), -- Sujet of mailing body mediumtext, bgcolor varchar(8), -- Backgroud color of mailing bgimage varchar(255), -- Backgroud image of mailing From c382ca22b8723c0ed760b439ccc2b087f92315a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Aug 2017 00:06:19 +0200 Subject: [PATCH 0183/1137] FIX link in to email and option for tls --- htdocs/core/class/CMailFile.class.php | 10 ++++++++++ htdocs/core/class/smtps.class.php | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 3b3efe96fb0..8f53d0221fb 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -170,6 +170,16 @@ class CMailFile $this->msgishtml = $msgishtml; } + global $dolibarr_main_url_root; + + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + // Replace relative /viewimage to absolute path + $msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep); + if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html. // Detect images diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index c92558bf1d3..cb894a81fb5 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -451,7 +451,21 @@ class SMTPs $this->_setErr(131, 'STARTTLS connection is not supported.'); return $_retVal; } - if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + + // Before 5.6.7: + // STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_SSLv2_CLIENT|STREAM_CRYPTO_METHOD_SSLv3_CLIENT + // STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + // PHP >= 5.6.7: + // STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + // STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT + + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + if (!stream_socket_enable_crypto($this->socket, true, $crypto_method)) { $this->_setErr(132, 'STARTTLS connection failed.'); return $_retVal; From afdc96ef26b3ffd70a2fe74e7f927b958360e7da Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 28 Aug 2017 06:10:28 +0200 Subject: [PATCH 0184/1137] New : Add search field for date on supplier payment page --- htdocs/fourn/facture/paiement.php | 53 +++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 0b401e35fd5..2ede6014be2 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * 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 @@ -33,18 +34,23 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->load('companies'); $langs->load('bills'); $langs->load('banks'); $langs->load('compta'); -$action = GETPOST('action','alpha'); +// Security check +$action = GETPOST('action','alpha'); $confirm = GETPOST('confirm'); - -$facid=GETPOST('facid','int'); -$socid=GETPOST('socid','int'); +$facid = GETPOST('facid','int'); +$socid = GETPOST('socid','int'); $accountid = GETPOST('accountid'); +$day = GETPOST('day','int'); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); $search_ref=GETPOST("search_ref","int"); $search_account=GETPOST("search_account","int"); @@ -316,6 +322,7 @@ $invoicesupplierstatic = new FactureFournisseur($db); llxHeader('',$langs->trans('ListPayment')); $form=new Form($db); +$formother=new FormOther($db); if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement') { @@ -747,6 +754,19 @@ if (empty($action)) if (!$user->rights->societe->client->voir) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid > 0) $sql .= ' AND f.fk_soc = '.$socid; // Search criteria + if ($month > 0) + { + if ($year > 0 && empty($day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(p.datep, '%m') = '".$month."'"; + } + else if ($year > 0) + { + $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + } if ($search_ref) $sql .= natural_search('p.rowid', $search_ref); if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; @@ -776,6 +796,9 @@ if (empty($action)) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($day) $param.=($day?"&day=".urlencode($day):""); + if ($month) $param.=($month?"&month=".urlencode($month):""); + if ($year) $param.=($year?"&year=".urlencode($year):""); if ($search_ref) $param.=($search_ref?"&search_ref=".urlencode($search_ref):""); if ($search_company) $param.=($search_company?"&search_company=".urlencode($search_company):""); if ($search_amount != '') $param.=($search_amount?"&search_amount=".urlencode($search_amount):""); @@ -797,7 +820,7 @@ if (empty($action)) if ($optioncss != '') print ''; print ''; print ''; - print ''; + // print ''; print ''; print ''; print ''; @@ -827,7 +850,11 @@ if (empty($action)) print ''; print ''; print ''; - print ' '; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year?$year:-1,'year',1, 20, 5); + print ''; print ''; print ''; print ''; @@ -850,14 +877,14 @@ if (empty($action)) print "\n"; print ''; - print_liste_field_titre('RefPayment',$_SERVER["PHP_SELF"],'p.rowid','',$param,'',$sortfield,$sortorder); - print_liste_field_titre('Date',$_SERVER["PHP_SELF"],'dp','',$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('ThirdParty',$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); - print_liste_field_titre('Type',$_SERVER["PHP_SELF"],'c.libelle','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],'p.rowid','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Date",$_SERVER["PHP_SELF"],'dp','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Type",$_SERVER["PHP_SELF"],'c.libelle','',$param,'',$sortfield,$sortorder); print_liste_field_titre("Numero",$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder); - print_liste_field_titre('Account',$_SERVER["PHP_SELF"],'ba.label','',$param,'',$sortfield,$sortorder); - print_liste_field_titre('Amount',$_SERVER["PHP_SELF"],'p.amount','',$param,'align="right"',$sortfield,$sortorder); - //print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Account",$_SERVER["PHP_SELF"],'ba.label','',$param,'',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],'p.amount','',$param,'align="right"',$sortfield,$sortorder); + //print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; From f6604f657840c75cf3aab3c0b8b9a0746adef1a6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 28 Aug 2017 06:16:31 +0200 Subject: [PATCH 0185/1137] Fix: Search on supplier payment list doesn't work --- htdocs/fourn/facture/paiement.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 0b401e35fd5..8cdf538126a 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -797,7 +797,6 @@ if (empty($action)) if ($optioncss != '') print ''; print ''; print ''; - print ''; print ''; print ''; print ''; From b3642708b37ddcf5ba7d205163b88c6476a00821 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 28 Aug 2017 08:28:58 +0200 Subject: [PATCH 0186/1137] Fix: better for responsive background image --- htdocs/core/tpl/login.tpl.php | 2 +- htdocs/core/tpl/passwordforgotten.tpl.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 35f6f857526..bcf62d40460 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -49,7 +49,7 @@ print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disable ?> -global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> +global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> dol_use_jmobile)) { ?> '; } + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index ddb44153e49..6d62f6c129a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1467,7 +1467,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; - // Client + // Thirdparty print ''; print '' . $langs->trans('Customer') . ''; if ($socid > 0) { @@ -1491,6 +1491,7 @@ if ($action == 'create' && $user->rights->commande->creer) }); '; } + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 731b8aafec6..5a9dad480a0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2195,7 +2195,7 @@ if ($action == 'create') // Thirdparty print '' . $langs->trans('Customer') . ''; - if ($soc->id > 0 && ! GETPOST('fac_rec')) + if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) { print ''; print $soc->getNomUrl(1); @@ -2210,6 +2210,7 @@ if ($action == 'create') print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); } print ')'; + print ' '.$langs->trans("AddThirdParty").''; print ''; } else @@ -2230,6 +2231,7 @@ if ($action == 'create') }); '; } + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index ce3915cf2ee..a39698cd815 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1153,6 +1153,7 @@ if ($action == 'create') { print ''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); + print ' '.$langs->trans("AddThirdParty").''; print ''; } print ''."\n"; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 56566438206..07e551fcd71 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1459,6 +1459,7 @@ if ($action=='create') }); '; } + print ' '.$langs->trans("AddThirdParty").''; } print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a3d396e75a1..1b78d7e399b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1487,6 +1487,7 @@ if ($action == 'create') }); '; } + print ' '.$langs->trans("AddThirdParty").''; } print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index cfb8ca52234..19f0c6c08f3 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1063,6 +1063,7 @@ if ($action == 'create') } else { print ''; print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; From 07f7db1b6d17de941b9473853729ddc38b003bb2 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 29 Aug 2017 11:22:50 +0200 Subject: [PATCH 0193/1137] FIX createFromCurrent lastvalue --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 221f224e043..efb55f9b64c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -783,7 +783,7 @@ class Facture extends CommonInvoice $facture->situation_final = $this->situation_final; // Loop on each line of new invoice - foreach($facture->lines as $i => $line) + foreach($facture->lines as $i => &$line) { $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; if ($invertdetail) From 9312005318fc1875db50019f09f4928721197ca8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 12:43:47 +0200 Subject: [PATCH 0194/1137] NEW Move accountancy features into a dedicated menu --- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 145 +++++++++--------- htdocs/core/menus/standard/auguria.lib.php | 9 +- htdocs/core/menus/standard/eldy.lib.php | 90 +++++++---- htdocs/core/modules/modMargin.class.php | 4 +- .../install/mysql/migration/6.0.0-7.0.0.sql | 2 + htdocs/install/mysql/tables/llx_menu.sql | 4 +- htdocs/langs/en_US/compta.lang | 2 +- htdocs/theme/eldy/style.css.php | 4 + htdocs/theme/md/style.css.php | 4 + 10 files changed, 154 insertions(+), 112 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index c97bd21e250..b836a6552ef 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -187,7 +187,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker } // Add line buf to buffer if not a comment - if (! preg_match('/^--/',$buf)) + if (! preg_match('/^\s*--/',$buf)) { $buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer $buffer .= trim($buf); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index cf51976298b..a4b6bfaa3bd 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -12,7 +12,8 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 2, 51, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import|opensurvey|resource', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read', '', 2, 90, __ENTITY__); @@ -163,56 +164,56 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?action=create&leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 2, __ENTITY__); --- Accountancy - Supplier invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'accountancy', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'accountancy', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'accountancy', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); --- Accountancy - Customer invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'accountancy', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); +-- Billing - Supplier invoice +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); +-- Billing - Customer invoice +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/fiche-rec.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'accountancy', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'accountancy', '', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?leftmenu=customers_bills', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'accountancy', '', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); --- Accountancy - Orders to bill -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'accountancy', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', '', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?leftmenu=customers_bills', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); +-- Billing - Orders to bill +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'accountancy', 'donations', 6__+MAX_llx_menu__, '/don/index.php?leftmenu=donations&mainmenu=accountancy', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=accountancy', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); --- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'accountancy', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=accountancy', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?leftmenu=donations&mainmenu=billing', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?leftmenu=donations&mainmenu=billing&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&mainmenu=billing', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); +-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'accountancy', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'accountancy', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy', 'Salaries', 1, 'salaries', '$user->rights->salaries->payment->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'accountancy', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->payment->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'accountancy', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'accountancy', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'accountancy', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'accountancy', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'accountancy', 'tax_various', 2200__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=accountancy', 'MenuVariousPayment', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'accountancy', '', 2350__+MAX_llx_menu__, '/bank/various_payment/card.php?leftmenu=tax_various&action=create', 'MenuNewVariousPayment', 2, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'accountancy', '', 2350__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->payment->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->payment->write', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=billing', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing', 'MenuVariousPayment', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/bank/various_payment/card.php?leftmenu=tax_various&action=create', 'MenuNewVariousPayment', 2, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); -- Accounting Expert -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accountancy', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accountancy', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); -- Setup insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__); @@ -228,36 +229,36 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Accounting period insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 4, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'ventil_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'ventil_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?leftmenu=dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 4, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); -- Journals - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 2, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 3, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 4, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 2, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 3, __ENTITY__); + --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 4, __ENTITY__); -- General Ledger - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); -- Balance - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); -- Reports - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'report', 2400__+MAX_llx_menu__, '/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', '', 2441__+MAX_llx_menu__, '/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy', 'ByAccounts', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', '', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', '', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', '', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', '', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__); --- Rapports compta simple -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByAccounts', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__); +-- Accounting simple +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index fd4d2a4e7f7..5fc0ab2c516 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -351,14 +351,14 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),0,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy'); + $newmenu->add('',$langs->trans("Journalization"),0,$user->rights->accounting->comptarapport->lire,'','accountancy','accountancy'); // Multi journal $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; - $sql.= " active = 1"; - $sql.= " ORDER BY label"; + $sql.= " AND active = 1"; + $sql.= " ORDER BY label DESC"; $resql = $db->query($sql); if ($resql) @@ -373,6 +373,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $objp = $db->fetch_object($resql); $nature=''; + // Must match array $sourceList defined into journals_list.php if ($objp->nature == 2 && ! empty($conf->facture->enabled)) $nature="sells"; if ($objp->nature == 3 && ! empty($conf->fournisseur->enabled)) $nature="purchases"; @@ -382,7 +383,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists - if (empty($conf->global->MAIN_FEATURES_LEVEL)) + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($nature == 'various' || $nature == 'hasnew') $nature=''; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 38232a73876..8d22592fd14 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -138,10 +138,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $langs->trans("Commercial"), 0, $showmode, $atarget, "commercial", "", 40, $id, $idsel, $classname); } - // Financial + // Billing - Financial $menuqualified=0; - if (! empty($conf->comptabilite->enabled)) $menuqualified++; - if (! empty($conf->accounting->enabled)) $menuqualified++; if (! empty($conf->facture->enabled)) $menuqualified++; if (! empty($conf->don->enabled)) $menuqualified++; if (! empty($conf->tax->enabled)) $menuqualified++; @@ -151,8 +149,29 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->banque->enabled)) $menuqualified++; $tmpentry=array( 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->banque->lire)), - 'module'=>'comptabilite|accounting|facture|supplier_invoice|don|tax|salaries|loan|banque'); + 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->banque->lire)), + 'module'=>'facture|supplier_invoice|don|tax|salaries|loan|banque'); + $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); + if ($showmode) + { + $langs->load("compta"); + + $classname=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "billing") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } + else $classname = 'class="tmenu"'; + $idsel='billing'; + + $menu->add('/compta/index.php?mainmenu=billing&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "billing", '', 50, $id, $idsel, $classname); + } + + // Accounting + $menuqualified=0; + if (! empty($conf->comptabilite->enabled)) $menuqualified++; + if (! empty($conf->accounting->enabled)) $menuqualified++; + $tmpentry=array( + 'enabled'=>$menuqualified, + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire)), + 'module'=>'comptabilite|accounting'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { @@ -163,9 +182,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='accountancy'; - $menu->add('/compta/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "accountancy", '', 50, $id, $idsel, $classname); + $menu->add('/accountancy/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("Accountancy"), 0, $showmode, $atarget, "accountancy", '', 50, $id, $idsel, $classname); } + // Bank $tmpentry=array('enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)), 'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)), @@ -771,7 +791,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu /* * Menu COMPTA-FINANCIAL */ - if ($mainmenu == 'accountancy') + if ($mainmenu == 'billing') { $langs->load("companies"); @@ -848,7 +868,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->don->enabled)) { $langs->load("donations"); - $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); + $newmenu->add("/don/index.php?leftmenu=donations&mainmenu=billing",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations'); if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/card.php?leftmenu=donations&action=create",$langs->trans("NewDonation"), 1, $user->rights->don->creer); if ($usemenuhider || empty($leftmenu) || $leftmenu=="donations") $newmenu->add("/don/list.php?leftmenu=donations",$langs->trans("List"), 1, $user->rights->don->lire); // if ($leftmenu=="donations") $newmenu->add("/don/stats/index.php",$langs->trans("Statistics"), 1, $user->rights->don->lire); @@ -860,7 +880,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu global $mysoc; $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)); - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); // Social contributions if (! empty($conf->tax->enabled)) @@ -868,11 +888,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { - $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); + $newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&mainmenu=billing",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); @@ -883,7 +903,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //Local Taxes 1 if($mysoc->useLocalTax(1) && (isset($mysoc->localtax1_assuj) && $mysoc->localtax1_assuj=="1")) { - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&mainmenu=accountancy&localTaxType=1",$langs->transcountry("LT1",$mysoc->country_code),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_1_vat&mainmenu=billing&localTaxType=1",$langs->transcountry("LT1",$mysoc->country_code),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/card.php?leftmenu=tax_1_vat&action=create&localTaxType=1",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_1_vat&localTaxType=1",$langs->trans("Payments"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_1_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_1_vat&localTaxType=1", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); @@ -892,7 +912,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu //Local Taxes 2 if($mysoc->useLocalTax(2) && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj=="1")) { - $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&mainmenu=accountancy&localTaxType=2",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/localtax/index.php?leftmenu=tax_2_vat&mainmenu=billing&localTaxType=2",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/card.php?leftmenu=tax_2_vat&action=create&localTaxType=2",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/reglement.php?leftmenu=tax_2_vat&localTaxType=2",$langs->trans("Payments"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_2_vat/i',$leftmenu)) $newmenu->add("/compta/localtax/clients.php?leftmenu=tax_2_vat&localTaxType=2", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); @@ -905,7 +925,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy",$langs->trans("Salaries"),1,$user->rights->salaries->payment->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->payment->read, '', $mainmenu, 'tax_salary'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->payment->write); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->payment->read); } @@ -914,20 +934,28 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/index.php?leftmenu=tax_loan&mainmenu=billing",$langs->trans("Loans"),1,$user->rights->loan->read, '', $mainmenu, 'tax_loan'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create",$langs->trans("NewLoan"),2,$user->rights->loan->write); //if (empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) $newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); if (($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i',$leftmenu)) && ! empty($conf->global->LOAN_SHOW_CALCULATOR)) $newmenu->add("/loan/calc.php?leftmenu=tax_loan",$langs->trans("Calculator"),2,$user->rights->loan->calc); } - // Various payment + // Various payment if (! empty($conf->banque->enabled)) { - $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=accountancy",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various'); + $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create",$langs->trans("MenuNewVariousPayment"), 2, $user->rights->banque->modifier); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various",$langs->trans("List"),2,$user->rights->banque->lire); } } + } + + /* + * Menu COMPTA-FINANCIAL + */ + if ($mainmenu == 'accountancy') + { + $langs->load("companies"); // Accounting Expert if (! empty($conf->accounting->enabled)) @@ -938,7 +966,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Chart of account - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 10); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 20); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 30); @@ -974,20 +1002,22 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Binding - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); - + if (! empty($conf->facture->enabled)) + { + $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/',$leftmenu)) $newmenu->add("/accountancy/customer/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); + } if (! empty($conf->supplier_invoice->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); + $newmenu->add("/accountancy/supplier/index.php?leftmenu=accountancy_dispatch_supplier&mainmenu=accountancy",$langs->trans("SuppliersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_supplier'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_supplier/',$leftmenu)) $newmenu->add("/accountancy/supplier/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); } if (! empty($conf->expensereport->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); + $newmenu->add("/accountancy/expensereport/index.php?leftmenu=accountancy_dispatch_expensereport&mainmenu=accountancy",$langs->trans("ExpenseReportsVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_expensereport'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("ToBind"),2,$user->rights->accounting->bind->write); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_expensereport/',$leftmenu)) $newmenu->add("/accountancy/expensereport/lines.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport",$langs->trans("Binded"),2,$user->rights->accounting->bind->write); } @@ -995,7 +1025,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Journals if(! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire); + $newmenu->add('',$langs->trans("Journalization"),1,$user->rights->accounting->comptarapport->lire); // Multi journal $sql = "SELECT rowid, code, label, nature"; @@ -1027,14 +1057,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($objp->nature == 9) $nature="hasnew"; // To enable when page exists - if (empty($conf->global->MAIN_FEATURES_LEVEL)) + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($nature == 'various' || $nature == 'hasnew') $nature=''; } if ($nature) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, dol_trunc($objp->label,25), 2, $user->rights->accounting->comptarapport->lire); + $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, dol_trunc($objp->label,25), 2, $user->rights->accounting->comptarapport->lire); } $i++; } @@ -1080,15 +1110,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // General Ledger - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_generalledger",$langs->trans("Bookkeeping"),1,$user->rights->accounting->mouvements->lire); // Balance - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance",$langs->trans("AccountBalance"),1,$user->rights->accounting->mouvements->lire); // Reports $langs->load("compta"); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?leftmenu=accountancy_report",$langs->trans("ByAccounts"),3,$user->rights->accounting->comptarapport->lire); diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index a04c9ac567a..0a7f1a73a67 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -104,10 +104,10 @@ class modMargin extends DolibarrModules // left menu entry $this->menu[$r]=array( - 'fk_menu'=>'fk_mainmenu=accountancy', // Put 0 if this is a top menu + 'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu 'type'=>'left', // This is a Top menu entry 'titre'=>'Margins', - 'mainmenu'=>'accountancy', + 'mainmenu'=>'billing', 'leftmenu'=>'margins', 'url'=>'/margin/index.php', 'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index d2ce0d2f525..76517914c0e 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -25,6 +25,8 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_menu MODIFY COLUMN perms text; + ALTER TABLE llx_mailing MODIFY COLUMN titre varchar(128); ALTER TABLE llx_mailing MODIFY COLUMN sujet varchar(128); diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index c98dd064cd2..e77584d1c40 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -38,8 +38,8 @@ CREATE TABLE llx_menu titre varchar(255) NOT NULL, -- Key for menu translation langs varchar(100), -- Lang file to load for translation level smallint, -- Deprecated. Not used. - perms varchar(255), -- Condition to show enabled or disabled - enabled varchar(255) NULL default '1', -- Condition to show or hide + perms text, -- Condition to show enabled or disabled + enabled varchar(255) NULL default '1', -- Condition to show or hide usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only tms timestamp diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 4c6dc5bf169..d49256e7c32 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - compta -MenuFinancial=Financial +MenuFinancial=Billing / Payment TaxModuleSetupToModifyRules=Go to Taxes module setup to modify rules for calculation TaxModuleSetupToModifyRulesLT=Go to Company setup to modify rules for calculation OptionMode=Option for accountancy diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index fbbcecf06e0..b2fe6d923e9 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1418,6 +1418,10 @@ div.mainmenu.home{ background-position-x: center; } +div.mainmenu.billing { + background-image: url(); +} + div.mainmenu.accountancy { background-image: url(); } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0a2b15d14cf..4d02f2ea487 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1443,6 +1443,10 @@ div.mainmenu.home{ background-position-x: center; } +div.mainmenu.billing { + background-image: url(); +} + div.mainmenu.accountancy { background-image: url(); } From e9cdf852868a3744b838c1fe762870a4321bcf2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 12:58:18 +0200 Subject: [PATCH 0195/1137] Fxi repeair of collation --- htdocs/install/mysql/migration/repair.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index cd55b7b38e2..e759985b7a8 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -35,7 +35,10 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; - +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) COLLATE utf8_unicode_ci; -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; From 560d975063591c6e018518e86ff0889ce618389c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 12:59:13 +0200 Subject: [PATCH 0196/1137] Code comment --- htdocs/core/lib/admin.lib.php | 6 +++++- htdocs/install/repair.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b836a6552ef..dc359696c98 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -173,7 +173,11 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker } else // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE { - if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)))) $qualified=0; + $dbcollation = strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation)); + //var_dump($reg[2]); + //var_dump($dbcollation); + if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != $dbcollation)) $qualified=0; + //var_dump($qualified); } } } diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 7d9197d10b6..7fc3744e334 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -913,7 +913,7 @@ if ($ok && GETPOST('force_disable_of_modules_not_found','alpha')) // clean_linked_elements: Check and clean linked elements if ($ok && GETPOST('force_utf8_on_tables','alpha')) { - print '
        *** Force page code and collation with utf8 (for mysql/mariadb only)'; + print '
        *** Force page code and collation of tables into utf8 (for mysql/mariadb only)'; if ($db->type == "mysql") { From 22ca29a51febce118d726fdc6f1f0d5a4369c6eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:32:25 +0200 Subject: [PATCH 0197/1137] Fix sql syntax error --- htdocs/core/menus/standard/auguria.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index fd4d2a4e7f7..3d38328249d 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -357,8 +357,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " WHERE entity = ".$conf->entity; - $sql.= " active = 1"; - $sql.= " ORDER BY label"; + $sql.= " AND active = 1"; + $sql.= " ORDER BY label DESC"; $resql = $db->query($sql); if ($resql) From eebaff95cf6a3f2ca9e384a355f1537da8d6b312 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:41:44 +0200 Subject: [PATCH 0198/1137] Fix pb with imagick --- htdocs/core/lib/files.lib.php | 31 +++++++++++++++++++------------ htdocs/core/lib/functions.lib.php | 7 +++++-- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 99b80049999..e3419be0d14 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1565,34 +1565,41 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile= * @param string $fileinput Input file name * @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided). * @param string $fileoutput Output filename - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0=Nothing done, >0 if OK */ function dol_convert_file($fileinput,$ext='png',$fileoutput='') { global $langs; - $image=new Imagick(); - $ret = $image->readImage($fileinput); - if ($ret) + if (class_exists('Imagick')) { - $ret = $image->setImageFormat($ext); + $image=new Imagick(); + $ret = $image->readImage($fileinput); if ($ret) { - if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; + $ret = $image->setImageFormat($ext); + if ($ret) + { + if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; - $count = $image->getNumberImages(); - $ret = $image->writeImages($fileoutput, true); - if ($ret) return $count; - else return -3; + $count = $image->getNumberImages(); + $ret = $image->writeImages($fileoutput, true); + if ($ret) return $count; + else return -3; + } + else + { + return -2; + } } else { - return -2; + return -1; } } else { - return -1; + return 0; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 46796467ae6..4af0679920d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1236,8 +1236,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) ) { - $ret = dol_convert_file($file, 'png', $fileimage); - if ($ret < 0) $error++; + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. + { + $ret = dol_convert_file($file, 'png', $fileimage); + if ($ret < 0) $error++; + } } $heightforphotref=70; From 8f01db10a6a77c5938d1e49d3e95311d1e181aae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:41:55 +0200 Subject: [PATCH 0199/1137] Fix setup for india --- htdocs/install/mysql/data/llx_c_tva.sql | 4 ++-- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index df533f39db0..cce279d79da 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -138,8 +138,8 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (11 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',0); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0', 0); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST' , 0, 0, '0', 16, '1', 0, 'SGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'CGST+SGST', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'IGST' , 18, 0, '0', 0, '0', 0, 'IGST', 1); -- IRELAND (id country=8) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1); diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index e41e561da38..b1a7088062d 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -582,6 +582,5 @@ ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); - -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST-CGST', 8, 8, '1', 0, '0', 0, 'IGST-CGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'CGST+SGST', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'IGST' , 18, 0, '0', 0, '0', 0, 'IGST', 1); From 7218a9de0ebb781f0a73dfdedae3dbb6beb83925 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 13:52:24 +0200 Subject: [PATCH 0200/1137] Fix translation of total VAT --- .../commande/doc/pdf_einstein.modules.php | 30 +++++++++---------- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 24 +++++++-------- .../pdf/pdf_canelle.modules.php | 4 +-- .../pdf/pdf_muscadet.modules.php | 8 ++--- .../doc/pdf_aurore.modules.php | 14 ++++----- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 396ac54e9b5..785e4361c04 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -45,28 +45,28 @@ class pdf_einstein extends ModelePDFCommandes * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.3 = array(5, 3) */ - public $phpmin = array(5, 2); - + public $phpmin = array(5, 2); + /** * Dolibarr version of the loaded document * @public string @@ -240,11 +240,11 @@ class pdf_einstein extends ModelePDFCommandes $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -317,16 +317,16 @@ class pdf_einstein extends ModelePDFCommandes $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - + // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - + $tab_top = $nexY+6; $height_incoterms += 4; } } - + // Affiche notes $notetoshow=empty($object->note_public)?'':$object->note_public; if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) @@ -478,7 +478,7 @@ class pdf_einstein extends ModelePDFCommandes // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -585,7 +585,7 @@ class pdf_einstein extends ModelePDFCommandes $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); } */ - + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); @@ -953,7 +953,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1294,7 +1294,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 092ae36fe28..491b7562408 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1176,7 +1176,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d2ecfb60d81..621e2af3218 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -273,7 +273,7 @@ class pdf_azur extends ModelePDFPropales $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $pdf->SetAutoPageBreak(1,0); - + if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -322,19 +322,19 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - + $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE)?(pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature"))+10):0; $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; - + //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; + $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - + $tab_top = 90; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); $tab_height = 130; @@ -383,7 +383,7 @@ class pdf_azur extends ModelePDFPropales $notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs); if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email; if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone; - } + } if ($notetoshow) { $tab_top = 88 + $height_incoterms; @@ -552,14 +552,14 @@ class pdf_azur extends ModelePDFPropales // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; $localtax2_rate=$object->lines[$i]->localtax2_tx; $localtax1_type=$object->lines[$i]->localtax1_type; - $localtax2_type=$object->lines[$i]->localtax2_type; - + $localtax2_type=$object->lines[$i]->localtax2_type; + if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; @@ -667,7 +667,7 @@ class pdf_azur extends ModelePDFPropales { $posy=$this->_signature_area($pdf, $object, $posy, $outputlangs); } - + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); @@ -1103,7 +1103,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1479,7 +1479,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 1e7e6f4bcad..36750226a0d 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -620,7 +620,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -632,7 +632,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index c882ed89800..0365eb2bfb4 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -439,7 +439,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -718,7 +718,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -730,7 +730,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); @@ -1124,7 +1124,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=1; $pdf->SetTextColor(0,0,60); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index a7e8952c604..0982a18f3d0 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -177,7 +177,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } - + $realpath=''; foreach ($objphoto->liste_photos($dir,1) as $key => $obj) { @@ -445,7 +445,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($up_excl_tax > 0) $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); */ - + // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); @@ -466,11 +466,11 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($total_excl_tax > 0) $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); */ - + // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -941,7 +941,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1035,7 +1035,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $resteapayer = $object->total_ttc - $deja_regle; if (! empty($object->paye)) $resteapayer=0; */ - + if ($deja_regle > 0) { $index++; @@ -1297,7 +1297,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects From d96a83adaccf74d19bea6ccd1be54d6e6d2cb093 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 16:37:00 +0200 Subject: [PATCH 0201/1137] Fix bad total included tax when mutlicurrency is on --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 2 +- htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 785e4361c04..c87a66de791 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1035,7 +1035,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 491b7562408..c473740a05d 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1270,7 +1270,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 621e2af3218..9a928a7ce2b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1186,7 +1186,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 36750226a0d..8737c39f67f 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -723,7 +723,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 0365eb2bfb4..8380ff65e9a 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -829,7 +829,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('','', $default_font_size - 1); From e862ba9daf02bab51a5876e182d8bd4e566d6142 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 17:22:03 +0200 Subject: [PATCH 0202/1137] NEW Add detail of all tax rates into pdf column tax sale. --- htdocs/core/lib/pdf.lib.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 5b344056efb..e4fa52e787f 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1470,7 +1470,7 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) */ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { - global $hookmanager; + global $conf, $hookmanager, $mysoc; $result=''; $reshook=0; @@ -1487,7 +1487,32 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) } if (empty($reshook)) { - if (empty($hidedetails) || $hidedetails > 1) $result.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + if (empty($hidedetails) || $hidedetails > 1) + { + $tmpresult=''; + + $tmpresult.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + if (empty($conf->PDF_MAIN_HIDE_SECOND_TAX)) + { + if ($object->lines[$i]->total_localtax1 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax1),1); + } + } + if (empty($conf->PDF_MAIN_HIDE_THIRD_TAX)) + { + if ($object->lines[$i]->total_localtax2 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax2),1); + } + } + + $result.=$tmpresult; + } } return $result; } From dabd8820560c549355456e78498b07a2cde1e3df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 17:24:49 +0200 Subject: [PATCH 0203/1137] Use a slash --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index e4fa52e787f..7e282c3667d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1496,7 +1496,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { if ($object->lines[$i]->total_localtax1 != 0) { - if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax1),1); } @@ -1505,7 +1505,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { if ($object->lines[$i]->total_localtax2 != 0) { - if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='+'; + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax2),1); } From 044feab00fd887d226e64863475b945861589cc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 17:52:10 +0200 Subject: [PATCH 0204/1137] Fix duplicate code --- htdocs/holiday/list.php | 55 ++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 8541454e549..9c7ff195018 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -260,9 +260,16 @@ if ($id > 0) dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); - print '
        '; + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + print '
        '; - print '
        '; + print '
        '; + + showMyBalance($holiday, $user_id); + } + + dol_fiche_end(); } else { @@ -270,23 +277,43 @@ else //print count($holiday->holiday); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, count($holiday->holiday), 'title_hrm.png', 0, '', '', $limit); - dol_fiche_head(''); + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + dol_fiche_head(''); + + showMyBalance($holiday, $user_id); + + dol_fiche_end(); + } } -$alltypeleaves=$holiday->getTypes(1,-1); // To have labels -$out=''; -$typeleaves=$holiday->getTypes(1,1); -foreach($typeleaves as $key => $val) + +/** + * Show balance of user + * + * @param Holiday $holiday Object $holiday + * @param int $user_id User id + * @return string Html code with balance + */ +function showMyBalance($holiday, $user_id) { - $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); - $nb_holiday += $nb_type; - $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
        '; -} -print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
        '; -print $out; + global $conf, $langs; + + $alltypeleaves=$holiday->getTypes(1,-1); // To have labels + + $out=''; + $typeleaves=$holiday->getTypes(1,1); + foreach($typeleaves as $key => $val) + { + $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); + $nb_holiday += $nb_type; + $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
        '; + } + print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
        '; + print $out; +} -dol_fiche_end(); if ($id > 0) print '
        '; From 945fb61e591193c3c8bf92a3004426facfc7120d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 18:22:01 +0200 Subject: [PATCH 0205/1137] Update facture.class.php --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index efb55f9b64c..b5a399675e7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -783,7 +783,7 @@ class Facture extends CommonInvoice $facture->situation_final = $this->situation_final; // Loop on each line of new invoice - foreach($facture->lines as $i => &$line) + foreach($facture->lines as $i => $tmpline) { $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; if ($invertdetail) From 8f34de1036680906ebdb8c05e6460077b5dc4b43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 19:44:35 +0200 Subject: [PATCH 0206/1137] NEW Can include tag {uuu} into some numbering masks to replace with user --- htdocs/core/lib/functions2.lib.php | 30 ++++++++++++++++++- .../expensereport/mod_expensereport_jade.php | 11 +++++-- .../expensereport/mod_expensereport_sand.php | 30 ++++++++++++++----- .../core/modules/modExpenseReport.class.php | 7 +++++ .../class/expensereport.class.php | 22 +++++++++----- 5 files changed, 80 insertions(+), 20 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 181e8a7fe11..40dcb1fe77d 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -707,9 +707,10 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti * @param string $date Date to use for the {y},{m},{d} tags. * @param string $mode 'next' for next value or 'last' for last value * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany) + * @param User $objuser Object user we need data from. * @return string New value (numeric) or error message */ -function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true) +function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true, $objuser=null) { global $conf,$user; @@ -780,6 +781,22 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $masktype_value=''; } + // Extract value for user + if (preg_match('/\{(u+)\}/i',$mask,$regType)) + { + $lastname = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; + if (is_object($objuser)) $lastname = $objuser->lastname; + + $maskuser=$regType[1]; + $maskuser_value=substr($lastname,0,dol_strlen($regType[1]));// get n first characters of user firstname (where n is length in mask) + $maskuser_value=str_pad($maskuser_value,dol_strlen($regType[1]),"#",STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask + } + else + { + $maskuser=''; + $maskuser_value=''; + } + // Personalized field {XXX-1} à {XXX-9} /*$maskperso=array(); $maskpersonew=array(); @@ -805,6 +822,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskwithonlyymcode=preg_replace('/\{dd\}/i','dd',$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{(c+)(0*)\}/i',$maskrefclient,$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{(t+)\}/i',$masktype_value,$maskwithonlyymcode); + $maskwithonlyymcode=preg_replace('/\{(u+)\}/i',$maskuser_value,$maskwithonlyymcode); /*foreach($maskperso as $key => $val) { $maskwithonlyymcode=preg_replace('/'.$val.'/i', $maskpersonew[$key], $maskwithonlyymcode); @@ -951,6 +969,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),str_pad("",dol_strlen($maskcounter),"_"),$maskLike); if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); + if ($maskuser) $maskLike = str_replace(dol_string_nospecial('{'.$maskuser.'}'),$maskuser_value,$maskLike); // Get counter in database $counter=0; @@ -994,6 +1013,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); + if ($maskuser) $maskLike = str_replace(dol_string_nospecial('{'.$maskuser.'}'),$maskuser_value,$maskLike); $ref=''; $sql = "SELECT ".$field." as ref"; @@ -1114,6 +1134,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $masktype_maskafter=$masktype_value; $numFinal = str_replace($masktype_maskbefore,$masktype_maskafter,$numFinal); } + + // Now we replace the user + if ($maskuser) + { + $maskuser_maskbefore='{'.$maskuser.'}'; + $maskuser_maskafter=$maskuser_value; + $numFinal = str_replace($maskuser_maskbefore,$maskuser_maskafter,$numFinal); + } } dol_syslog("functions2::get_next_value return ".$numFinal,LOG_DEBUG); diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php index 3ccfc8748cb..ae70a60dbf3 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php @@ -118,11 +118,16 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport else { dol_syslog("mod_expensereport_jade::getNextValue", LOG_DEBUG); - return -1; + return 0; + } + + $date=$object->date_valid; // $object->date does not exists + if (empty($date)) + { + $this->error = 'Date valid not defined'; + return 0; } - //$date=time(); - $date=$object->date; $yymm = strftime("%y%m",$date); if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 9a638694665..4222bf163d5 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -82,12 +82,13 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport */ function getExample() { - global $conf,$langs,$mysoc; + global $conf,$langs,$user; - $old_code_client=$mysoc->code_client; - $mysoc->code_client='CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc,''); - $mysoc->code_client=$old_code_client; + $exp=new ExpenseReport($this->db); + $exp->initAsSpecimen(); + $exp->fk_user_author = $user->id; + + $numExample = $this->getNextValue($exp); if (! $numExample) { @@ -99,11 +100,10 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport /** * Return next free value * - * @param Societe $objsoc Object thirdparty * @param Object $object Object we need next value for * @return string Value if KO, <0 if KO */ - function getNextValue($objsoc,$object) + function getNextValue($object) { global $db,$conf; @@ -118,7 +118,21 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport return 0; } - $numFinal=get_next_value($db,$mask,'expensereport','ref','',$objsoc,$object->date); + $date=$object->date_valid; // $object->date does not exists + if (empty($date)) + { + $this->error = 'Date valid not defined'; + return 0; + } + + $fuser = null; + if ($object->fk_user_author > 0) + { + $fuser=new User($db); + $fuser->fetch($object->fk_user_author); + } + + $numFinal=get_next_value($db,$mask,'expensereport','ref','',null, $date, 'next', true, $fuser); return $numFinal; } diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 571c2b2e28a..087828b6cc4 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -80,6 +80,13 @@ class modExpenseReport extends DolibarrModules $this->const[$r][4] = 0; $r++; + $this->const[$r][0] = "EXPENSEREPORT_ADDON"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "mod_expensereport_jade"; + $this->const[$r][3] = 'Name of manager to generate expense report ref number'; + $this->const[$r][4] = 0; + $r++; + $this->const[$r][0] = "MAIN_DELAY_EXPENSEREPORTS"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "15"; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 1e4d7e3bba1..0123535ebb1 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -730,6 +730,7 @@ class ExpenseReport extends CommonObject $this->date_create = $now; $this->date_debut = $now; $this->date_fin = $now; + $this->date_valid = $now; $this->date_approve = $now; $type_fees_id = 2; // TF_TRIP @@ -1060,14 +1061,17 @@ class ExpenseReport extends CommonObject global $conf,$langs,$user; $error = 0; - + $now = dol_now(); + // Protection if ($this->statut == self::STATUS_VALIDATED) { dol_syslog(get_class($this)."::valid action abandonned: already validated", LOG_WARNING); return 0; } - + + $this->date_valid = $now; // Required for the getNextNum later. + // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { @@ -1077,16 +1081,17 @@ class ExpenseReport extends CommonObject { $num = $this->ref; } + if (empty($num)) return -1; + $this->newref = $num; - - $now = dol_now(); + $this->db->begin(); // Validate $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql.= " SET ref = '".$num."',"; $sql.= " fk_statut = ".self::STATUS_VALIDATED.","; - $sql.= " date_valid='".$this->db->idate($now)."',"; + $sql.= " date_valid='".$this->db->idate($this->date_valid)."',"; $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; @@ -1112,7 +1117,7 @@ class ExpenseReport extends CommonObject if (preg_match('/^[\(]?PROV/i', $this->ref)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - + // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) // in order not to lose the attachments $oldref = dol_sanitizeFileName($this->ref); @@ -1122,7 +1127,7 @@ class ExpenseReport extends CommonObject if (file_exists($dirsource)) { dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); - + if (@rename($dirsource, $dirdest)) { dol_syslog("Rename ok"); @@ -1505,13 +1510,14 @@ class ExpenseReport extends CommonObject else { $this->error=$obj->error; + $this->errors=$obj->errors; //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); return ""; } } else { - print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_ADDON_NotDefined"); + print $langs->trans("Error")." ".$langs->trans("Error_EXPENSEREPORT_ADDON_NotDefined"); return ""; } } From 6c202c5fa1910347f66ec85eaef35938bd5d7133 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 19:55:49 +0200 Subject: [PATCH 0207/1137] Fix vat rate to show and not vat amount --- htdocs/core/lib/pdf.lib.php | 10 +++++----- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/en_US/main.lang | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 7e282c3667d..77f295bd813 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1491,23 +1491,23 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { $tmpresult=''; - $tmpresult.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + $tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1); if (empty($conf->PDF_MAIN_HIDE_SECOND_TAX)) { - if ($object->lines[$i]->total_localtax1 != 0) + if ($object->lines[$i]->localtax1_tx != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; - $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax1),1); + $tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1); } } if (empty($conf->PDF_MAIN_HIDE_THIRD_TAX)) { - if ($object->lines[$i]->total_localtax2 != 0) + if ($object->lines[$i]->localtax2_tx != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; - $tmpresult.=vatrate(abs($object->lines[$i]->total_localtax2),1); + $tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx),1); } } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b03b8ad37bb..8dfc02c49f1 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -195,6 +195,7 @@ ErrorNoWarehouseDefined=Error, no warehouses defined. ErrorBadLinkSourceSetButBadValueForRef=The link you use is not valid. A 'source' for payment is defined, but value for 'ref' is not valid. ErrorTooManyErrorsProcessStopped=Too many errors. Process was stopped. ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action. +ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not # Warnings WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 8d180568073..b8544ee3eda 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -657,8 +657,8 @@ Page=Page Notes=Notes AddNewLine=Add new line AddFile=Add file -FreeZone=Free entry -FreeLineOfType=Free entry of type +FreeZone=Not a predefined product/service +FreeLineOfType=Not a predefined entry of type CloneMainAttributes=Clone object with its main attributes PDFMerge=PDF Merge Merge=Merge From 991a33f7b67a34a0e7aee41f473cbfe36661adae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Aug 2017 20:40:51 +0200 Subject: [PATCH 0208/1137] Make different vat rates visible --- htdocs/core/lib/functions.lib.php | 8 +++++- htdocs/core/tpl/objectline_view.tpl.php | 33 ++++++++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4af0679920d..d79c3def247 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3702,7 +3702,13 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) $info_bits |= 1; } - $ret=price($rate,0,'',0,0).($addpercent?'%':''); + // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price() + if (! preg_match('/\//', $rate)) $ret=price($rate,0,'',0,0).($addpercent?'%':''); + else + { + // TODO Split on / and output with a price2num to have clean numbers with ton of 000. + $ret=$rate.($addpercent?'%':''); + } if ($info_bits & 1) $ret.=' *'; $ret.=$morelabel; return $ret; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index c347c693691..5cfe2459247 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -32,7 +32,7 @@ * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) * $object_rights->creer initialized from = $object->getRights() * $disableedit, $disablemove, $disableremove - * + * * $type, $text, $description, $line */ @@ -55,7 +55,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
        - info_bits & 2) == 2) { ?> @@ -83,7 +83,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; $discount->fetch($line->fk_remise_except); echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) @@ -101,11 +101,11 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; else { $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; - + if ($line->fk_product > 0) { echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); - + // Show range echo get_date_range($line->date_start, $line->date_end, $format); @@ -138,17 +138,26 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; element == 'supplier_proposal') { ?> ref_fourn; ?> - - tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); ?> + tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); + if (price2num($line->localtax1_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (empty($positiverates)) $positiverates='0'; + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); + ?> subprice); ?> - + multicurrency->enabled)) { ?> multicurrency_subprice); ?> - + pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> @@ -194,7 +203,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + rights->margins->creer)) { ?> pa_ht); ?> @@ -220,7 +229,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; - statut == 0 && ($object_rights->creer)) { ?> info_bits & 2) == 2 || ! empty($disableedit)) { ?> @@ -241,7 +250,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; ?> - 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> 0) { ?> From 4998eb3061cb403f283202a6be0f2e197a39623d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 29 Aug 2017 21:21:59 +0200 Subject: [PATCH 0209/1137] Fix: Accountancy journal, fetch on rowid, not code --- htdocs/compta/bank/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 9e5ddf8008a..fa880e0597f 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -514,7 +514,7 @@ foreach ($accounts as $key=>$type) if (! empty($conf->accounting->enabled)) { $accountingjournal = new AccountingJournal($db); - $accountingjournal->fetch('',$acc->fk_accountancy_journal); + $accountingjournal->fetch($acc->fk_accountancy_journal); print $accountingjournal->getNomUrl(0,1,1,'',1); } else From e081653cef9cb616292ea029fef04cd235ccba88 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 30 Aug 2017 06:38:33 +0200 Subject: [PATCH 0210/1137] Add fk_projet in table various_payment --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 14 +++++++------- .../install/mysql/tables/llx_payment_various.sql | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 76517914c0e..b0ca503d938 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -64,24 +64,24 @@ CREATE TABLE IF NOT EXISTS llx_expensereport_ik ( datec datetime DEFAULT NULL, tms timestamp, fk_c_exp_tax_cat integer DEFAULT 0 NOT NULL, - fk_range integer DEFAULT 0 NOT NULL, - coef double DEFAULT 0 NOT NULL, - offset double DEFAULT 0 NOT NULL + fk_range integer DEFAULT 0 NOT NULL, + coef double DEFAULT 0 NOT NULL, + offset double DEFAULT 0 NOT NULL )ENGINE=innodb DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS llx_c_exp_tax_cat ( rowid integer AUTO_INCREMENT PRIMARY KEY, label varchar(48) NOT NULL, entity integer DEFAULT 1 NOT NULL, - active integer DEFAULT 1 NOT NULL + active integer DEFAULT 1 NOT NULL )ENGINE=innodb DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS llx_c_exp_tax_range ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_c_exp_tax_cat integer DEFAULT 1 NOT NULL, - range_ik double DEFAULT 0 NOT NULL, + range_ik double DEFAULT 0 NOT NULL, entity integer DEFAULT 1 NOT NULL, - active integer DEFAULT 1 NOT NULL + active integer DEFAULT 1 NOT NULL )ENGINE=innodb DEFAULT CHARSET=utf8; INSERT INTO llx_c_type_fees (code, label, active, accountancy_code) VALUES @@ -201,5 +201,5 @@ ALTER TABLE llx_extrafields ADD COLUMN tms timestamp; ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name); - +ALTER TABLE llx_payment_various ADD COLUMN fk_projet integer DEFAULT NULL after accountancy_code; diff --git a/htdocs/install/mysql/tables/llx_payment_various.sql b/htdocs/install/mysql/tables/llx_payment_various.sql index abaf9fdab26..e92b244b009 100644 --- a/htdocs/install/mysql/tables/llx_payment_various.sql +++ b/htdocs/install/mysql/tables/llx_payment_various.sql @@ -28,7 +28,8 @@ create table llx_payment_various fk_typepayment integer NOT NULL, num_payment varchar(50), -- ref label varchar(255), - accountancy_code varchar(32), + accountancy_code varchar(32), + fk_projet integer DEFAULT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id note text, fk_bank integer, From 45136de6645b1fa61ee6cc396e026164dcdff728 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 30 Aug 2017 11:26:48 +0200 Subject: [PATCH 0211/1137] Fix: documents dir not rename and delete --- htdocs/resource/class/dolresource.class.php | 290 +++++++++++--------- 1 file changed, 167 insertions(+), 123 deletions(-) diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 6e418e2e649..1b1f4f7fd0b 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -43,6 +43,8 @@ class Dolresource extends CommonObject var $type_label; var $tms=''; + var $oldcopy; + /** * Constructor * @@ -230,85 +232,108 @@ class Dolresource extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) - { - global $conf, $langs, $hookmanager; - $error=0; + function update($user=null, $notrigger=0) + { + global $conf, $langs, $hookmanager; + $error=0; - // Clean parameters - if (isset($this->ref)) $this->ref=trim($this->ref); - if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource); - if (isset($this->description)) $this->description=trim($this->description); + // Clean parameters + if (isset($this->ref)) $this->ref=trim($this->ref); + if (isset($this->fk_code_type_resource)) $this->fk_code_type_resource=trim($this->fk_code_type_resource); + if (isset($this->description)) $this->description=trim($this->description); - // Update request - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; - $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; - $sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").","; - $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').""; - $sql.= " WHERE rowid=".$this->id; + if (empty($this->oldcopy)) + { + $org=new self($this->db); + $org->fetch($this->id); + $this->oldcopy=$org; + } - $this->db->begin(); + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; + $sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; + $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").","; + $sql.= " fk_code_type_resource=".(isset($this->fk_code_type_resource)?"'".$this->db->escape($this->fk_code_type_resource)."'":"null").","; + $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').""; + $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + $this->db->begin(); - if (! $error) - { - if (! $notrigger) - { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - //// Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('RESOURCE_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers - } - } - if (! $error) - { - $action='update'; + if (! $error) + { + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('RESOURCE_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + } - // Actions on extra fields (by external module or standard code) - // TODO le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('actioncommdao')); - $parameters=array('actcomm'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - } + if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) + { + // We remove directory + if (! empty($conf->resource->dir_output)) + { + $olddir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref); + if (file_exists($olddir)) + { + $res = @rename($olddir, $newdir); + if (! $res) + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorFailToRenameDir',$olddir,$newdir); + $error++; + } + } + } + } - // Commit or rollback - if ($error) - { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } - $this->db->rollback(); - return -1*$error; - } - else - { - $this->db->commit(); - return 1; - } - } + if (! $error) + { + $action='update'; + + // Actions on extra fields (by external module or standard code) + // TODO le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('actioncommdao')); + $parameters=array('actcomm'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } /** * Load object in memory from database @@ -375,65 +400,84 @@ class Dolresource extends CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - function delete($rowid, $notrigger=0) - { - global $user,$langs,$conf; + function delete($rowid, $notrigger=0) + { + global $user,$langs,$conf; - $error=0; + $error=0; - $this->db->begin(); + $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; - $sql.= " WHERE rowid =".$rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; + $sql.= " WHERE rowid =".$rowid; - dol_syslog(get_class($this), LOG_DEBUG); - if ($this->db->query($sql)) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; - $sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql=$this->db->query($sql); - if (!$resql) - { - $this->error=$this->db->lasterror(); - $error++; - } - } - else - { - $this->error=$this->db->lasterror(); - $error++; - } + dol_syslog(get_class($this), LOG_DEBUG); + if ($this->db->query($sql)) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; + $sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql=$this->db->query($sql); + if (!$resql) + { + $this->error=$this->db->lasterror(); + $error++; + } + } + else + { + $this->error=$this->db->lasterror(); + $error++; + } - // Removed extrafields - if (! $error) { - $result=$this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); - } - } + // Removed extrafields + if (! $error) { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); + } + } - if (! $notrigger) - { - // Call trigger - $result=$this->call_trigger('RESOURCE_DELETE',$user); - if ($result < 0) $error++; - // End call triggers - } + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('RESOURCE_DELETE',$user); + if ($result < 0) $error++; + // End call triggers + } - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } + if (! $error) + { + // We remove directory + $ref = dol_sanitizeFileName($this->ref); + if (! empty($conf->resource->dir_output)) + { + $dir = $conf->resource->dir_output . "/" . dol_sanitizeFileName($this->ref); + if (file_exists($dir)) + { + $res=@dol_delete_dir_recursive($dir); + if (! $res) + { + $this->errors[] = 'ErrorFailToDeleteDir'; + $error++; + } + } + } + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } /** * Load resource objects into $this->lines From d3c95e030baafb3da50f5e4a30e31c429aa85d63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 14:34:36 +0200 Subject: [PATCH 0212/1137] Fix delete file not possible for external user even with permissions --- htdocs/comm/propal/document.php | 1 - htdocs/commande/document.php | 1 - htdocs/compta/facture/document.php | 17 +++++++++-------- htdocs/core/actions_linkedfiles.inc.php | 6 +++--- .../tpl/document_actions_post_headers.tpl.php | 2 +- htdocs/supplier_proposal/document.php | 19 +++++++++---------- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 65b8eef5a66..3a9f3a98e26 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'propal', $id); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 7eea9c95877..d69ec07360a 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'commande',$id,''); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index b6c77207952..1ab0d7ceb93 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'facture',$id,''); @@ -72,9 +71,11 @@ if ($object->fetch($id)) $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); } + /* * Actions */ + include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; @@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); $totalpaye = $object->getSommePaiement(); - + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref)) $totalsize+=$file['size']; } - + // Invoice content - + $linkback = '' . $langs->trans("BackToList") . ''; - + $morehtmlref='
        '; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
        '; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0); print '
        '; print '
        '; - + print ''; print ''; diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index f21c41d828d..981de037c13 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($object->id) { if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); else - dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); } } elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) @@ -176,7 +176,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave')) setEventMessages($langs->trans("FileRenamed"), null); } - else + else { $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 064eda8e5b5..e613c479ee0 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -80,7 +80,7 @@ $formfile->form_attach_new_file( $disablemove=1; if ($modulepart == 'produit') $disablemove=0; - + // List of document $formfile->list_of_documents( $filearray, diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index cec276a6064..4985fd34629 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'supplier_proposal', $id); @@ -96,8 +95,8 @@ if ($object->id > 0) // Supplier proposal card $linkback = '' . $langs->trans("BackToList") . ''; - - + + $morehtmlref='
        '; // Ref supplier //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); @@ -138,14 +137,14 @@ if ($object->id > 0) } } $morehtmlref.='
        '; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
        '; print '
        '; - + print '
        '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
        '; print ''; @@ -154,9 +153,9 @@ if ($object->id > 0) print '
        '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
        '; print '
        '; - + dol_fiche_end(); - + $modulepart = 'supplier_proposal'; $permission = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer; From bfc5f01e1ea364c068f4e9e1f912173e0c3861f6 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 30 Aug 2017 14:36:00 +0200 Subject: [PATCH 0213/1137] NEW Add detail of all tax rates into pdf column tax sale. -Can be hidden by pdf setup page -For know if localtax is applied into line we have to read totaltax line --- htdocs/admin/pdf.php | 76 ++++++++++++++++++++++++- htdocs/core/lib/pdf.lib.php | 12 ++-- htdocs/core/tpl/objectline_view.tpl.php | 5 +- htdocs/langs/en_US/admin.lang | 6 +- 4 files changed, 87 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 6698be8b01f..f366d8a5ce3 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012-2105 Juanjo Menent + * Copyright (C) 2012-2107 Juanjo Menent * * 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 @@ -74,7 +74,11 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); - + + + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -249,6 +253,40 @@ if ($action == 'edit') // Edit print '
        '; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + $var=true; + print ''; + print ''; + print $text; + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '; + print '
        '; + + } + // Other print load_fiche_titre($langs->trans("Other"),'','').'
        '; $var=true; @@ -444,6 +482,40 @@ else // Show print '
        '; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX,1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + $var=true; + print ''; + print ''; + print $text; + + print '
        '.$langs->trans("Parameter").''.$langs->trans("Value").'
        '; + print '
        '; + + } + // Other print load_fiche_titre($langs->trans("Other"),'',''); $var=true; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 77f295bd813..8a445625022 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1,9 +1,9 @@ +/* Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2015 Raphaël Doursenaud @@ -1492,18 +1492,18 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) $tmpresult=''; $tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1); - if (empty($conf->PDF_MAIN_HIDE_SECOND_TAX)) + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) { - if ($object->lines[$i]->localtax1_tx != 0) + if ($object->lines[$i]->total_localtax1 != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; $tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1); } } - if (empty($conf->PDF_MAIN_HIDE_THIRD_TAX)) + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) { - if ($object->lines[$i]->localtax2_tx != 0) + if ($object->lines[$i]->total_localtax2 != 0) { if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; else $tmpresult=''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 5cfe2459247..7176e4a028d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 Juanjo Menent * * 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 @@ -145,8 +146,8 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; //var_dump($line); $positiverates=''; if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); - if (price2num($line->localtax1_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); - if (price2num($line->localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->total_localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0'; echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2e3ccdd965e..4ef46f4d2fc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -356,6 +356,8 @@ PDF=PDF PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF +PDFLocaltax=Rules for %s +HideLocalTaxOnPDF=Hide %s into pdf column tax sale HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide product lines details on generated PDF @@ -1638,11 +1640,11 @@ BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) NbAddedAutomatically=Number of days added to counters of users (automatically) each month EnterAnyCode=This field contains a reference to identify line. Enter any value of your choice, but without special characters. -UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364] +UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for ?, enter [8364] ColorFormat=The RGB color is in HEX format, eg: FF0000 PositionIntoComboList=Position of line into combo lists SellTaxRate=Sale tax rate -RecuperableOnly=Yes for VAT "Non Perçue Récupérable" dedicated for some state in France. Keep value to "No" in all other cases. +RecuperableOnly=Yes for VAT "Non Per?ue R?cup?rable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offer a page or web site to check status of your shipping, you can enter it here. You can use the key {TRACKID} into URL parameters so the system will replace it with value of tracking number user entered into shipment card. OpportunityPercent=When you create an opportunity, you will defined an estimated amount of project/lead. According to status of opportunity, this amount may be multiplicated by this rate to evaluate global amount all your opportunities may generate. Value is percent (between 0 and 100). TemplateForElement=This template record is dedicated to which element From da0c9c2749f13df8b7c9975b77e46fcc84a93729 Mon Sep 17 00:00:00 2001 From: Corentin H Date: Wed, 30 Aug 2017 14:41:22 +0200 Subject: [PATCH 0214/1137] Fix README typos and improve some grammar --- README.md | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fbbbdddf665..3d9ba75f1f5 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) -Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...). +Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). -It's an Open Source software (wrote in PHP language) designed for small, medium or large companies, foundations and freelances. +It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelances. You can freely use, study, modify or distribute it according to its Free Software licence. @@ -29,18 +29,25 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git Releases can be downloaded from [official website](https://www.dolibarr.org/). ### Install from composer -If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands: +If you do not already have Composer installed, you may do so by following the instructions at [getcomposer.org](https://getcomposer.org/). On Linux and macOS, you may run the following commands: + +```bash curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer +``` -On Windows, you'll download and run https://getcomposer.org/Composer-Setup.exe +On Windows, you can download and run https://getcomposer.org/Composer-Setup.exe +You can then create a new project + +```bash composer create-project dolibarr/dolibarr erp +``` ### Simple setup -If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions: +If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: - DoliWamp for Windows - DoliDeb for Debian or Ubuntu @@ -48,11 +55,11 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM ### Advanced setup -You can use a Web server and a supported database (MariaDb, MySql or Postgresql) to install the standard version. +You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. - Uncompress the downloaded archive -- Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator) -- Create an empty file "htdocs/conf/conf.php" and set permissions for your web server user (write permissions will be removed once install is finished) +- Copy the "dolibarr" directory and all its files inside your web server root or anywhere you'd like and set up your web server to use "*dolibarr/htdocs*" as root for a new web server virtual host (second choice need to be server administrator) +- Create an empty `htdocs/conf/conf.php` file and set permissions for your web server user (*write* permissions will be removed once install is finished) - From your browser, go to the dolibarr "install/" page The URL will depends on choices made in the first step: @@ -73,10 +80,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql) ## UPGRADING - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. -- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process. - If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents"). +- At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process. +  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). -*Note: migration process can safely be done multiple times by calling the page /install/index.php* +*Note: migration process can be safely done multiple times by calling the `/install/index.php` page* ## WHAT'S NEW @@ -172,7 +179,7 @@ Administrator, user, developer and translator's documentations are available alo ## CONTRIBUTING -See file [CONTRIBUTING](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md) +See [CONTRIBUTING](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md) file ## CREDITS From 70cbaeb423684fe231b61f509459e6dcb6b15bd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:10:39 +0200 Subject: [PATCH 0215/1137] Fix mass merging must read only PDF generated for REF. --- htdocs/core/actions_massactions.inc.php | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e424fe0376b..68258025098 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -429,7 +429,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se } $arrayofinclusion=array(); - foreach($listofobjectref as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/'); + foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote($tmppdf.'.pdf','/').'$'; $listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true); // build list of files with full path @@ -505,8 +505,8 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $pdf=pdf_getInstance(); if (class_exists('TCPDF')) { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); } $pdf->SetFont(pdf_getPDFFont($outputlangs)); @@ -515,15 +515,15 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Add all others foreach($files as $file) { - // Charge un document PDF depuis un fichier. - $pagecount = $pdf->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) - { - $tplidx = $pdf->importPage($i); - $s = $pdf->getTemplatesize($tplidx); - $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $pdf->useTemplate($tplidx); - } + // Charge un document PDF depuis un fichier. + $pagecount = $pdf->setSourceFile($file); + for ($i = 1; $i <= $pagecount; $i++) + { + $tplidx = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } } // Create output dir if not exists @@ -536,18 +536,18 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Save merged file if ($filter=='paye:0') { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); } if ($year) $filename.='_'.$year; if ($month) $filename.='_'.$month; if ($pagecount) { - $now=dol_now(); - $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; - $pdf->Output($file,'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + $pdf->Output($file,'F'); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); $langs->load("exports"); setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); From a3085cb44a95afd7453f12e33362158ad5c27dca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:43:57 +0200 Subject: [PATCH 0216/1137] Update objectline_view.tpl.php --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 7176e4a028d..f968fdcbfc7 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -147,7 +147,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; $positiverates=''; if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); - if (price2num($line->total_localtax2_tx)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0'; echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); From 2c4e8cbb4a9cc12b5c829560978c04a766423ccd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:45:53 +0200 Subject: [PATCH 0217/1137] Update admin.lang --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4ef46f4d2fc..75b904dfa2d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1640,11 +1640,11 @@ BackgroundTableLineEvenColor=Background color for even table lines MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay) NbAddedAutomatically=Number of days added to counters of users (automatically) each month EnterAnyCode=This field contains a reference to identify line. Enter any value of your choice, but without special characters. -UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for ?, enter [8364] +UnicodeCurrency=Enter here between braces, list of byte number that represent the currency symbol. For exemple: for $, enter [36] - for brazil real R$ [82,36] - for €, enter [8364] ColorFormat=The RGB color is in HEX format, eg: FF0000 PositionIntoComboList=Position of line into combo lists SellTaxRate=Sale tax rate -RecuperableOnly=Yes for VAT "Non Per?ue R?cup?rable" dedicated for some state in France. Keep value to "No" in all other cases. +RecuperableOnly=Yes for VAT "Not Perceived but Recoverable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offer a page or web site to check status of your shipping, you can enter it here. You can use the key {TRACKID} into URL parameters so the system will replace it with value of tracking number user entered into shipment card. OpportunityPercent=When you create an opportunity, you will defined an estimated amount of project/lead. According to status of opportunity, this amount may be multiplicated by this rate to evaluate global amount all your opportunities may generate. Value is percent (between 0 and 100). TemplateForElement=This template record is dedicated to which element From 3e4a7ba97cde90c818666b37f4a01042c0a0e314 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 16:46:50 +0200 Subject: [PATCH 0218/1137] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 75b904dfa2d..dfd6e90929a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -357,7 +357,7 @@ PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF PDFLocaltax=Rules for %s -HideLocalTaxOnPDF=Hide %s into pdf column tax sale +HideLocalTaxOnPDF=Hide %s rate into pdf column tax sale HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide product lines details on generated PDF From 0a67ca53d450e5850b6d9280f56ebbccf282870a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2017 17:14:54 +0200 Subject: [PATCH 0219/1137] Fix menu auguria --- htdocs/core/menus/init_menu_auguria.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 5655ada681c..445ec83d58d 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -288,16 +288,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); From 9146bb336e460dc342242e214cabe2d883adbb9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 02:34:07 +0200 Subject: [PATCH 0220/1137] Work on merging all payment modes in one page --- htdocs/core/class/html.form.class.php | 7 +- htdocs/core/class/html.formactions.class.php | 2 +- .../install/mysql/migration/6.0.0-7.0.0.sql | 6 + htdocs/langs/en_US/paybox.lang | 2 +- htdocs/langs/en_US/paypal.lang | 8 +- htdocs/langs/en_US/stripe.lang | 2 +- htdocs/paybox/admin/paybox.php | 26 +- htdocs/paypal/admin/paypal.php | 24 +- htdocs/paypal/lib/paypal.lib.php | 2 +- htdocs/public/onlinesign/newonlinesign.php | 2 +- htdocs/public/paybox/newpayment.php | 20 +- htdocs/public/paybox/paymentko.php | 22 +- htdocs/public/paybox/paymentok.php | 12 +- htdocs/public/payment/newpayment.php | 451 +++++++++++++++--- htdocs/public/payment/paymentko.php | 55 +-- htdocs/public/payment/paymentok.php | 190 ++++---- htdocs/public/paypal/newpayment.php | 27 +- htdocs/public/paypal/paymentko.php | 8 +- htdocs/public/paypal/paymentok.php | 20 +- htdocs/public/stripe/newpayment.php | 20 +- htdocs/public/stripe/paymentko.php | 18 +- htdocs/public/stripe/paymentok.php | 16 +- htdocs/stripe/admin/stripe.php | 24 +- htdocs/theme/eldy/style.css.php | 44 +- 24 files changed, 665 insertions(+), 343 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3ff082a9ec1..8a5f13a8366 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -628,9 +628,10 @@ class Form * @param string $htmloption Options html on select object * @param integer $maxlength Max length for labels (0=no limit) * @param string $morecss More css class + * @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key * @return string HTML string with select */ - function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0,$morecss='minwidth300') + function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0,$morecss='minwidth300',$usecodeaskey='') { global $conf,$langs; @@ -684,11 +685,11 @@ class Form if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label']) ) { $foundselected=true; - $out.= ' + + + + + + '; + } +} + + + htmlPrintOnlinePaymentFooter($mysoc,$langs); llxFooter('', 'public'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 9abcfcf2c58..d4dea960b2f 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -51,6 +51,7 @@ $langs->load("bills"); $langs->load("companies"); $langs->load("paybox"); $langs->load("paypal"); +$langs->load("stripe"); if (! empty($conf->paypal->enabled)) { @@ -59,7 +60,12 @@ if (! empty($conf->paypal->enabled)) $PAYPALPAYERID=GETPOST('PAYERID'); if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); } -// TODO Other payment method +if (! empty($conf->paybox->enabled)) +{ +} +if (! empty($conf->stripe->enabled)) +{ +} $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); @@ -106,7 +112,7 @@ $object = new stdClass(); // For triggers * View */ -dol_syslog("Callback url when a PayPal payment was canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment'); +dol_syslog("Callback url when an online payment is canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment'); $tracepost = ""; foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; @@ -122,48 +128,29 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION['FinalPaymentAmt']; // From env $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + // Send an email $sendemail = ''; - if (! empty($conf->paypal->enabled)) - { - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) - { - $sendemail = $conf->global->PAYPAL_PAYONLINE_SENDEMAIL; - } + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) + { + $sendemail = $conf->global->ONLINE_PAYMENT_SENDEMAIL; } - // Send an email - if (! empty($conf->paybox->enabled)) - { - if (! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) - { - $sendemail = $conf->global->PAYBOX_PAYONLINE_SENDEMAIL; - } - } - // Send an email - if (! empty($conf->stripe->enabled)) - { - if (! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) - { - $sendemail = $conf->global->STRIPE_PAYONLINE_SENDEMAIL; - } - } - + if ($sendemail) { $from=$conf->global->MAILING_EMAIL_FROM; $sendto=$sendemail; - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -176,7 +163,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content=""; @@ -188,7 +175,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content); - + $result=$mailfile->sendfile(); if ($result) { @@ -199,12 +186,12 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } - + unset($_SESSION['ipaddress']); } $head=''; -if (! empty($conf->global->PAYMENT_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -217,7 +204,7 @@ print ''."\n"; print '
        '."\n"; print $langs->trans("YourPaymentHasNotBeenRecorded")."

        "; -if (! empty($conf->global->PAYMENT_MESSAGE_KO)) print $conf->global->PAYMENT_MESSAGE_KO; +if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO; print "\n
        \n"; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 26022dcd4f8..4cb7dc0427c 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -67,21 +67,6 @@ if (! empty($conf->paypal->enabled)) if ($urlok) $PAYPAL_API_OK=$urlok; $PAYPAL_API_KO=""; if ($urlko) $PAYPAL_API_KO=$urlko; - if (empty($PAYPAL_API_USER)) - { - dol_print_error('',"Paypal setup param PAYPAL_API_USER not defined"); - return -1; - } - if (empty($PAYPAL_API_PASSWORD)) - { - dol_print_error('',"Paypal setup param PAYPAL_API_PASSWORD not defined"); - return -1; - } - if (empty($PAYPAL_API_SIGNATURE)) - { - dol_print_error('',"Paypal setup param PAYPAL_API_SIGNATURE not defined"); - return -1; - } $PAYPALTOKEN=GETPOST('TOKEN'); if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); @@ -143,14 +128,14 @@ $object = new stdClass(); // For triggers * View */ -dol_syslog("Callback url when a payment was done. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_payment'); +dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"])?dol_escape_htmltag($_SERVER["QUERY_STRING"]):'')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"])?dol_escape_htmltag($_SERVER["SCRIPT_URI"]):''), LOG_DEBUG, 0, '_payment'); $tracepost = ""; foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); $head=''; -if (! empty($conf->global->PAYMENT_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -166,69 +151,81 @@ print '
        '."\n"; if (! empty($conf->paypal->enabled)) { - if ($PAYPALTOKEN) + if ($paymentmethod == 'paypal') { - // Get on url call - $onlinetoken = $PAYPALTOKEN; - $fulltag = $FULLTAG; - $payerID = $PAYPALPAYERID; - // Set by newpayment.php - $paymentType = $_SESSION['PaymentType']; - $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; - // From env - $ipaddress = $_SESSION['ipaddress']; - - dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal'); - - // Validate record - if (! empty($paymentType)) - { - dol_syslog("We call GetExpressCheckoutDetails", LOG_DEBUG, 0, '_payment'); - $resArray=getDetails($onlinetoken); - //var_dump($resarray); - - dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment'); - $resArray=confirmPayment($onlinetoken, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $fulltag); - - $ack = strtoupper($resArray["ACK"]); - if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING") - { - $object->source = $source; - $object->ref = $ref; - $object->payerID = $payerID; - $object->fulltag = $fulltag; - $object->resArray = $resArray; - - // resArray was built from a string like that - // TOKEN=EC%2d1NJ057703V9359028&TIMESTAMP=2010%2d11%2d01T11%3a40%3a13Z&CORRELATIONID=1efa8c6a36bd8&ACK=Success&VERSION=56&BUILD=1553277&TRANSACTIONID=9B994597K9921420R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2010%2d11%2d01T11%3a40%3a12Z&AMT=155%2e57&FEEAMT=5%2e54&TAXAMT=0%2e00&CURRENCYCODE=EUR&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None - $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed' - $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]); - $TAXAMT=urldecode($resArray["TAXAMT"]); - $NOTE=urldecode($resArray["NOTE"]); + if ($PAYPALTOKEN) + { + // Get on url call + $onlinetoken = $PAYPALTOKEN; + $fulltag = $FULLTAG; + $payerID = $PAYPALPAYERID; + // Set by newpayment.php + $paymentType = $_SESSION['PaymentType']; + $currencyCodeType = $_SESSION['currencyCodeType']; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + // From env + $ipaddress = $_SESSION['ipaddress']; - $ispaymentok=True; - } - else - { - //Display a user friendly Error on the page using any of the following error information returned by PayPal - $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); - $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); - $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); - $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); - } - } - else - { - dol_print_error('','Session expired'); - } + dol_syslog("Call paymentok with token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_paypal'); + + // Validate record + if (! empty($paymentType)) + { + dol_syslog("We call GetExpressCheckoutDetails", LOG_DEBUG, 0, '_payment'); + $resArray=getDetails($onlinetoken); + //var_dump($resarray); + + dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment'); + $resArray=confirmPayment($onlinetoken, $paymentType, $currencyCodeType, $payerID, $ipaddress, $FinalPaymentAmt, $fulltag); + + $ack = strtoupper($resArray["ACK"]); + if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING") + { + $object->source = $source; + $object->ref = $ref; + $object->payerID = $payerID; + $object->fulltag = $fulltag; + $object->resArray = $resArray; + + // resArray was built from a string like that + // TOKEN=EC%2d1NJ057703V9359028&TIMESTAMP=2010%2d11%2d01T11%3a40%3a13Z&CORRELATIONID=1efa8c6a36bd8&ACK=Success&VERSION=56&BUILD=1553277&TRANSACTIONID=9B994597K9921420R&TRANSACTIONTYPE=expresscheckout&PAYMENTTYPE=instant&ORDERTIME=2010%2d11%2d01T11%3a40%3a12Z&AMT=155%2e57&FEEAMT=5%2e54&TAXAMT=0%2e00&CURRENCYCODE=EUR&PAYMENTSTATUS=Completed&PENDINGREASON=None&REASONCODE=None + $PAYMENTSTATUS=urldecode($resArray["PAYMENTSTATUS"]); // Should contains 'Completed' + $TRANSACTIONID=urldecode($resArray["TRANSACTIONID"]); + $TAXAMT=urldecode($resArray["TAXAMT"]); + $NOTE=urldecode($resArray["NOTE"]); + + $ispaymentok=True; + } + else + { + //Display a user friendly Error on the page using any of the following error information returned by PayPal + $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); + $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); + $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); + $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); + } + } + else + { + dol_print_error('','Session expired'); + } + } + else + { + dol_print_error('','$PAYPALTOKEN not defined'); + } } - else - { - dol_print_error('','$PAYPALTOKEN not defined'); - } } +if (! empty($conf->paybox->enabled)) +{ + if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok +} + +if (! empty($conf->stripe->enabled)) +{ + if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok +} if ($ispaymentok) @@ -240,10 +237,11 @@ if ($ispaymentok) // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; - + $TRANSACTIONID = $_SESSION['TRANSACTIONID']; + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); @@ -251,18 +249,14 @@ if ($ispaymentok) if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + print $langs->trans("YourPaymentHasBeenRecorded")."
        \n"; print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."

        \n"; - if (! empty($conf->global->PAYMENT_MESSAGE_OK)) print $conf->global->PAYMENT_MESSAGE_OK; - + if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK; + $sendemail = ''; - if (! empty($conf->global->PAYMENTONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYMENTONLINE_SENDEMAIL; - // TODO Remove local option to keep only the generic one ? - if ($paymentmethod == 'paypal' && ! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; - if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; - if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + // Send an email if ($sendemail) { @@ -285,7 +279,7 @@ if ($ispaymentok) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); @@ -333,33 +327,33 @@ else // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('PAYMENTONLINE_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + print $langs->trans('DoExpressCheckoutPaymentAPICallFailed') . "
        \n"; print $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."
        \n"; print $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."
        \n"; print $langs->trans('ErrorCode') . ": " . $ErrorCode."
        \n"; print $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."
        \n"; - + if ($mysoc->email) print "\nPlease, send a screenshot of this page to ".$mysoc->email."
        \n"; - + $sendemail = ''; if (! empty($conf->global->PAYMENTONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYMENTONLINE_SENDEMAIL; // TODO Remove local option to keep only the generic one ? if ($paymentmethod == 'paypal' && ! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - + // Send an email if ($sendemail) { @@ -369,7 +363,7 @@ else $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -382,7 +376,7 @@ else else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content=""; @@ -392,12 +386,12 @@ else $content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."\n"; $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n"; $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; - + $ishtml=dol_textishtml($content); // May contain urls - + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); - + $result=$mailfile->sendfile(); if ($result) { diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 65fbfbd38a7..8616d434e38 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -3,9 +3,9 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * - * This program is free software: you can redistribute it and/or modify + * 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 3 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -16,7 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For test: https://developer.paypal.com/ + * For paypal test: https://developer.paypal.com/ + * For paybox test: ??? */ /** @@ -242,7 +243,7 @@ if (GETPOST('action','aZ09') == 'dopayment') dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO //$_SESSION["PaymentType"]=$PAYPAL_PAYMENT_TYPE; //$_SESSION["currencyCodeType"]=$PAYPAL_API_DEVISE; - //$_SESSION["Payment_Amount"]=$PAYPAL_API_PRICE; + //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; // A redirect is added if API call successfull print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); @@ -258,7 +259,7 @@ if (GETPOST('action','aZ09') == 'dopayment') */ $head=''; -if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -267,9 +268,9 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online // Common variables $creditor=$mysoc->name; -$paramcreditor='PAYPAL_CREDITOR_'.$suffix; +$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix; if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; -else if (! empty($conf->global->PAYPAL_CREDITOR)) $creditor=$conf->global->PAYPAL_CREDITOR; +else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR; // Check link validity if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) @@ -306,14 +307,14 @@ print "\n"; print ''."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='PAYBOX_LOGO_'.$suffix; +$paramlogo='PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->PAYBOX_LOGO)) $logosmall=$conf->global->PAYBOX_LOGO; +else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; @@ -338,11 +339,11 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->PAYPAL_NEWFORM_TEXT)) +if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYPAL_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
        \n"; - else $text.=$conf->global->PAYPAL_NEWFORM_TEXT."
        \n"; + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
        \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
        \n"; $text=''."\n"; } if (empty($text)) diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index f7dd0cf6eeb..aff6509e390 100644 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -91,7 +91,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; @@ -104,7 +104,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice // Send an email $sendemail = ''; - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; if ($sendemail) { @@ -153,7 +153,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $head=''; -if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -166,7 +166,7 @@ print ''."\n"; print '
        '."\n"; print $langs->trans("YourPaymentHasNotBeenRecorded")."

        "; -if (! empty($conf->global->PAYPAL_MESSAGE_KO)) print $conf->global->PAYPAL_MESSAGE_KO; +if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO; print "\n
        \n"; diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index e52a79057f4..ec0ba7df46e 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -114,7 +114,7 @@ dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal'); $head=''; -if (! empty($conf->global->PAYPAL_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -135,7 +135,7 @@ if ($PAYPALTOKEN) // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; @@ -170,7 +170,7 @@ if ($PAYPALTOKEN) print $langs->trans("YourPaymentHasBeenRecorded")."
        \n"; print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."

        \n"; - if (! empty($conf->global->PAYPAL_MESSAGE_OK)) print $conf->global->PAYPAL_MESSAGE_OK; + if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK; // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; @@ -180,9 +180,9 @@ if ($PAYPALTOKEN) // Fin appel triggers // Send an email - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { - $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; + $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -201,7 +201,7 @@ if ($PAYPALTOKEN) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); @@ -248,7 +248,7 @@ if ($PAYPALTOKEN) $result=$interface->run_triggers('PAYPAL_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + //Display a user friendly Error on the page using any of the following error information returned by PayPal $ErrorCode = urldecode($resArray["L_ERRORCODE0"]); $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]); @@ -264,9 +264,9 @@ if ($PAYPALTOKEN) if ($mysoc->email) echo "\nPlease, send a screenshot of this page to ".$mysoc->email."
        \n"; // Send an email - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { - $sendto=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; + $sendto=$conf->global->ONLINE_PAYMENT_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -285,7 +285,7 @@ if ($PAYPALTOKEN) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content=""; diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index 962185b8397..259c78f72b5 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -183,9 +183,9 @@ if (! empty($conf->global->STRIPE_SECURITY_TOKEN)) // Common variables $creditor=$mysoc->name; -$paramcreditor='STRIPE_CREDITOR_'.$suffix; +$paramcreditor='ONLINE_PAYMENT_CREDITOR_'.$suffix; if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor; -else if (! empty($conf->global->STRIPE_CREDITOR)) $creditor=$conf->global->STRIPE_CREDITOR; +else if (! empty($conf->global->ONLINE_PAYMENT_CREDITOR)) $creditor=$conf->global->ONLINE_PAYMENT_CREDITOR; @@ -297,7 +297,7 @@ if ($action == 'charge') } $_SESSION["onlinetoken"] = $stripeToken; - $_SESSION["Payment_Amount"] = $amount; + $_SESSION["FinalPaymentAmt"] = $amount; $_SESSION["currencyCodeType"] = $currency; $_SESSION["paymentType"] = ''; $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip @@ -328,7 +328,7 @@ if ($action == 'charge') */ $head=''; -if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -369,14 +369,14 @@ print "\n"; print '

        '.$text.'
        '."\n"; -// Show logo (search order: logo defined by PAYBOX_LOGO_suffix, then PAYBOX_LOGO, then small company logo, large company logo, theme logo, common logo) +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='STRIPE_LOGO_'.$suffix; +$paramlogo='PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->STRIPE_LOGO)) $logosmall=$conf->global->STRIPE_LOGO; +else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; @@ -401,11 +401,11 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->STRIPE_NEWFORM_TEXT)) +if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->STRIPE_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
        \n"; - else $text.=$conf->global->STRIPE_NEWFORM_TEXT."
        \n"; + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
        \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
        \n"; $text=''."\n"; } if (empty($text)) diff --git a/htdocs/public/stripe/paymentko.php b/htdocs/public/stripe/paymentko.php index 01000939b37..c3c8672eb84 100644 --- a/htdocs/public/stripe/paymentko.php +++ b/htdocs/public/stripe/paymentko.php @@ -82,24 +82,24 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $paymentType = $_SESSION['paymentType']; $FinalPaymentAmt = $_SESSION['FinalPaymentAmt']; $ipaddress = $_SESSION['ipaddress']; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('STRIPE_PAYMENT_KO',$object,$user,$langs,$conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + // Send an email $sendemail = ''; - if (! empty($conf->global->PAYPAL_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYPAL_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + if ($sendemail) { // Get on url call $sendto=$sendemail; $from=$conf->global->MAILING_EMAIL_FROM; - + // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -112,7 +112,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content=""; @@ -124,7 +124,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($topic, $sendto, $from, $content); - + $result=$mailfile->sendfile(); if ($result) { @@ -140,7 +140,7 @@ if (! empty($_SESSION['ipaddress'])) // To avoid to make action twice } $head=''; -if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -153,7 +153,7 @@ print ''."\n"; print '
        '."\n"; print $langs->trans("YourPaymentHasNotBeenRecorded")."

        "; -if (! empty($conf->global->STRIPE_MESSAGE_KO)) print $conf->global->STRIPE_MESSAGE_KO; +if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO; print "\n
        \n"; diff --git a/htdocs/public/stripe/paymentok.php b/htdocs/public/stripe/paymentok.php index 4eede2e9544..1b8854c2de1 100644 --- a/htdocs/public/stripe/paymentok.php +++ b/htdocs/public/stripe/paymentok.php @@ -82,7 +82,7 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_stripe'); $head=''; -if (! empty($conf->global->STRIPE_CSS_URL)) $head=''."\n"; +if (! empty($conf->global->ONLINE_PAYMENT_CSS_URL)) $head=''."\n"; $conf->dol_hide_topmenu=1; $conf->dol_hide_leftmenu=1; @@ -105,7 +105,7 @@ if ($ispaymentok) // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; - $FinalPaymentAmt = $_SESSION["Payment_Amount"]; + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; // From env $ipaddress = $_SESSION['ipaddress']; $TRANSACTIONID = $_SESSION['TRANSACTIONID']; @@ -117,14 +117,14 @@ if ($ispaymentok) if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers - + print $langs->trans("YourPaymentHasBeenRecorded")."
        \n"; print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."

        \n"; - if (! empty($conf->global->STRIPE_MESSAGE_OK)) print $conf->global->STRIPE_MESSAGE_OK; - + if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK; + $sendemail = ''; - if (! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - + if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL; + // Send an email if ($sendemail) { @@ -147,7 +147,7 @@ if ($ispaymentok) else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - + $urlback=$_SERVER["REQUEST_URI"]; $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $tmptag=dolExplodeIntoArray($fulltag,'.','='); diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index c2c33edc189..3b9477f48fb 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -37,7 +37,7 @@ $langs->load("paybox"); $langs->load("stripe"); if (! $user->admin) accessforbidden(); - + $action = GETPOST('action','alpha'); @@ -55,17 +55,17 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "STRIPE_LIVE_SECRET_KEY",GETPOST('STRIPE_LIVE_SECRET_KEY','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "STRIPE_CREDITOR",GETPOST('STRIPE_CREDITOR','alpha'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "STRIPE_CSS_URL",GETPOST('STRIPE_CSS_URL','alpha'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "STRIPE_MESSAGE_OK",GETPOST('STRIPE_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "STRIPE_MESSAGE_KO",GETPOST('STRIPE_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "STRIPE_PAYONLINE_SENDEMAIL",GETPOST('STRIPE_PAYONLINE_SENDEMAIL'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL",GETPOST('ONLINE_PAYMENT_SENDEMAIL'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - + if (! $error) { $db->commit(); @@ -190,25 +190,25 @@ print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b2fe6d923e9..ba189ee1be1 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -343,6 +343,26 @@ input.smallpadd { /* Used for timesheet input */ input.buttongen { vertical-align: middle; } +input.buttonpayment { + width: 300px; + margin-bottom: 15px; + background-image: none; +} +input.buttonpaymentpaypal { + background-image: url(); + background-repeat: no-repeat; + background-position: 5px 4px; +} +input.buttonpaymentpaybox { + background-image: url(); + background-repeat: no-repeat; + background-position: 5px 4px; +} +input.buttonpaymentstripe { + background-image: url(); + background-repeat: no-repeat; + background-position: 5px 3px; +} span.timesheetalreadyrecorded input { border: none; border-bottom: solid 1px rgba(0,0,0,0.4); @@ -1224,21 +1244,6 @@ div#id-top { display:none; background: rgb(); - /*-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.4); - box-shadow: 0 0 6px rgba(0,0,0,0.4); */ - /* - background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) ); - */ - /* - height: 34px; - - height: px; - */ } @@ -1310,15 +1315,6 @@ ul.tmenu { /* t r b l */ display: table; } ul.tmenu li { /* We need this to have background color when menu entry wraps on new lines */ - /* background: rgb(); - /* - background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); - background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) ); - */ } li.tmenu, li.tmenusel { From c31febc4e01f4dee1ffc53ce777c297f892312e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 03:41:04 +0200 Subject: [PATCH 0221/1137] Fix bad var --- htdocs/paypal/admin/paypal.php | 2 +- htdocs/stripe/admin/stripe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index b478ee49ab9..9dadd4ff970 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -202,7 +202,7 @@ print ''; print ''; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 3b9477f48fb..0055bc0a8ab 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -184,7 +184,7 @@ print "\n"; print ''; From c761eb592e344185b500346d5ba97307a81d946f Mon Sep 17 00:00:00 2001 From: Quentin Sutkowski Date: Thu, 31 Aug 2017 11:15:55 +0200 Subject: [PATCH 0222/1137] Fix barcode reader on POS Solve the keyboard emulation issue with a barcode reader on cashdesk module research area. --- htdocs/cashdesk/tpl/facturation1.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 580012847f5..8cfe70638e3 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -42,9 +42,9 @@ $langs->load("cashdesk"); + From 6a3d110d3ac1339e7a60664d03378719959aaf30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 14:44:32 +0200 Subject: [PATCH 0223/1137] Enhance repair for utf8 mix collation --- htdocs/install/mysql/migration/repair.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index e759985b7a8..14622a3963c 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -29,6 +29,8 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; From 8248bc1c643df0f4bbe26ad9bee777d71c63677b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 15:44:36 +0200 Subject: [PATCH 0224/1137] Uniformize code of accounting report --- htdocs/accountancy/report/index.html | 0 htdocs/compta/journal/purchasesjournal.php | 7 +- htdocs/compta/journal/sellsjournal.php | 6 +- htdocs/compta/localtax/clients.php | 10 +- htdocs/compta/localtax/quadri_detail.php | 6 +- htdocs/compta/resultat/clientfourn.php | 16 +- htdocs/compta/resultat/index.php | 72 +++++++-- .../report => compta/resultat}/result.php | 142 +++++++++++++++--- htdocs/compta/stats/cabyprodserv.php | 34 +++-- htdocs/compta/stats/cabyuser.php | 13 +- htdocs/compta/stats/casoc.php | 10 +- htdocs/compta/stats/index.php | 93 +++++++++--- htdocs/compta/tva/clients.php | 6 +- htdocs/compta/tva/quadri_detail.php | 10 +- htdocs/compta/tva/quarter_report.php | 16 +- htdocs/core/lib/report.lib.php | 8 +- htdocs/core/menus/init_menu_auguria.sql | 4 +- htdocs/core/menus/standard/eldy.lib.php | 4 +- .../install/mysql/migration/6.0.0-7.0.0.sql | 17 +++ htdocs/langs/en_US/compta.lang | 2 + 20 files changed, 340 insertions(+), 136 deletions(-) delete mode 100644 htdocs/accountancy/report/index.html rename htdocs/{accountancy/report => compta/resultat}/result.php (51%) diff --git a/htdocs/accountancy/report/index.html b/htdocs/accountancy/report/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index fbd391ffe2a..1349a7a83cc 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -84,8 +84,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end $date_start=dol_get_first_day($pastmonthyear,$pastmonth,false); $date_end=dol_get_last_day($pastmonthyear,$pastmonth,false); } -$nom=$langs->trans("PurchasesJournal"); -$nomlink=''; +$name=$langs->trans("PurchasesJournal"); +$namelink=''; $periodlink=''; $exportlink=''; $builddate=time(); @@ -93,7 +93,8 @@ $description=$langs->trans("DescPurchasesJournal").'
        '; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); + +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index fd0c45be7cd..09a73b604a6 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -89,7 +89,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $nom=$langs->trans("SellsJournal"); -$nomlink=''; +$namelink=''; $periodlink=''; $exportlink=''; $builddate=time(); @@ -97,7 +97,7 @@ $description=$langs->trans("DescSellsJournal").'
        '; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; @@ -170,7 +170,7 @@ if ($result) $prev_progress = 0; if ($obj->type==Facture::TYPE_SITUATION) { // Avoid divide by 0 - if ($obj->situation_percent == 0) { + if ($obj->situation_percent == 0) { $situation_ratio = 0; } else { $prev_progress = $line->get_prev_progress($obj->rowid); // id on invoice diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 40a5805f2b3..751a9d00e6e 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -142,7 +142,7 @@ if ($calc==2) // Invoice for goods, payment for services $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code); @@ -169,7 +169,7 @@ if($calc ==0 || $calc == 2) $parameters["end"] = $date_end; $parameters["direction"] = 'sell'; $parameters["type"] = 'localtax'.$local; - + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -183,7 +183,7 @@ if($calc ==0 || $calc == 2) { if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) !=0) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { @@ -247,7 +247,7 @@ if($calc ==0 || $calc == 1){ $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); $parameters["direction"] = 'buy'; $parameters["type"] = 'localtax'.$local; - + $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (is_array($coll_list)) { @@ -258,7 +258,7 @@ if($calc ==0 || $calc == 1){ { if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) != 0) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index a70066bdb5d..decd447679e 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -177,7 +177,7 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); if($local==1){ @@ -336,7 +336,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print '
        '; // Ref @@ -499,7 +499,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index a7cf8769711..4994737d3c3 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -64,7 +64,7 @@ if (! $sortfield) $sortfield='s.nom, s.rowid'; if (! $sortorder) $sortorder='ASC'; // Date range -$year=GETPOST("year"); +$year=GETPOST('year','int'); if (empty($year)) { $year_current = strftime("%Y",dol_now()); @@ -77,7 +77,8 @@ if (empty($year)) } $date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); $date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); -// Quarter + +// We define date_start and date_end if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $q=GETPOST("q")?GETPOST("q"):0; @@ -105,11 +106,6 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } -else -{ - // TODO We define q - -} // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') $modecompta=(GETPOST("modecompta")?GETPOST("modecompta"):$conf->global->ACCOUNTING_MODE); @@ -123,7 +119,7 @@ llxHeader(); $form=new Form($db); -$nomlink=''; +$namelink=''; $periodlink=''; $exportlink=''; @@ -158,9 +154,9 @@ else { $hselected = 'report'; -report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 6043a7cbec5..c1a352bc969 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -27,17 +27,60 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -$year_start=GETPOST('year_start'); -$year_current = strftime("%Y",time()); +$date_startmonth=GETPOST('date_startmonth'); +$date_startday=GETPOST('date_startday'); +$date_startyear=GETPOST('date_startyear'); +$date_endmonth=GETPOST('date_endmonth'); +$date_endday=GETPOST('date_endday'); +$date_endyear=GETPOST('date_endyear'); + $nbofyear=4; -if (! $year_start) { - $year_start = $year_current - ($nbofyear-1); - $year_end = $year_current; + +// Date range +$year=GETPOST('year','int'); +if (empty($year)) +{ + $year_current = strftime("%Y",dol_now()); + $month_current = strftime("%m",dol_now()); + $year_start = $year_current - ($nbofyear - 1); +} else { + $year_current = $year; + $month_current = strftime("%m",dol_now()); + $year_start = $year - ($nbofyear - 1); } -else { - $year_end=$year_start + ($nbofyear-1); +$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); +$date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); + +// We define date_start and date_end +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $year_end=$year_start + ($nbofyear - 1); + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + if (! GETPOST('month')) + { + if (! GETPOST("year") && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + else $month_end=$month_start; + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } // Security check @@ -59,16 +102,16 @@ llxHeader(); $form=new Form($db); -$nomlink=''; +$namelink=''; $exportlink=''; // Affiche en-tete du rapport if ($modecompta == 'CREANCES-DETTES') { - $nom=$langs->trans("AnnualSummaryDueDebtMode"); + $name=$langs->trans("AnnualSummaryDueDebtMode"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $period="$year_start - $year_end"; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); $description.='
        '.$langs->trans("RulesResultDue"); @@ -78,10 +121,10 @@ if ($modecompta == 'CREANCES-DETTES') //$exportlink=$langs->trans("NotYetAvailable"); } else { - $nom=$langs->trans("AnnualSummaryInputOutputMode"); + $name=$langs->trans("AnnualSummaryInputOutputMode"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $period="$year_start - $year_end"; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); $description.='
        '.$langs->trans("RulesResultInOut"); @@ -91,9 +134,9 @@ else { $hselected='report'; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -103,6 +146,7 @@ if (! empty($conf->accounting->enabled)) /* * Factures clients */ + $subtotal_ht = 0; $subtotal_ttc = 0; if ($modecompta == 'CREANCES-DETTES') diff --git a/htdocs/accountancy/report/result.php b/htdocs/compta/resultat/result.php similarity index 51% rename from htdocs/accountancy/report/result.php rename to htdocs/compta/resultat/result.php index fad1fcd4b9b..8bb5c99b1db 100644 --- a/htdocs/accountancy/report/result.php +++ b/htdocs/compta/resultat/result.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Alexandre Spangaro +/* Copyright (C) 2016-2017 Jamal Elbaz + * Copyright (C) 2016 Alexandre Spangaro * * 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 @@ -17,17 +17,17 @@ */ /** - * \file htdocs/accountancy/report/result.php - * \ingroup Advanced accountancy + * \file htdocs/compta/resultat/result.php + * \ingroup compta, accountancy * \brief Page for accounting result */ -require '../../main.inc.php'; -// Class -require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; $error = 0; @@ -45,20 +45,68 @@ $cancel = GETPOST('cancel'); $simple_report = GETPOST('simple_report'); -// Filter -$year = GETPOST('year','int'); -if ($year == 0) { - $year_current = strftime("%Y", time()); - $year_start = $year_current; +$date_startmonth=GETPOST('date_startmonth'); +$date_startday=GETPOST('date_startday'); +$date_startyear=GETPOST('date_startyear'); +$date_endmonth=GETPOST('date_endmonth'); +$date_endday=GETPOST('date_endday'); +$date_endyear=GETPOST('date_endyear'); + +$nbofyear=1; + +// Date range +$year=GETPOST('year','int'); +if (empty($year)) +{ + $year_current = strftime("%Y",dol_now()); + $month_current = strftime("%m",dol_now()); + $year_start = $year_current - ($nbofyear - 1); } else { $year_current = $year; - $year_start = $year; + $month_current = strftime("%m",dol_now()); + $year_start = $year - ($nbofyear - 1); +} +$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); +$date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); + +// We define date_start and date_end +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $year_end=$year_start + ($nbofyear - 1); + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + if (! GETPOST('month')) + { + if (! GETPOST("year") && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + else $month_end=$month_start; + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } if($cat_id == 0){ $cat_id = null; } +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; +if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha'); + // Security check if ($user->societe_id > 0) accessforbidden(); @@ -80,14 +128,60 @@ $form = new Form($db); $textprevyear = '' . img_previous() . ''; $textnextyear = ' ' . img_next() . ''; -$nom = $langs->trans("ReportInOut").', '.$langs->trans("ByAccounts"); -$nomlink = ''; -$periodlink = ''; -$exportlink = ''; -$builddate = time(); -$description = ''; -$period = $langs->trans("Detail").' '. $form->selectyesno('simple_report',$simple_report,0) . " " .$textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear ; -report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); + + +// Affiche en-tete de rapport +if ($modecompta=="CREANCES-DETTES") +{ + $name=$langs->trans("AnnualByAccountDueDebtMode"); + $calcmode=$langs->trans("CalcModeDebt"); + $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + //$periodlink=''.img_previous().' '.img_next().''; + $description=$langs->trans("RulesResultDue"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + else $description.= $langs->trans("DepositsAreIncluded"); + $builddate=time(); + //$exportlink=$langs->trans("NotYetAvailable"); +} +else if ($modecompta=="RECETTES-DEPENSES") { + $name=$langs->trans("AnnualByAccountInputOutputMode"); + $calcmode=$langs->trans("CalcModeEngagement"); + $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + //$periodlink=''.img_previous().' '.img_next().''; + $description=$langs->trans("RulesResultInOut"); + $builddate=time(); + //$exportlink=$langs->trans("NotYetAvailable"); +} +else if ($modecompta=="BOOKKEEPING") +{ + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByAccounts"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $nomlink = ''; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $period.='   '.$langs->trans("Detail").' '. $form->selectyesno('simple_report',$simple_report,0); + $periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear ; + $exportlink = ''; + $description=$langs->trans("RulesResultDue"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + else $description.= $langs->trans("DepositsAreIncluded"); + $builddate = time(); +} + +report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode); + + +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') +{ + print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); +} + $moreforfilter=''; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ee6e7f1be27..12826002279 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("products"); $langs->load("categories"); @@ -143,12 +143,14 @@ foreach($allparams as $key => $value) { /* * View */ + llxHeader(); + $form=new Form($db); $formother = new FormOther($db); // Show report header -$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); +$name=$langs->trans("SalesTurnover").', '.$langs->trans("ByProductsAndServices"); if ($modecompta=="CREANCES-DETTES") { $calcmode=$langs->trans("CalcModeDebt"); @@ -176,9 +178,9 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=time(); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -266,7 +268,7 @@ if ($modecompta == 'CREANCES-DETTES') print '
        '; print '

        '.$text.'
        '; print $langs->trans("CSSUrlForPaymentForm").''; -print ''; +print ''; print '   '.$langs->trans("Example").': http://mysite/mycss.css'; print '
        '; print $langs->trans("MessageOK").''; -$doleditor=new DolEditor('STRIPE_MESSAGE_OK',$conf->global->STRIPE_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); +$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); $doleditor->Create(); print '
        '; print $langs->trans("MessageKO").''; -$doleditor=new DolEditor('STRIPE_MESSAGE_KO',$conf->global->STRIPE_MESSAGE_KO,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); +$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_KO',$conf->global->ONLINE_PAYMENT_MESSAGE_KO,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); $doleditor->Create(); print '
        '; -print $langs->trans("STRIPE_PAYONLINE_SENDEMAIL").''; -print ''; +print $langs->trans("ONLINE_PAYMENT_SENDEMAIL").''; +print ''; print '   '.$langs->trans("Example").': myemail@myserver.com'; print '
        '; print $langs->trans("VendorName").''; -print ''; +print ''; print '   '.$langs->trans("Example").': '.$mysoc->name; print '
        '; print $langs->trans("VendorName").''; -print ''; +print ''; print '   '.$langs->trans("Example").': '.$mysoc->name; print '
        trans("FilterRefOrLabelOrBC"); ?>trans("Designation"); ?>
        '."\n"; - + // Category filter print ''; print ''; - + print ''; - + // Array header print ""; print_liste_field_titre( @@ -357,7 +359,7 @@ if ($modecompta == 'CREANCES-DETTES') if (count($name)) { foreach($name as $key=>$value) { - + print ''; // Product @@ -369,15 +371,15 @@ if ($modecompta == 'CREANCES-DETTES') } print "\n"; - + // Quantity print ''; - + // Percent; print ''; - + // Amount w/o VAT print ''; - + // Amount with VAT print ''; - + // Percent; print ''; - + // TODO: statistics? - + print "\n"; $i++; } @@ -423,7 +425,7 @@ if ($modecompta == 'CREANCES-DETTES') } print "
        '; @@ -283,11 +285,11 @@ if ($modecompta == 'CREANCES-DETTES') print $langs->trans("Type"). ': '; $form->select_type_of_lines(isset($selected_type)?$selected_type:-1,'search_type',1,1,1); print ''; print ''; print '
        ".$linkname."'; print $qty[$key]; print ''.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : ' ').''; /*if ($key > 0) { @@ -388,7 +390,7 @@ if ($modecompta == 'CREANCES-DETTES') print price($amount_ht[$key]); //print ''; print ''; /*if ($key > 0) { @@ -399,12 +401,12 @@ if ($modecompta == 'CREANCES-DETTES') print price($amount[$key]); //print ''; print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : ' ').'
        "; print '
        '; - + print ''; } else { // $modecompta != 'CREANCES-DETTES' diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index ad9a8fbd346..07c35b60c50 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -131,12 +131,11 @@ foreach($allparams as $key => $value) { llxHeader(); - $form=new Form($db); // Show report header if ($modecompta=="CREANCES-DETTES") { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -147,7 +146,7 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } else { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -160,9 +159,9 @@ if ($modecompta=="CREANCES-DETTES") { $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -350,9 +349,9 @@ if (count($amount)) { } $i = 0; - + foreach($arrayforsort as $key => $value) { - + print ''; // Third party diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index fdba026ac6f..f4beaf0b157 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("companies"); $langs->load("categories"); @@ -165,7 +165,7 @@ $formother = new FormOther($db); // Show report header if ($modecompta=="CREANCES-DETTES") { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -176,7 +176,7 @@ if ($modecompta=="CREANCES-DETTES") $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } else { - $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); + $name=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -187,9 +187,9 @@ if ($modecompta=="CREANCES-DETTES") //$exportlink=$langs->trans("NotYetAvailable"); } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$tableparams,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 1735033cab7..e3f0e36186a 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -25,21 +25,68 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + + +$date_startmonth=GETPOST('date_startmonth'); +$date_startday=GETPOST('date_startday'); +$date_startyear=GETPOST('date_startyear'); +$date_endmonth=GETPOST('date_endmonth'); +$date_endday=GETPOST('date_endday'); +$date_endyear=GETPOST('date_endyear'); -$year_start=GETPOST("year_start"); -$year_current = strftime("%Y",time()); $nbofyear=4; -if (! $year_start) { - $year_start = $year_current - ($nbofyear-1); - $year_end = $year_current; + +// Date range +$year=GETPOST('year','int'); +if (empty($year)) +{ + $year_current = strftime("%Y",dol_now()); + $month_current = strftime("%m",dol_now()); + $year_start = $year_current - ($nbofyear - 1); +} else { + $year_current = $year; + $month_current = strftime("%m",dol_now()); + $year_start = $year - ($nbofyear - 1); } -else { - $year_end=$year_start + ($nbofyear-1); +$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); +$date_end=dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); + +// We define date_start and date_end +if (empty($date_start) || empty($date_end)) // We define date_start and date_end +{ + $q=GETPOST("q")?GETPOST("q"):0; + if ($q==0) + { + // We define date_start and date_end + $year_end=$year_start + ($nbofyear - 1); + $month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1); + if (! GETPOST('month')) + { + if (! GETPOST("year") && $month_start > $month_current) + { + $year_start--; + $year_end--; + } + $month_end=$month_start-1; + if ($month_end < 1) $month_end=12; + else $year_end++; + } + else $month_end=$month_start; + $date_start=dol_get_first_day($year_start,$month_start,false); $date_end=dol_get_last_day($year_end,$month_end,false); + } + if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); } + if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); } + if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); } + if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } + $userid=GETPOST('userid','int'); $socid = GETPOST('socid','int'); -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') + +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') $modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha'); // Security check @@ -55,16 +102,17 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin */ llxHeader(); + $form=new Form($db); // Affiche en-tete du rapport if ($modecompta=="CREANCES-DETTES") { - $nom=$langs->trans("SalesTurnover"); + $name=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; - $period="$year_start - $year_end"; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCADue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); @@ -74,11 +122,11 @@ if ($modecompta=="CREANCES-DETTES") } else if ($modecompta=="RECETTES-DEPENSES") { - $nom=$langs->trans("SalesTurnover"); + $name=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; - $period="$year_start - $year_end"; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCAIn"); $description.= $langs->trans("DepositsAreIncluded"); @@ -87,23 +135,24 @@ else if ($modecompta=="RECETTES-DEPENSES") } else if ($modecompta=="BOOKKEEPING") { - $nom=$langs->trans("BookkeepingTurnover"); + $name=$langs->trans("SalesTurnover"); $calcmode=$langs->trans("CalcModeBookkeeping"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $period="$year_start - $year_end"; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()." ".img_next()."":""); - $description=$langs->trans("RulesCABookkeeping"); - $description.= $langs->trans("DepositsAreIncluded"); + $description=$langs->trans("RulesCADue"); + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + else $description.= $langs->trans("DepositsAreIncluded"); $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } $moreparam=array(); if (! empty($modecompta)) $moreparam['modecompta']=$modecompta; -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam,$calcmode); -if (! empty($conf->accounting->enabled)) +if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -252,7 +301,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) { $mois_modulo = $mois;// ajout if($mois>12){$mois_modulo = $mois-12;} // ajout - + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B").""; @@ -342,7 +391,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) /* for ($mois = 1 ; $mois < 13 ; $mois++) { - + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois,1,2000),"%B").""; @@ -510,7 +559,7 @@ print '

        This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
        \r\n(For example, when hosted on any SaaS solution like DoliCloud - 
        http://www.dolicloud.com).

        '; $totalam_Rac += $obj->am; $i++; } - + print "Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r?gl? des factures partiellement r?gl?es"; } $db->free($resql); @@ -560,7 +609,7 @@ print '
        '; $total_pr += $obj->total_ttc-$obj->tot_fttc; $i++; } - + print "Signe et non facture:".price($total_pr)."<-- bug ici, ca devrait exclure le deja facture"; } $db->free($resql); diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 0ede7fa091e..b41d23303cf 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -220,7 +220,7 @@ if ($modetax==0) { // Invoice for goods, payment for services $vatsup.=' ('.$langs->trans("ToGetBack").')'; } } -report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -260,7 +260,7 @@ if (is_array($coll_list)) { $i = 1; foreach ($coll_list as $coll) { if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { if($coll->assuj == '1') { @@ -340,7 +340,7 @@ if (is_array($coll_list)) { $i = 1; foreach ($coll_list as $coll) { if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - + $intra = str_replace($find,$replace,$coll->tva_intra); if (empty($intra)) { if ($coll->assuj == '1') { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 513eb25ff7e..a92e79b81a3 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -133,7 +133,7 @@ $fsearch.=' '; // Affiche en-tete du rapport if ($modetax==1) // Calculate on invoice for goods and services { - $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); + $name=$langs->trans("VATReportByQuartersInDueDebtMode"); $calcmode=$langs->trans("CalcModeVATDebt"); $calcmode.='
        ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -172,7 +172,7 @@ if ($modetax==1) // Calculate on invoice for goods and services } if ($modetax==0) // Invoice for goods, payment for services { - $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); + $name=$langs->trans("VATReportByQuartersInInputOutputMode"); $calcmode=$langs->trans("CalcModeVATEngagement"); $calcmode.='
        ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -210,7 +210,7 @@ if ($modetax==0) // Invoice for goods, payment for services if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -396,7 +396,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref @@ -553,7 +553,7 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - + print ''; // Ref diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php index a3d902ed3f3..2f35e5f10ba 100644 --- a/htdocs/compta/tva/quarter_report.php +++ b/htdocs/compta/tva/quarter_report.php @@ -146,7 +146,7 @@ $fsearch.=' '; // Affiche en-tete du rapport if ($modetax==1) { // Calculate on invoice for goods and services - $nom=$langs->trans("VATReportByQuartersInDueDebtMode"); + $name=$langs->trans("VATReportByQuartersInDueDebtMode"); $calcmode=$langs->trans("CalcModeVATDebt"); $calcmode.='
        ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -195,7 +195,7 @@ if ($modetax==1) { // Calculate on invoice for goods and services } } if ($modetax==0) { // Invoice for goods, payment for services - $nom=$langs->trans("VATReportByQuartersInInputOutputMode"); + $name=$langs->trans("VATReportByQuartersInInputOutputMode"); $calcmode=$langs->trans("CalcModeVATEngagement"); $calcmode.='
        ('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); @@ -244,7 +244,7 @@ if ($modetax==0) { // Invoice for goods, payment for services $vatsup.=' ('.$langs->trans("ToGetBack").')'; } } -report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); @@ -373,18 +373,18 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print ''.$langs->trans("AmountHTVATRealReceived").''; print ''.$vatcust.''; print ''; - + $action = "tvadetail"; $parameters["mode"] = $modetax; $parameters["start"] = $date_start; $parameters["end"] = $date_end; $parameters["type"] = 'vat'; - + $object = array(&$x_coll, &$x_paye, &$x_both); // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - + foreach (array_keys($x_coll) as $rate) { $subtot_coll_total_ht = 0; $subtot_coll_vat = 0; @@ -408,7 +408,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $type=1; } - + print ''; // Ref @@ -576,7 +576,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $type=1; } - + print ''; // Ref diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 2c13485d0e9..1b80a4bc2ec 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -35,7 +35,7 @@ * @param string $exportlink Link for export or '' * @param array $moreparam Array with list of params to add into form * @param string $calcmode Calculation mode - * @param string $varlink Add a variable into the address of the page + * @param string $varlink Add a variable into the address of the page * @return void */ function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') @@ -43,9 +43,9 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat global $langs; if (empty($hselected)) $hselected='report'; - + print "\n\n\n"; - + if(! empty($varlink)) $varlink = '?'.$varlink; $h=0; @@ -116,7 +116,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat print ''; dol_fiche_end(); - + print "\n\n\n"; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index a4b6bfaa3bd..26215ab99ad 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -249,9 +249,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Balance insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); -- Reports - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByAccounts', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByAccounts', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8d22592fd14..b9182542c18 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1118,10 +1118,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Reports $langs->load("compta"); - $newmenu->add("/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/accountancy/report/result.php?leftmenu=accountancy_report",$langs->trans("ByAccounts"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByAccounts"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 83525cd1e6b..d9aa1541b76 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -209,3 +209,20 @@ UPDATE llx_const set name = 'ONLINE_PAYMENT_NEWFORMTEXT' where name = 'PAYPAL_NE UPDATE llx_const set name = 'ONLINE_PAYMENT_LOGO' where name = 'PAYPAL_LOGO'; + +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) COLLATE utf8_unicode_ci; + + diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index d49256e7c32..3a1d8bb9c5f 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -134,6 +134,7 @@ CalcModeVATDebt=Mode %sVAT on commitment accounting%s. CalcModeVATEngagement=Mode %sVAT on incomes-expenses%s. CalcModeDebt=Mode %sClaims-Debts%s said Commitment accounting. CalcModeEngagement=Mode %sIncomes-Expenses%s said cash accounting +CalcModeBookkeeping=Analysis of data journalized in Bookkeeping Ledger table CalcModeLT1= Mode %sRE on customer invoices - suppliers invoices%s CalcModeLT1Debt=Mode %sRE on customer invoices%s CalcModeLT1Rec= Mode %sRE on suppliers invoices%s @@ -146,6 +147,7 @@ AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by third par AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third parties, mode %sIncomes-Expenses%s said cash accounting. SeeReportInInputOutputMode=See report %sIncomes-Expenses%s said cash accounting for a calculation on actual payments made SeeReportInDueDebtMode=See report %sClaims-Debts%s said commitment accounting for a calculation on issued invoices +SeeReportInBookkeepingMode=See report %sBookeeping%s for a calculation on bookkeeping table analysis RulesAmountWithTaxIncluded=- Amounts shown are with all taxes included RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whether they are paid or not. Is also includes paid salaries.
        - It is based on the validation date of invoices and VAT and on the due date for expenses. For salaries defined with Salary module, the value date of payment is used. RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries.
        - It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation. From 31a74d448cf0d3b0374fb6439db7198c042a0bef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 18:29:57 +0200 Subject: [PATCH 0225/1137] Work on accounting reports. --- htdocs/accountancy/admin/account.php | 52 +- htdocs/accountancy/admin/categories_list.php | 4 + .../class/accountancycategory.class.php | 19 +- htdocs/accountancy/index.php | 3 + htdocs/compta/resultat/clientfourn.php | 1640 +++++++++-------- htdocs/compta/resultat/index.php | 885 +++++---- htdocs/compta/resultat/result.php | 407 ++-- htdocs/compta/stats/cabyprodserv.php | 3 + htdocs/compta/stats/cabyuser.php | 2 + htdocs/compta/stats/casoc.php | 2 + htdocs/compta/stats/index.php | 1 + htdocs/core/lib/functions.lib.php | 33 +- htdocs/core/menus/init_menu_auguria.sql | 8 +- htdocs/core/menus/standard/eldy.lib.php | 6 +- htdocs/install/mysql/data/llx_accounting.sql | 1472 +++++++-------- .../mysql/data/llx_accounting_category.sql | 6 +- .../install/mysql/migration/6.0.0-7.0.0.sql | 4 + htdocs/langs/en_US/accountancy.lang | 12 +- htdocs/langs/en_US/compta.lang | 9 +- .../template/class/myobject.class.php | 3 +- 20 files changed, 2481 insertions(+), 2090 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 905fd8b97ef..3db93b45558 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -69,8 +69,8 @@ $arrayfields=array( 'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1), 'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0), - 'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0), - 'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0), + 'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'), + 'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'), 'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1) ); @@ -94,9 +94,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { if (! empty($cancel)) $action = ''; - + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers { $search_account = ""; @@ -106,13 +106,13 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options=array(); } - + if (GETPOST('change_chart')) { $chartofaccounts = GETPOST('chartofaccounts', 'int'); - + if (! empty($chartofaccounts)) { - + if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { $error ++; } @@ -120,12 +120,12 @@ if (empty($reshook)) $error ++; } } - + if ($action == 'disable') { if ($accounting->fetch($id)) { $result = $accounting->account_desactivate($id); } - + $action = 'update'; if ($result < 0) { setEventMessages($accounting->error, $accounting->errors, 'errors'); @@ -179,7 +179,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); -} +} $sql .= $db->plimit($limit + 1, $offset); @@ -209,11 +209,11 @@ if ($resql) print ''; print ''; print ''; - + $htmlbuttonadd = '' . $langs->trans("Addanaccount") . ''; - + print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd); - + // Box to select active chart of account print $langs->trans("Selectchartofaccounts") . " : "; print '"; print ''; - print '
        '; + print '
        '; print '
        '; - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
        '; print ''."\n"; @@ -259,13 +259,13 @@ if ($resql) print $searchpicto; print ''; print ''; - + print ''; if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_type']['help']); + if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder,'',$arrayfields['aa.pcg_subtype']['help']); if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -274,14 +274,14 @@ if ($resql) $accountparent = new AccountingAccount($db); $i=0; - while ($i < min($num, $limit)) + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $accountstatic->id = $obj->rowid; $accountstatic->label = $obj->label; $accountstatic->account_number = $obj->account_number; - + print ''; // Account number @@ -310,7 +310,7 @@ if ($resql) $accountparent->id = $obj->rowid2; $accountparent->label = $obj->label2; $accountparent->account_number = $obj->account_number2; - + print "\n"; @@ -371,11 +371,11 @@ if ($resql) } print '' . "\n"; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; } - + print "
        "; print $accountparent->getNomUrl(1); print "
        "; print "
        "; print ''; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 270d882eac7..fb3328c047d 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -458,6 +458,10 @@ $titlepicto='title_setup'; print load_fiche_titre($titre,$linkback,$titlepicto); +if ($id == 32) +{ + print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

        '; +} // Confirmation de la suppression de la ligne if ($action == 'delete') diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index a7bab16b30d..819a46d138a 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -334,19 +334,20 @@ class AccountancyCategory /** * Function to show result of an accounting account from the ledger with a direction and a period * - * @param int $cpt Id accounting account - * @param string $month Specifig month - Can be empty - * @param string $year Specific year - * @param int $sens Sens of the account 0: credit - debit 1: debit - credit - * - * @return integer Result in table + * @param int $cpt Id accounting account + * @param string $month Specifig month - Can be empty + * @param string $date_start Date start + * @param string $date_end Date end + * @param int $sens Sens of the account 0: credit - debit 1: debit - credit + * @return integer Result in table */ - public function getResult($cpt, $month, $year, $sens) { + public function getResult($cpt, $month, $date_start, $date_end, $sens) + { $sql = "SELECT SUM(t.debit) as debit, SUM(t.credit) as credit"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t"; $sql .= " WHERE t.numero_compte = '" . $cpt."'"; - $sql .= " AND YEAR(t.doc_date) = " . $year; - + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.doc_date >= '".$this->db->idate($date_start)."' AND t.doc_date <= '".$this->db->idate($date_end)."'"; if (! empty($month)) { $sql .= " AND MONTH(t.doc_date) = " . $month; } diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index bf3e80fe866..23fdc7ba5b0 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -138,6 +138,9 @@ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, print "
        \n"; +print '
        '; + + print "
        \n"; print_fiche_titre($langs->trans("AccountancyAreaDescActionFreq"), '', 'object_calendarweek'); print '
        '; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 4994737d3c3..195292e6471 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -23,8 +23,9 @@ */ /** - * \file htdocs/compta/resultat/clientfourn.php - * \brief Page reporting + * \file htdocs/compta/resultat/clientfourn.php + * \ingroup compta, accountancy + * \brief Page reporting */ require '../../main.inc.php'; @@ -34,10 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - -$langs->load("bills"); -$langs->load("donation"); -$langs->load("salaries"); +$langs->loadLangs(array('compta','bills','donation','salaries')); $date_startmonth=GETPOST('date_startmonth'); $date_startday=GETPOST('date_startday'); @@ -60,7 +58,7 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield='s.nom, s.rowid'; +//if (! $sortfield) $sortfield='s.nom, s.rowid'; if (! $sortorder) $sortorder='ASC'; // Date range @@ -107,8 +105,18 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta=(GETPOST("modecompta")?GETPOST("modecompta"):$conf->global->ACCOUNTING_MODE); +// $date_start and $date_end are defined. We force $start_year and $nbofyear +$tmps=dol_getdate($date_start); +$start_year = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $start_year) + 1; +//var_dump($start_year." ".$end_year." ".$nbofyear); + +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; +if (GETPOST("modecompta",'alpha')) $modecompta=GETPOST("modecompta",'alpha'); /* @@ -129,28 +137,44 @@ $total_ttc=0; // Affiche en-tete de rapport if ($modecompta=="CREANCES-DETTES") { - $name=$langs->trans("AnnualByCompaniesDueDebtMode"); + $name=$langs->trans("AnnualByCompanies"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=''.img_previous().' '.img_next().''; + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesResultDue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -else { - $name=$langs->trans("AnnualByCompaniesInputOutputMode"); +elseif ($modecompta=="RECETTES-DEPENSES") +{ + $name=$langs->trans("AnnualByCompanies"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - //$periodlink=''.img_previous().' '.img_next().''; + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesResultInOut"); $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } +elseif ($modecompta=="BOOKKEEPING") +{ + $name=$langs->trans("AnnualByCompanies"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $periodlink=($year_start?"".img_previous()." ".img_next()."":""); + $description=$langs->trans("RulesResultBookkeepingPredefined", $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("Chartofaccounts")); + $builddate=time(); + //$exportlink=$langs->trans("NotYetAvailable"); +} $hselected = 'report'; @@ -173,451 +197,268 @@ if ($date_endyear) $param.='&date_endyear='.$date_startyear; print ''; print ''; print_liste_field_titre(''); -print_liste_field_titre("Name", $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder); -if ($modecompta == 'CREANCES-DETTES') +print_liste_field_titre($langs->trans("Groups"), $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder); +if ($modecompta == 'BOOKKEEPING') { - print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"],'amount_ht','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"],'amount','',$param,'align="right"',$sortfield,$sortorder); +} +else +{ + if ($modecompta == 'CREANCES-DETTES') + { + print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"],'amount_ht','',$param,'align="right"',$sortfield,$sortorder); + } + print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"],'amount_ttc','',$param,'align="right"',$sortfield,$sortorder); } -print_liste_field_titre("AmountTTC", $_SERVER["PHP_SELF"],'amount_ttc','',$param,'align="right"',$sortfield,$sortorder); print "\n"; -/* - * Factures clients - */ -print ''; -if ($modecompta == 'CREANCES-DETTES') + +if ($modecompta == 'BOOKKEEPING') { - $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2,5)"; - else - $sql.= " AND f.type IN (0,1,2,3,5)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -else -{ - /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) - */ - $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " WHERE p.rowid = pf.fk_paiement"; - $sql.= " AND pf.fk_facture = f.rowid"; - $sql.= " AND f.fk_soc = s.rowid"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql.= " GROUP BY s.nom, s.rowid"; -$sql.= $db->order($sortfield, $sortorder); - -dol_syslog("get customer invoices", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - - print ''; - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - - $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); - $total_ttc += $objp->amount_ttc; - print "\n"; - $i++; - } - $db->free($result); -} else { - dol_print_error($db); -} - -// On ajoute les paiements clients anciennes version, non lie par paiement_facture -if ($modecompta != 'CREANCES-DETTES') -{ - $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; - $sql.= " WHERE pf.rowid IS NULL"; - $sql.= " AND p.fk_bank = b.rowid"; - $sql.= " AND b.fk_account = ba.rowid"; - $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY name, idp"; - $sql.= " ORDER BY name"; - - dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG); - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) - { - $objp = $db->fetch_object($result); - - - print ''; - print "\n"; - print "\n"; - - $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); - $total_ttc += $objp->amount_ttc; - - print "\n"; - $i++; - } - } - $db->free($result); - } else { - dol_print_error($db); - } -} - -if ($total_ttc == 0) -{ - print ''; - print ''; - print ''; -} - -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - - -/* - * Suppliers invoices - */ -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2)"; - else - $sql.= " AND f.type IN (0,1,2,3)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; -} -else -{ - $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; - $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " ON pf.fk_facturefourn = f.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s"; - $sql.= " ON f.fk_soc = s.rowid"; - $sql.= " WHERE p.rowid = pf.fk_paiementfourn "; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql .= " GROUP BY s.nom, s.rowid"; -$sql.= $db->order($sortfield, $sortorder); - -print ''; - -$subtotal_ht = 0; -$subtotal_ttc = 0; -dol_syslog("get suppliers invoices", LOG_DEBUG); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num > 0) - { - while ($i < $num) - { - $objp = $db->fetch_object($result); - - print ''; - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - - $total_ht -= (isset($objp->amount_ht)?$objp->amount_ht:0); - $total_ttc -= $objp->amount_ttc; - $subtotal_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); - $subtotal_ttc += $objp->amount_ttc; - - print "\n"; - $i++; - } - } - else - { - print ''; - print ''; - print ''; - } - - $db->free($result); -} else { - dol_print_error($db); -} -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - - - -/* - * Charges sociales non deductibles - */ - -print ''; - -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; -} -else -{ - $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -} -$sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle, c.id"; -$newsortfield = $sortfield; -if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; -if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; -if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; -$sql.= $db->order($newsortfield, $sortorder); - -dol_syslog("get social contributions deductible=0", LOG_DEBUG); -$result=$db->query($sql); -$subtotal_ht = 0; -$subtotal_ttc = 0; -if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - print ''; - print ''; - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; - $i++; - } - } - else { - print ''; - print ''; - print ''; - } -} else { - dol_print_error($db); -} -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - - -/* - * Charges sociales deductibles - */ - -print ''; - -if ($modecompta == 'CREANCES-DETTES') -{ - $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - $sql.= " AND cs.entity = ".$conf->entity; -} -else -{ - $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - $sql.= " AND cs.entity = ".$conf->entity; -} -$sql.= " GROUP BY c.libelle, c.id"; -$newsortfield = $sortfield; -if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; -if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; -if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; -$sql.= $db->order($newsortfield, $sortorder); - -dol_syslog("get social contributions deductible=1", LOG_DEBUG); -$result=$db->query($sql); -$subtotal_ht = 0; -$subtotal_ttc = 0; -if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - print ''; - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; - $i++; - } - } - else { - print ''; - print ''; - print ''; - } -} else { - dol_print_error($db); -} -print ''; -if ($modecompta == 'CREANCES-DETTES') - print ''; -print ''; -print ''; - -if ($mysoc->tva_assuj == 'franchise') // Non assujetti -{ - // Total - print ''; - print ''; - print ''; - - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; -} - - -/* - * Salaries - */ - -if (! empty($conf->salaries->enabled)) -{ - if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; - } else { - $column = 'p.datep'; - } - - print ''; - $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; - $sql.= " WHERE p.entity = ".$conf->entity; + $sql = "SELECT f.thirdparty_code as name, -1 as socid, aa.pcg_type, aa.pcg_subtype, sum(f.credit - f.debit) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f"; + $sql.= ", ".MAIN_DB_PREFIX."accounting_account as aa"; + $sql.= " WHERE f.numero_compte = aa.account_number"; + $sql.= " AND pcg_type in ('EXPENSE','INCOME')"; if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + $sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY name, socid, pcg_type, pcg_subtype"; + $sql.= $db->order($sortfield, $sortorder); - $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'u.firstname, u.lastname'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); + $oldpcgtype = ''; - dol_syslog("get payment salaries"); - $result=$db->query($sql); - $subtotal_ht = 0; - $subtotal_ttc = 0; - if ($result) + dol_syslog("get bookkeeping entries", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num > 0) + { + while ($i < $num) + { + $objp = $db->fetch_object($result); + + if ($objp->pcg_type != $oldpcgtype) + { + print ''; + $oldpcgtype = $objp->pcg_type; + } + + print ''; + print ''; + print '\n"; + print '\n"; + print "\n"; + + $total_ht += (isset($objp->amount)?$objp->amount:0); + $total_ttc += (isset($objp->amount)?$objp->amount:0); + + $i++; + } + } + else + { + print ''; + } + } + else dol_print_error($db); +} +else +{ + /* + * Factures clients + */ + print ''; + + if ($modecompta == 'CREANCES-DETTES') { + $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2,5)"; + else + $sql.= " AND f.type IN (0,1,2,3,5)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + elseif ($modecompta == 'RECETTES-DEPENSES') + { + /* + * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les + * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + */ + $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " WHERE p.rowid = pf.fk_paiement"; + $sql.= " AND pf.fk_facture = f.rowid"; + $sql.= " AND f.fk_soc = s.rowid"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql.= " GROUP BY name, socid"; + $sql.= $db->order($sortfield, $sortorder); + + dol_syslog("get customer invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { $num = $db->num_rows($result); $i = 0; - if ($num) + while ($i < $num) + { + $objp = $db->fetch_object($result); + + print ''; + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; + + $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); + $total_ttc += $objp->amount_ttc; + print "\n"; + $i++; + } + $db->free($result); + } else { + dol_print_error($db); + } + + // On ajoute les paiements clients anciennes version, non lie par paiement_facture + if ($modecompta == 'RECETTES-DEPENSES') + { + $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; + $sql.= " WHERE pf.rowid IS NULL"; + $sql.= " AND p.fk_bank = b.rowid"; + $sql.= " AND b.fk_account = ba.rowid"; + $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY name, idp"; + $sql.= " ORDER BY name"; + + dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) + { + $objp = $db->fetch_object($result); + + + print ''; + print "\n"; + print "\n"; + + $total_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); + $total_ttc += $objp->amount_ttc; + + print "\n"; + $i++; + } + } + $db->free($result); + } else { + dol_print_error($db); + } + } + + if ($total_ttc == 0) + { + print ''; + print ''; + print ''; + } + + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + + + /* + * Suppliers invoices + */ + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2)"; + else + $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + elseif ($modecompta == 'RECETTES-DEPENSES') + { + $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; + $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " ON pf.fk_facturefourn = f.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s"; + $sql.= " ON f.fk_soc = s.rowid"; + $sql.= " WHERE p.rowid = pf.fk_paiementfourn "; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql .= " GROUP BY name, socid"; + $sql.= $db->order($sortfield, $sortorder); + + print ''; + + $subtotal_ht = 0; + $subtotal_ttc = 0; + dol_syslog("get suppliers invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num > 0) { while ($i < $num) { - $obj = $db->fetch_object($result); - - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; + $objp = $db->fetch_object($result); print ''; + print "\n"; - print "\n"; + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; + $total_ht -= (isset($objp->amount_ht)?$objp->amount_ht:0); + $total_ttc -= $objp->amount_ttc; + $subtotal_ht += (isset($objp->amount_ht)?$objp->amount_ht:0); + $subtotal_ttc += $objp->amount_ttc; + + print "\n"; $i++; } } @@ -627,9 +468,9 @@ if (! empty($conf->salaries->enabled)) print ''; print ''; } - } - else - { + + $db->free($result); + } else { dol_print_error($db); } print ''; @@ -637,377 +478,638 @@ if (! empty($conf->salaries->enabled)) print ''; print ''; print ''; -} -/* - * Expense - */ -if (! empty($conf->expensereport->enabled)) -{ - $langs->load('trips'); - if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; - $sql.= " WHERE p.entity = ".getEntity('expensereport'); - $sql.= " AND p.fk_statut>=5"; - $column='p.date_valid'; - } else { - $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; - $sql.= " WHERE p.entity = ".getEntity('expensereport'); - $sql.= " AND p.fk_statut>=5"; + /* + * Charges sociales non deductibles + */ - $column='pe.datep'; - } + print ''; - print ''; - - if (! empty($date_start) && ! empty($date_end)) + if ($modecompta == 'CREANCES-DETTES') { - $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } + elseif ($modecompta == 'RECETTES-DEPENSES') + { + $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " GROUP BY c.libelle, c.id"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref'; - $sql.= $db->order($newsortfield, $sortorder); + $sql.= $db->order($newsortfield, $sortorder); - dol_syslog("get expense report outcome"); + dol_syslog("get social contributions deductible=0", LOG_DEBUG); $result=$db->query($sql); $subtotal_ht = 0; $subtotal_ttc = 0; - if ($result) - { + if ($result) { $num = $db->num_rows($result); - if ($num) - { - while ($obj = $db->fetch_object($result)) - { - $total_ht -= $obj->amount_ht; - $total_ttc -= $obj->amount_ttc; - $subtotal_ht += $obj->amount_ht; - $subtotal_ttc += $obj->amount_ttc; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - print ''; + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; - } - } - else - { - print ''; - print ''; - print ''; - } - } - else - { - dol_print_error($db); + print ''; + print ''; + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + $i++; + } + } + else { + print ''; + print ''; + print ''; + } + } else { + dol_print_error($db); } print ''; if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; - print ''; -} + print ''; + print ''; -/* - * Donations - */ -if (! empty($conf->don->enabled)) -{ - print ''; + /* + * Charges sociales deductibles + */ + + print ''; + if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; - $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " AND fk_statut in (1,2)"; + $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + $sql.= " AND cs.entity = ".$conf->entity; } - else + elseif ($modecompta == 'RECETTES-DEPENSES') { - $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; - $sql.= " WHERE p.entity = ".getEntity('donation'); - $sql.= " AND fk_statut >= 2"; + $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " AND cs.entity = ".$conf->entity; } - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.societe, p.firstname, p.lastname, dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); + $sql.= " GROUP BY c.libelle, c.id"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); - dol_syslog("get dunning"); + dol_syslog("get social contributions deductible=1", LOG_DEBUG); $result=$db->query($sql); $subtotal_ht = 0; $subtotal_ttc = 0; - if ($result) + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + print ''; + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + $i++; + } + } + else { + print ''; + print ''; + print ''; + } + } else { + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + + if ($mysoc->tva_assuj == 'franchise') // Non assujetti { - $num = $db->num_rows($result); - $i = 0; - if ($num) + // Total + print ''; + print ''; + print ''; + + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + } + + + /* + * Salaries + */ + + if (! empty($conf->salaries->enabled)) + { + print ''; + + if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { - while ($i < $num) + if ($modecompta == 'CREANCES-DETTES') { + $column = 'p.datev'; + } else { + $column = 'p.datep'; + } + + $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; + $sql.= " WHERE p.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + + $sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'u.firstname, u.lastname'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + } + + dol_syslog("get payment salaries"); + $result=$db->query($sql); + $subtotal_ht = 0; + $subtotal_ttc = 0; + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + print ''; + + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + $i++; + } + } + else + { + print ''; + print ''; + print ''; + } + } + else + { + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + } + + + /* + * Expense + */ + + if (! empty($conf->expensereport->enabled)) + { + if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') + { + $langs->load('trips'); + if ($modecompta == 'CREANCES-DETTES') { + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; + $sql.= " WHERE p.entity = ".getEntity('expensereport'); + $sql.= " AND p.fk_statut>=5"; + + $column='p.date_valid'; + } else { + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " WHERE p.entity = ".getEntity('expensereport'); + $sql.= " AND p.fk_statut>=5"; + + $column='pe.datep'; + } + + if (! empty($date_start) && ! empty($date_end)) { - $obj = $db->fetch_object($result); + $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; + } - $total_ht += $obj->amount; - $total_ttc += $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; + $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref'; + $sql.= $db->order($newsortfield, $sortorder); + } + print ''; + + dol_syslog("get expense report outcome"); + $result=$db->query($sql); + $subtotal_ht = 0; + $subtotal_ttc = 0; + if ($result) + { + $num = $db->num_rows($result); + if ($num) + { + while ($obj = $db->fetch_object($result)) + { + $total_ht -= $obj->amount_ht; + $total_ttc -= $obj->amount_ttc; + $subtotal_ht += $obj->amount_ht; + $subtotal_ttc += $obj->amount_ttc; + + print ''; + + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + } + } + else + { print ''; - - print "\n"; - - if ($modecompta == 'CREANCES-DETTES') print ''; - print ''; + print ''; print ''; - $i++; } } else { - print ''; - print ''; - print ''; + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + } + + /* + * Donations + */ + + if (! empty($conf->don->enabled)) + { + print ''; + + if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') + { + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; + $sql.= " WHERE p.entity = ".$conf->entity; + $sql.= " AND fk_statut in (1,2)"; + } + else + { + $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; + $sql.= " WHERE p.entity = ".getEntity('donation'); + $sql.= " AND fk_statut >= 2"; + } + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; + } + $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.societe, p.firstname, p.lastname, dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get dunning"); + $result=$db->query($sql); + $subtotal_ht = 0; + $subtotal_ttc = 0; + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total_ht += $obj->amount; + $total_ttc += $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + print ''; + + print "\n"; + + if ($modecompta == 'CREANCES-DETTES') print ''; + print ''; + print ''; + $i++; + } + } + else + { + print ''; + print ''; + print ''; + } + } + else + { + dol_print_error($db); + } + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; + } + + + /* + * VAT + */ + + print ''; + $subtotal_ht = 0; + $subtotal_ttc = 0; + + if ($conf->tax->enabled && ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES')) + { + if ($modecompta == 'CREANCES-DETTES') + { + // TVA a payer + $amount=0; + $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.tva) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2,5)"; + else + $sql.= " AND f.type IN (0,1,2,3,5)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat to pay", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $amount -= $obj->amount; + //$total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + //$subtotal_ht -= $obj->amount; + $subtotal_ttc -= $obj->amount; + $i++; + } + } + } else { + dol_print_error($db); + } + print ''; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + + // TVA a recuperer + $amount=0; + $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + $sql.= " AND f.type IN (0,1,2)"; + else + $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat received back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $amount += $obj->amount; + //$total_ht += $obj->amount; + $total_ttc += $obj->amount; + //$subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); + } + print ''; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } + else + { + // VAT really already paid + $amount=0; + $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount > 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " AND t.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat really paid", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + $amount -= $obj->amount; + $total_ht -= $obj->amount; + $total_ttc -= $obj->amount; + $subtotal_ht -= $obj->amount; + $subtotal_ttc -= $obj->amount; + + $i++; + } + } + $db->free($result); + } else { + dol_print_error($db); + } + print ''; + print "\n"; + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; + print "\n"; + + // VAT really received + $amount=0; + $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount < 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " AND t.entity = ".$conf->entity; + $sql.= " GROUP BY dm"; + $newsortfield = $sortfield; + if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; + if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; + if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; + $sql.= $db->order($newsortfield, $sortorder); + + dol_syslog("get vat really received back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + $amount += $obj->amount; + $total_ht += $obj->amount; + $total_ttc += $obj->amount; + $subtotal_ht += $obj->amount; + $subtotal_ttc += $obj->amount; + + $i++; + } + } + $db->free($result); + } + else + { + dol_print_error($db); + } + print ''; + print "\n"; + if ($modecompta == 'CREANCES-DETTES') + print "\n"; + print "\n"; + print "\n"; } } - else + + if ($mysoc->tva_assuj != 'franchise') // Assujetti { - dol_print_error($db); + print ''; + if ($modecompta == 'CREANCES-DETTES') + print ''; + print ''; + print ''; } - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; -} - -/* - * VAT - */ - -print ''; -$subtotal_ht = 0; -$subtotal_ttc = 0; - -if ($modecompta == 'CREANCES-DETTES') -{ - // TVA a payer - $amount=0; - $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2,5)"; - else - $sql.= " AND f.type IN (0,1,2,3,5)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat to pay", LOG_DEBUG); - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); - - $amount -= $obj->amount; - //$total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - //$subtotal_ht -= $obj->amount; - $subtotal_ttc -= $obj->amount; - $i++; - } - } - } else { - dol_print_error($db); - } - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - - // TVA a recuperer - $amount=0; - $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) - $sql.= " AND f.type IN (0,1,2)"; - else - $sql.= " AND f.type IN (0,1,2,3)"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat received back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); - - $amount += $obj->amount; - //$total_ht += $obj->amount; - $total_ttc += $obj->amount; - //$subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } - print ''; - print "\n"; - print "\n"; - print "\n"; - print "\n"; -} -else -{ - // VAT really already paid - $amount=0; - $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount > 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat really paid", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $amount -= $obj->amount; - $total_ht -= $obj->amount; - $total_ttc -= $obj->amount; - $subtotal_ht -= $obj->amount; - $subtotal_ttc -= $obj->amount; - - $i++; - } - } - $db->free($result); - } else { - dol_print_error($db); - } - print ''; - print "\n"; - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - print "\n"; - - // VAT really received - $amount=0; - $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount < 0"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - $newsortfield = $sortfield; - if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm'; - if ($newsortfield == 'amount_ht') $newsortfield = 'amount'; - if ($newsortfield == 'amount_ttc') $newsortfield = 'amount'; - $sql.= $db->order($newsortfield, $sortorder); - - dol_syslog("get vat really received back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - $amount += $obj->amount; - $total_ht += $obj->amount; - $total_ttc += $obj->amount; - $subtotal_ht += $obj->amount; - $subtotal_ttc += $obj->amount; - - $i++; - } - } - $db->free($result); - } - else - { - dol_print_error($db); - } - print ''; - print "\n"; - if ($modecompta == 'CREANCES-DETTES') - print "\n"; - print "\n"; - print "\n"; -} - - -if ($mysoc->tva_assuj != 'franchise') // Assujetti -{ - print ''; - if ($modecompta == 'CREANCES-DETTES') - print ''; - print ''; - print ''; } $action = "balanceclient"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index c1a352bc969..cf07c7886f9 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -21,14 +21,16 @@ */ /** - * \file htdocs/compta/resultat/index.php - * \brief Page reporting result + * \file htdocs/compta/resultat/index.php + * \ingroup compta, accountancy + * \brief Page reporting result */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +$langs->loadLangs(array('compta','bills','donation','salaries')); $date_startmonth=GETPOST('date_startmonth'); $date_startday=GETPOST('date_startday'); @@ -83,15 +85,24 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } +// $date_start and $date_end are defined. We force $start_year and $nbofyear +$tmps=dol_getdate($date_start); +$start_year = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $start_year) + 1; +//var_dump($start_year." ".$end_year." ".$nbofyear); + // Security check $socid = GETPOST('socid','int'); if ($user->societe_id > 0) $socid = $user->societe_id; if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport'); - -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') -$modecompta=(GETPOST("modecompta")?GETPOST("modecompta"):$conf->global->ACCOUNTING_MODE); +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING'; +if (GETPOST("modecompta",'alpha')) $modecompta=GETPOST("modecompta",'alpha'); /* @@ -111,8 +122,9 @@ if ($modecompta == 'CREANCES-DETTES') $name=$langs->trans("AnnualSummaryDueDebtMode"); $calcmode=$langs->trans("CalcModeDebt"); $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $periodlink=($year_start?"".img_previous()."".img_next()."":""); + $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); $description.='
        '.$langs->trans("RulesResultDue"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.="
        ".$langs->trans("DepositsAreNotIncluded"); @@ -120,17 +132,30 @@ if ($modecompta == 'CREANCES-DETTES') $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } -else { +else if ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("AnnualSummaryInputOutputMode"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $periodlink=($year_start?"".img_previous()."".img_next()."":""); + $periodlink=($year_start?"".img_previous()."".img_next()."":""); $description=$langs->trans("RulesAmountWithTaxIncluded"); $description.='
        '.$langs->trans("RulesResultInOut"); $builddate=time(); //$exportlink=$langs->trans("NotYetAvailable"); } +else if ($modecompta=="BOOKKEEPING") +{ + $name=$langs->trans("AnnualSummaryDueDebtMode"); + $calcmode=$langs->trans("CalcModeBookkeeping"); + $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); + $periodlink=($year_start?"".img_previous()."".img_next()."":""); + $description=$langs->trans("RulesAmountOnInOutBookkeepingRecord", $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("AccountingCategory")); + $builddate=time(); + //$exportlink=$langs->trans("NotYetAvailable"); +} $hselected='report'; @@ -149,91 +174,116 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; -} -else -{ - /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) - */ - $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " WHERE p.rowid = pf.fk_paiement"; - $sql.= " AND pf.fk_facture = f.rowid"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = $socid"; -$sql.= " GROUP BY dm"; -$sql.= " ORDER BY dm"; - -//print $sql; -dol_syslog("get customers invoices", LOG_DEBUG); -$result=$db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) + if ($modecompta == 'CREANCES-DETTES') { - $row = $db->fetch_object($result); - $encaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); - $encaiss_ttc[$row->dm] = $row->amount_ttc; - $i++; + $sql = "SELECT sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; + else $sql.= " AND f.type IN (0,1,2,3,5)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + /* + * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les + * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + */ + $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " WHERE p.rowid = pf.fk_paiement"; + $sql.= " AND pf.fk_facture = f.rowid"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } - $db->free($result); -} -else { - dol_print_error($db); -} -// On ajoute les paiements clients anciennes version, non lies par paiement_facture -if ($modecompta != 'CREANCES-DETTES') -{ - $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; - $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; - $sql.= " WHERE pf.rowid IS NULL"; - $sql.= " AND p.fk_bank = b.rowid"; - $sql.= " AND b.fk_account = ba.rowid"; - $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = $socid"; $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get old customers payments not linked to invoices", LOG_DEBUG); - $result = $db->query($sql); - if ($result) { + //print $sql; + dol_syslog("get customers invoices", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { $num = $db->num_rows($result); $i = 0; while ($i < $num) { $row = $db->fetch_object($result); - - if (! isset($encaiss[$row->dm])) $encaiss[$row->dm]=0; - $encaiss[$row->dm] += (isset($row->amount_ht)?$row->amount_ht:0); - - if (! isset($encaiss_ttc[$row->dm])) $encaiss_ttc[$row->dm]=0; - $encaiss_ttc[$row->dm] += $row->amount_ttc; - + $encaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); + $encaiss_ttc[$row->dm] = $row->amount_ttc; $i++; } + $db->free($result); } else { dol_print_error($db); } } +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} + +if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) +{ + // On ajoute les paiements clients anciennes version, non lies par paiement_facture + if ($modecompta != 'CREANCES-DETTES') + { + $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; + $sql.= ", ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; + $sql.= " WHERE pf.rowid IS NULL"; + $sql.= " AND p.fk_bank = b.rowid"; + $sql.= " AND b.fk_account = ba.rowid"; + $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; + $sql.= " ORDER BY dm"; + + dol_syslog("get old customers payments not linked to invoices", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_object($result); + + if (! isset($encaiss[$row->dm])) $encaiss[$row->dm]=0; + $encaiss[$row->dm] += (isset($row->amount_ht)?$row->amount_ht:0); + + if (! isset($encaiss_ttc[$row->dm])) $encaiss_ttc[$row->dm]=0; + $encaiss_ttc[$row->dm] += $row->amount_ttc; + + $i++; + } + } + else { + dol_print_error($db); + } + } + else if ($modecompta=="RECETTES-DEPENSES") + { + // Nothing from this table + } +} +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} /* @@ -242,231 +292,275 @@ if ($modecompta != 'CREANCES-DETTES') $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; -} -else -{ - $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; - $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; - $sql.= " WHERE f.rowid = pf.fk_facturefourn"; - $sql.= " AND p.rowid = pf.fk_paiementfourn"; -} -$sql.= " AND f.entity = ".$conf->entity; -if ($socid) $sql.= " AND f.fk_soc = ".$socid; -$sql.= " GROUP BY dm"; - -dol_syslog("get suppliers invoices", LOG_DEBUG); -$result=$db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) + if ($modecompta == 'CREANCES-DETTES') { - $row = $db->fetch_object($result); - - if (! isset($decaiss[$row->dm])) $decaiss[$row->dm]=0; - $decaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); - - if (! isset($decaiss_ttc[$row->dm])) $decaiss_ttc[$row->dm]=0; - $decaiss_ttc[$row->dm] = $row->amount_ttc; - - $i++; + $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; + $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= ", ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; + $sql.= " WHERE f.rowid = pf.fk_facturefourn"; + $sql.= " AND p.rowid = pf.fk_paiementfourn"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND f.entity = ".$conf->entity; + if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql.= " GROUP BY dm"; + + dol_syslog("get suppliers invoices", LOG_DEBUG); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_object($result); + + if (! isset($decaiss[$row->dm])) $decaiss[$row->dm]=0; + $decaiss[$row->dm] = (isset($row->amount_ht)?$row->amount_ht:0); + + if (! isset($decaiss_ttc[$row->dm])) $decaiss_ttc[$row->dm]=0; + $decaiss_ttc[$row->dm] = $row->amount_ttc; + + $i++; + } + $db->free($result); + } + else { + dol_print_error($db); } - $db->free($result); } -else { - dol_print_error($db); +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table } + /* * TVA */ + $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - // TVA a payer - $sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; - else $sql.= " AND f.type IN (0,1,2,3,5)"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; + if ($modecompta == 'CREANCES-DETTES') + { + // TVA a payer + $sql = "SELECT sum(f.tva) as amount, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; + else $sql.= " AND f.type IN (0,1,2,3,5)"; + $sql.= " AND f.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; - dol_syslog("get vat to pay", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); + dol_syslog("get vat to pay", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; - $i++; + $i++; + } } + } else { + dol_print_error($db); + } + // TVA a recuperer + $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " WHERE f.fk_statut IN (1,2)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; + else $sql.= " AND f.type IN (0,1,2,3)"; + $sql.= " AND f.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; + + dol_syslog("get vat to receive back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->amount; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } - } else { - dol_print_error($db); } - // TVA a recuperer - $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql.= " WHERE f.fk_statut IN (1,2)"; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)"; - else $sql.= " AND f.type IN (0,1,2,3)"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; + else if ($modecompta=="RECETTES-DEPENSES") + { + // TVA reellement deja payee + $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount > 0"; + $sql.= " AND t.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; - dol_syslog("get vat to receive back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); + dol_syslog("get vat really paid", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; - $encaiss[$obj->dm] += $obj->amount; + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; - if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] += $obj->amount; + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; - $i++; + $i++; + } } + } else { + dol_print_error($db); + } + // TVA recuperee + $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; + $sql.= " WHERE amount < 0"; + $sql.= " AND t.entity = ".$conf->entity; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY dm"; + + dol_syslog("get vat really received back", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->amount; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } - } else { - dol_print_error($db); } } -else { - // TVA reellement deja payee - $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount > 0"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - - dol_syslog("get vat really paid", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } - // TVA recuperee - $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; - $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; - $sql.= " WHERE amount < 0"; - $sql.= " AND t.entity = ".$conf->entity; - $sql.= " GROUP BY dm"; - - dol_syslog("get vat really received back", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; - $encaiss[$obj->dm] += $obj->amount; - - if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table } /* * Charges sociales non deductibles */ + $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; -} -else -{ - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; -} -$sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle, dm"; - -dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); -$result=$db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 0"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " GROUP BY c.libelle, dm"; + + dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; + + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } -} else { - dol_print_error($db); } +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} + /* * Charges sociales deductibles @@ -474,108 +568,120 @@ if ($result) { $subtotal_ht = 0; $subtotal_ttc = 0; -if ($modecompta == 'CREANCES-DETTES') +if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; -} -else -{ - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; -} -$sql.= " AND cs.entity = ".$conf->entity; -$sql.= " GROUP BY c.libelle, dm"; - -dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); -$result=$db->query($sql); -if ($result) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } + if ($modecompta == 'CREANCES-DETTES') + { + $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= " WHERE cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; + } + else if ($modecompta=="RECETTES-DEPENSES") + { + $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; + $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= " WHERE p.fk_charge = cs.rowid"; + $sql.= " AND cs.fk_type = c.id"; + $sql.= " AND c.deductible = 1"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; + } + + $sql.= " AND cs.entity = ".$conf->entity; + $sql.= " GROUP BY c.libelle, dm"; + + dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); + $result=$db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); + + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; + + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } else { + dol_print_error($db); } -} else { - dol_print_error($db); } -$action = "balance"; -$object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc); -$parameters["mode"] = $modecompta; -// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('externalbalance')); -$reshook=$hookmanager->executeHooks('addReportInfo',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +else if ($modecompta=="BOOKKEEPING") +{ + // Nothing from this table +} /* * Salaries */ -if (! empty($conf->salaries->enabled)) +if (! empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { - if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; - } else { - $column = 'p.datep'; - } + if ($modecompta == 'CREANCES-DETTES') $column = 'p.datev'; + if ($modecompta == "RECETTES-DEPENSES") $column = 'p.datep'; - $subtotal_ht = 0; - $subtotal_ttc = 0; - $sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; - $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " GROUP BY p.label, dm"; + $subtotal_ht = 0; + $subtotal_ttc = 0; + $sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql .= " FROM " . MAIN_DB_PREFIX . "payment_salary as p"; + $sql .= " WHERE p.entity = " . $conf->entity; + $sql .= " GROUP BY p.label, dm"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; - dol_syslog("get social salaries payments"); - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); + dol_syslog("get social salaries payments"); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $var = false; + $i = 0; + if ($num) { + while ($i < $num) { + $obj = $db->fetch_object($result); - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; + if (! isset($decaiss[$obj->dm])) + $decaiss[$obj->dm] = 0; + $decaiss[$obj->dm] += $obj->amount; - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; + if (! isset($decaiss_ttc[$obj->dm])) + $decaiss_ttc[$obj->dm] = 0; + $decaiss_ttc[$obj->dm] += $obj->amount; - $i++; - } - } - } - else - { - dol_print_error($db); - } + $i ++; + } + } + } else { + dol_print_error($db); + } +} +elseif ($modecompta == "BOOKKEEPING") +{ + // Nothing from this table } -if (! empty($conf->expensereport->enabled)) + +/* + * Expense reports + */ + +if (! empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { $langs->load('trips'); + if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; @@ -584,8 +690,10 @@ if (! empty($conf->expensereport->enabled)) $sql.= " AND p.fk_statut>=5"; $column='p.date_valid'; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; - } else { + } elseif ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; @@ -595,6 +703,8 @@ if (! empty($conf->expensereport->enabled)) $sql.= " AND p.fk_statut>=5"; $column='pe.datep'; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; } $sql.= " GROUP BY dm"; @@ -623,12 +733,18 @@ if (! empty($conf->expensereport->enabled)) { dol_print_error($db); } + } +elseif ($modecompta == 'BOOKKEEPING') { + // Nothing from this table +} + /* * Donation get dunning paiement */ -if (! empty($conf->don->enabled)) + +if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) { $subtotal_ht = 0; $subtotal_ttc = 0; @@ -638,15 +754,20 @@ if (! empty($conf->don->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " AND fk_statut in (1,2)"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; } - else { - $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + elseif ($modecompta == 'RECETTES-DEPENSES') { + $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('donation'); $sql.= " AND fk_statut >= 2"; - } + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($date_end)."'"; + } + $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; dol_syslog("get donation payments"); @@ -677,6 +798,72 @@ if (! empty($conf->don->enabled)) dol_print_error($db); } } +elseif ($modecompta == 'BOOKKEEPING') { + // Nothing from this table +} + + + +/* + * Donation get dunning paiement + */ + +if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) +{ + $subtotal_ht = 0; + $subtotal_ttc = 0; + + $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; + $sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity; + //$sql.= " AND fk_statut in (1,2)"; + $sql.= " AND pcg_type in ('INCOME', 'EXPENSE')"; + //$sql.= " AND code_journal in ('VT', 'AC')"; + if (! empty($date_start) && ! empty($date_end)) + $sql.= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'"; + $sql.= " GROUP BY b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, dm"; + + //print $sql; + + dol_syslog("get donation payments"); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->debit; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->credit; + + $i++; + } + } + } + else + { + dol_print_error($db); + } +} + + + +$action = "balance"; +$object = array(&$encaiss, &$encaiss_ttc, &$decaiss, &$decaiss_ttc); +$parameters["mode"] = $modecompta; +// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('externalbalance')); +$reshook=$hookmanager->executeHooks('addReportInfo',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + /* * Show result array diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 8bb5c99b1db..aa714cf042f 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -29,11 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; -$error = 0; +$langs->loadLangs(array('compta','bills','donation','salaries')); -// Langs -$langs->load("accountancy"); -$langs->load("compta"); +$error = 0; $mesg = ''; $action = GETPOST('action','aZ09'); @@ -98,6 +96,24 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); } } +if (($date_start < dol_time_plus_duree($date_end, -1, 'y')) || ($date_start > $date_end)) +{ + $date_end = dol_time_plus_duree($date_start - 1, 1, 'y'); +} + +// $date_start and $date_end are defined. We force $start_year and $nbofyear +$tmps=dol_getdate($date_start); +$start_year = $tmps['year']; +$tmpe=dol_getdate($date_end); +$year_end = $tmpe['year']; +$nbofyear = ($year_end - $start_year) + 1; + +$date_start_previous = dol_time_plus_duree($date_start, -1, 'y'); +$date_end_previous = dol_time_plus_duree($date_end, -1, 'y'); + +//var_dump($date_start." ".$date_end." ".$date_start_previous." ".$date_end_previous." ".$nbofyear); + + if($cat_id == 0){ $cat_id = null; } @@ -125,8 +141,8 @@ llxheader('', $langs->trans('ReportInOut')); $formaccounting = new FormAccounting($db); $form = new Form($db); -$textprevyear = '' . img_previous() . ''; -$textnextyear = ' ' . img_next() . ''; +$textprevyear = '' . img_previous() . ''; +$textnextyear = ' ' . img_next() . ''; @@ -135,8 +151,8 @@ if ($modecompta=="CREANCES-DETTES") { $name=$langs->trans("AnnualByAccountDueDebtMode"); $calcmode=$langs->trans("CalcModeDebt"); - $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().''.img_next().''; $description=$langs->trans("RulesResultDue"); @@ -149,7 +165,7 @@ else if ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("AnnualByAccountInputOutputMode"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; + $calcmode.='
        ('.$langs->trans("SeeReportInBookkeepingMode",'','').')'; //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); //$periodlink=''.img_previous().''.img_next().''; @@ -159,18 +175,18 @@ else if ($modecompta=="RECETTES-DEPENSES") { } else if ($modecompta=="BOOKKEEPING") { - $name = $langs->trans("ReportInOut").', '.$langs->trans("ByAccounts"); + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups"); $calcmode=$langs->trans("CalcModeBookkeeping"); - $calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; + //$calcmode.='
        ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; + //$calcmode.='
        ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $nomlink = ''; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); - $period.='   '.$langs->trans("Detail").' '. $form->selectyesno('simple_report',$simple_report,0); - $periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear ; + $period.='     '.$langs->trans("DetailByAccount").' '. $form->selectyesno('simple_report',$simple_report,0); + $periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $start_year . " " . $textnextyear ; $exportlink = ''; - $description=$langs->trans("RulesResultDue"); - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); - else $description.= $langs->trans("DepositsAreIncluded"); + $description=$langs->trans("RulesResultBookkeepingPersonalized", $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("AccountingCategory")); + //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + //else $description.= $langs->trans("DepositsAreIncluded"); $builddate = time(); } @@ -203,190 +219,239 @@ $months = array( $langs->trans("JanuaryMin"), ); print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; foreach($months as $k => $v){ - print ''; + print ''; } print ''; +if ($modecompta == 'CREANCES-DETTES') +{ + //if (! empty($date_start) && ! empty($date_end)) + // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; +} +else if ($modecompta=="RECETTES-DEPENSES") +{ + //if (! empty($date_start) && ! empty($date_end)) + // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; +} +else if ($modecompta=="BOOKKEEPING") +{ + // TODO + //if (! empty($date_start) && ! empty($date_end)) + // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; + //All categories + $cats = $AccCat->getCats(); + if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors); -//All categories -$cats = $AccCat->getCats(); -if ($catsCalcule < 0) dol_print_error($db, $AccCat->error, $AccCat->errors); + $j=1; + $sommes = array(); -$j=1; -$sommes = array(); + foreach ($cats as $cat) // Loop on each group + { + if (!empty($cat['category_type'])) // category calculed + { + $formula = $cat['formula']; -foreach($cats as $cat ){ - if(!empty($cat['category_type'])){ // category calculed + print ""; + //print ''; + print ''; - $formula = $cat['formula']; + $vars = array(); - print ""; - print ''; - - $vars = array(); - - // Previous Fiscal year (N-1) - foreach($sommes as $code => $det){ - $vars[$code] = $det['NP']; - } - - - $result = strtr($formula, $vars); - - - $r = $AccCat->calculate($result); - - print ''; - $code = $cat['code']; // code categorie de calcule - $sommes[$code]['NP'] += $r; - - // Current fiscal year (N) - if (is_array($sommes) && ! empty($sommes)){ + // Previous Fiscal year (N-1) foreach($sommes as $code => $det){ - $vars[$code] = $det['N']; + $vars[$code] = $det['NP']; } - } - $result = strtr($formula, $vars); - $r = $AccCat->calculate($result); - - print ''; - $sommes[$code]['N'] += $r; - - // Detail by month - foreach($months as $k => $v){ - foreach($sommes as $code => $det){ - $vars[$code] = $det['M'][$k]; - } $result = strtr($formula, $vars); + + $r = $AccCat->calculate($result); - print ''; - $sommes[$code]['M'][$k] += $r; - } + print ''; + $code = $cat['code']; // code categorie de calcule + $sommes[$code]['NP'] += $r; - print "\n"; - - - }else{ // normal category - - $totCat = array(); - $totCat['M'] = array(); - - // get cpts of category - $cpts = $AccCat->getCptsCat($cat['rowid']); - - - print ""; - print ''; - - foreach($cpts as $i => $cpt){ - $var = ! $var; - - $code = $cat['code']; - - // N-1 - $return = $AccCat->getResult($cpt['account_number'], 0, $year_current -1, $cpt['dc']); - - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultNP=0; - } else { - $resultNP=$AccCat->sdc; + // Current fiscal year (N) + if (is_array($sommes) && ! empty($sommes)){ + foreach($sommes as $code => $det){ + $vars[$code] = $det['N']; + } } - //N - $return = $AccCat->getResult($cpt['account_number'], 0, $year_current, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultN=0; - } else { - $resultN=$AccCat->sdc; - } + $result = strtr($formula, $vars); - $totCat['NP'] += $resultNP; - $totCat['N'] += $resultN; + $r = $AccCat->calculate($result); + print ''; + $sommes[$code]['N'] += $r; + + // Detail by month foreach($months as $k => $v){ - $return = $AccCat->getResult($cpt['account_number'], $k+1, $year_current, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultM=0; - } else { - $resultM=$AccCat->sdc; + foreach($sommes as $code => $det){ + $vars[$code] = $det['M'][$k]; } - $totCat['M'][$k] += $resultM; - - } - } - - print ''; - print ''; - - foreach($totCat['M'] as $k => $v){ - print ''; - } - print "\n"; - - foreach($cpts as $i => $cpt){ - $var = ! $var; - - $code = $cat['code']; - - // N-1 - $return = $AccCat->getResult($cpt['account_number'], 0, $year_current -1, $cpt['dc']); - - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultNP=0; - } else { - $resultNP=$AccCat->sdc; + $result = strtr($formula, $vars); + $r = $AccCat->calculate($result); + print ''; + $sommes[$code]['M'][$k] += $r; } - //N - $return = $AccCat->getResult($cpt['account_number'], 0, $year_current, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultN=0; - } else { - $resultN=$AccCat->sdc; - } - - $sommes[$code]['NP'] += $resultNP; - $sommes[$code]['N'] += $resultN; - print ''; - if ($simple_report == 'yes') { - print ''; - print ''; - print ''; - print ''; - } - - foreach($months as $k => $v){ - $return = $AccCat->getResult($cpt['account_number'], $k+1, $year_current, $cpt['dc']); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultM=0; - } else { - $resultM=$AccCat->sdc; - } - $sommes[$code]['M'][$k] += $resultM; - if ($simple_report == 'yes') { - print ''; - } - } print "\n"; + + + } + else // normal category + { + $totCat = array(); + $totCat['NP'] = 0; + $totCat['N'] = 0; + $totCat['M'] = array(); + foreach($months as $k => $v) + { + $totCat['M'][$k] = 0; + } + + // Get cpts of category/group + $cpts = $AccCat->getCptsCat($cat['rowid']); + + print ""; + + // Column group + print ''; + + $code = $cat['code']; + + // Column N Previous and N + foreach($cpts as $i => $cpt) + { + // N-1 + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start_previous, $date_end_previous, $cpt['dc']); + + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultNP=0; + } else { + $resultNP=$AccCat->sdc; + } + + //N + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultN=0; + } else { + $resultN=$AccCat->sdc; + } + + $totCat['NP'] += $resultNP; + $totCat['N'] += $resultN; + + foreach($months as $k => $v) + { + $return = $AccCat->getResult($cpt['account_number'], $k+1, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultM=0; + } else { + $resultM=$AccCat->sdc; + } + $totCat['M'][$k] += $resultM; + } + } + + print ''; + print ''; + + foreach($totCat['M'] as $k => $v){ + print ''; + } + print "\n"; + + // + foreach($cpts as $i => $cpt) + { + // N-1 + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start_previous, $date_end_previous, $cpt['dc']); + + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultNP=0; + } else { + $resultNP=$AccCat->sdc; + } + + //N + $return = $AccCat->getResult($cpt['account_number'], 0, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultN=0; + } else { + $resultN=$AccCat->sdc; + } + + $sommes[$code]['NP'] += $resultNP; + $sommes[$code]['N'] += $resultN; + + if ($simple_report == 'yes') { + print ''; + print ''; + print ''; + print ''; + print ''; + } + + foreach($months as $k => $v) + { + $return = $AccCat->getResult($cpt['account_number'], $k+1, $date_start, $date_end, $cpt['dc']); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultM=0; + } else { + $resultM=$AccCat->sdc; + } + $sommes[$code]['M'][$k] += $resultM; + if ($simple_report == 'yes') { + print ''; + } + } + + if ($simple_report == 'yes') { + print "\n"; + } + } } } - } print "
        '.$langs->trans("CustomersInvoices").'
         ".$langs->trans("Bills").' '.$objp->name."".price($objp->amount_ht)."".price($objp->amount_ttc)."
         ".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; - - if ($modecompta == 'CREANCES-DETTES') - print "".price($objp->amount_ht)."".price($objp->amount_ttc)."
         '.$langs->trans("None").'
        '.price($total_ht).''.price($total_ttc).'
        '.$langs->trans("SuppliersInvoices").'
         ".$langs->trans("Bills")." socid."\">".$objp->name."".price(-$objp->amount_ht)."".price(-$objp->amount_ttc)."
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
        '.$langs->trans("SocialContributionsNondeductibles").'
         '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
        '.$langs->trans("SocialContributionsDeductibles").'
         '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
         
        '.$langs->trans("Profit").''.price($total_ht).''.price($total_ttc).'
         
        '.$langs->trans("Salaries").'
        '.$objp->pcg_type.'
         '.$objp->pcg_type.($objp->pcg_subtype != 'XXXXXX'?' - '.$objp->pcg_subtype:'').($objp->name?' ('.$objp->name.')':'')."'.price($objp->amount)."
        '.$langs->trans("NoRecordFound").'
        '.$langs->trans("CustomersInvoices").'
         ".$langs->trans("Bills").' '.$objp->name."".price($objp->amount_ht)."".price($objp->amount_ttc)."
         ".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; + + if ($modecompta == 'CREANCES-DETTES') + print "".price($objp->amount_ht)."".price($objp->amount_ttc)."
         '.$langs->trans("None").'
        '.price($total_ht).''.price($total_ttc).'
        '.$langs->trans("SuppliersInvoices").'
         ".$langs->trans("Bills")." socid."\">".$objp->name."".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."".price(-$objp->amount_ht)."".price(-$objp->amount_ttc)."'.price(-$obj->amount).''.price(-$obj->amount).'
        '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
        '.$langs->trans("SocialContributionsNondeductibles").'
        '.$langs->trans("ExpenseReport").'
         ".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount_ht).''.price(-$obj->amount_ttc).'
         '.$langs->trans("None").'
         '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
        '.price(-$subtotal_ttc).'
        '.$langs->trans("Donations").'
        '.$langs->trans("SocialContributionsDeductibles").'
         '.$obj->label.''.price(-$obj->amount).''.price(-$obj->amount).'
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
         
        '.$langs->trans("Profit").''.price($total_ht).''.price($total_ttc).'
         
        '.$langs->trans("Salaries").'
         ".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount).''.price(-$obj->amount).'
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
        '.$langs->trans("ExpenseReport").'
         ".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname."'.price(-$obj->amount_ht).''.price(-$obj->amount_ttc).'
         ".$langs->trans("Donation")." name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."'.price($obj->amount).''.price($obj->amount).''.$langs->trans("None").'
         '.$langs->trans("None").'
        '.price(-$subtotal_ht).''.price(-$subtotal_ttc).'
        '.$langs->trans("Donations").'
         ".$langs->trans("Donation")." name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."'.price($obj->amount).''.price($obj->amount).'
         '.$langs->trans("None").'
        '.price($subtotal_ht).''.price($subtotal_ttc).'
        '.$langs->trans("VAT").'
         ".$langs->trans("VATToPay")." ".price($amount)."
         ".$langs->trans("VATToCollect")." ".price($amount)."
         ".$langs->trans("VATPaid")."".price($amount)."".price($amount)."
         ".$langs->trans("VATCollected")."".price($amount)."".price($amount)."
         '.price(price2num($subtotal_ttc,'MT')).'
        '.price($subtotal_ht).''.price($subtotal_ttc).'
        '.$langs->trans("VAT").'
         ".$langs->trans("VATToPay")." ".price($amount)."
         ".$langs->trans("VATToCollect")." ".price($amount)."
         ".$langs->trans("VATPaid")."".price($amount)."".price($amount)."
         ".$langs->trans("VATCollected")."".price($amount)."".price($amount)."
         '.price(price2num($subtotal_ttc,'MT')).'
        '.$langs->trans("Account").''.$langs->trans("Description").'N-1'.$langs->trans("NReal").''.$langs->trans("AccountingCategory").''.$langs->trans("PreviousYear").''.$langs->trans("SelectedPeriod").''.$langs->trans($v).''.$langs->trans($v).'
        ' . $cat['label'] . '' . $cat['label'] . '
        ' . $cat['label'] . '' . price($r) . '' . price($r) . '' . price($r) . '' . price($r) . '
        ' . $cat['label'] . '' . price($r) . '' . price($totCat['NP']) . '' . price($totCat['N']) . '' . price($v) . '
        ' . price($r) . '' . length_accountg($cpt['account_number']) . '' . $cpt['name_cpt'] . '' . price($resultNP) . '' . price($resultN) . '' . price($resultM) . '
        '; + print $cat['label']; + if (count($cpts) > 0) + { + $i=0; + foreach($cpts as $cpt) + { + if ($i > 5) + { + print '...)'; + break; + } + if ($i > 0) print ', '; + else print ' ('; + print $cpt['account_number']; + $i++; + } + if ($i <= 5) print ')'; + } + else + { + print ' - '.$langs->trans("GroupIsEmptyCheckSetup").''; + } + print '' . price($totCat['NP']) . '' . price($totCat['N']) . '' . price($v) . '
            ' . length_accountg($cpt['account_number']) . '' . $cpt['name_cpt'] . '' . price($resultNP) . '' . price($resultN) . '' . price($resultM) . '
        "; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 12826002279..70293076fd8 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -186,6 +186,9 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') } + +$name=array(); + // SQL request $catotal=0; $catotal_ht=0; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 07c35b60c50..37d9119685b 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -167,6 +167,8 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') } +$name=array(); + // Show array print '
        '; // Extra parameters management diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index f4beaf0b157..191a6f48284 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -195,6 +195,8 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') } +$name=array(); + // Show Array $catotal=0; if ($modecompta == 'CREANCES-DETTES') { diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index e3f0e36186a..a6e8064f1a9 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -27,6 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +$langs->loadLangs(array('compta','bills','donation','salaries')); $date_startmonth=GETPOST('date_startmonth'); $date_startday=GETPOST('date_startday'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 419c8ec18de..d9be404d13d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3284,32 +3284,34 @@ function dol_print_error_email($prefixcode, $errormessage='') * @param string $sortfield Current field used to sort * @param string $sortorder Current sort order * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. + * @param string $tooltip Tooltip * @return void */ -function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="") +function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="", $tooltip="") { - print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix); + print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix, 0, $tooltip); } /** * Get title line of an array * - * @param string $name Translation key of field - * @param int $thead 0=To use with standard table format, 1=To use inside , 2=To use with
        - * @param string $file Url used when we click on sort picto - * @param string $field Field to use for new sorting. Empty if this field is not sortable. - * @param string $begin ("" by defaut) - * @param string $moreparam Add more parameters on sort url links ("" by default) - * @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix. - * @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id') - * @param string $sortorder Current sort order (Ex: 'asc,desc') - * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. + * @param string $name Translation key of field + * @param int $thead 0=To use with standard table format, 1=To use inside , 2=To use with
        + * @param string $file Url used when we click on sort picto + * @param string $field Field to use for new sorting. Empty if this field is not sortable. + * @param string $begin ("" by defaut) + * @param string $moreparam Add more parameters on sort url links ("" by default) + * @param string $moreattrib Add more attributes on th ("" by defaut). To add more css class, use param $prefix. + * @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id') + * @param string $sortorder Current sort order (Ex: 'asc,desc') + * @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag. * @param string $disablesortlink 1=Disable sort link + * @param string $tooltip Tooltip * @return string */ -function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0) +function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='') { - global $conf, $langs; + global $conf, $langs, $form; //print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder
        \n"; $sortorder=strtoupper($sortorder); @@ -3350,7 +3352,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m } } - $out.=$langs->trans($name); + if ($tooltip) $out.=$form->textwithpicto($langs->trans($name), $langs->trans($tooltip)); + else $out.=$langs->trans($name); if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 26215ab99ad..9f72a88599c 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -249,10 +249,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Balance insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); -- Reports - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByAccounts', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b9182542c18..a37339daa1e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1118,11 +1118,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Reports $langs->load("compta"); - $newmenu->add("/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); + $newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByAccounts"),3,$user->rights->accounting->comptarapport->lire); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql index 6448646bda0..84907d92908 100644 --- a/htdocs/install/mysql/data/llx_accounting.sql +++ b/htdocs/install/mysql/data/llx_accounting.sql @@ -103,51 +103,51 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 62,'PCG99-ABREGE','FINAN', 'XXXXXX', '54', '1405', 'Régies d''avance et accréditifs', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 63,'PCG99-ABREGE','FINAN', 'XXXXXX', '58', '1405', 'Virements internes', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 64,'PCG99-ABREGE','FINAN', 'XXXXXX', '590', '1405', 'Provisions pour dépréciation des valeurs mobilières de placement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 65,'PCG99-ABREGE','CHARGE','PRODUCT', '60', '1406', 'Achats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 66,'PCG99-ABREGE','CHARGE','XXXXXX', '603', '65', 'Variations des stocks', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 67,'PCG99-ABREGE','CHARGE','SERVICE', '61', '1406', 'Services extérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 68,'PCG99-ABREGE','CHARGE','XXXXXX', '62', '1406', 'Autres services extérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 69,'PCG99-ABREGE','CHARGE','XXXXXX', '63', '1406', 'Impôts, taxes et versements assimiles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 70,'PCG99-ABREGE','CHARGE','XXXXXX', '641', '1406', 'Rémunérations du personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 71,'PCG99-ABREGE','CHARGE','XXXXXX', '644', '1406', 'Rémunération du travail de l''exploitant', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 72,'PCG99-ABREGE','CHARGE','SOCIAL', '645', '1406', 'Charges de sécurité sociale et de prévoyance', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 73,'PCG99-ABREGE','CHARGE','XXXXXX', '646', '1406', 'Cotisations sociales personnelles de l''exploitant', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 74,'PCG99-ABREGE','CHARGE','XXXXXX', '65', '1406', 'Autres charges de gestion courante', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 75,'PCG99-ABREGE','CHARGE','XXXXXX', '66', '1406', 'Charges financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 76,'PCG99-ABREGE','CHARGE','XXXXXX', '67', '1406', 'Charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 77,'PCG99-ABREGE','CHARGE','XXXXXX', '681', '1406', 'Dotations aux amortissements et aux provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 78,'PCG99-ABREGE','CHARGE','XXXXXX', '686', '1406', 'Dotations aux amortissements et aux provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 79,'PCG99-ABREGE','CHARGE','XXXXXX', '687', '1406', 'Dotations aux amortissements et aux provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 80,'PCG99-ABREGE','CHARGE','XXXXXX', '691', '1406', 'Participation des salariés aux résultats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 81,'PCG99-ABREGE','CHARGE','XXXXXX', '695', '1406', 'Impôts sur les bénéfices', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 82,'PCG99-ABREGE','CHARGE','XXXXXX', '697', '1406', 'Imposition forfaitaire annuelle des sociétés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 83,'PCG99-ABREGE','CHARGE','XXXXXX', '699', '1406', 'Produits', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 84,'PCG99-ABREGE','PROD', 'PRODUCT', '701', '1407', 'Ventes de produits finis', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 85,'PCG99-ABREGE','PROD', 'SERVICE', '706', '1407', 'Prestations de services', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 86,'PCG99-ABREGE','PROD', 'PRODUCT', '707', '1407', 'Ventes de marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 87,'PCG99-ABREGE','PROD', 'PRODUCT', '708', '1407', 'Produits des activités annexes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 88,'PCG99-ABREGE','PROD', 'XXXXXX', '709', '1407', 'Rabais, remises et ristournes accordés par l''entreprise', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 89,'PCG99-ABREGE','PROD', 'XXXXXX', '713', '1407', 'Variation des stocks', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 90,'PCG99-ABREGE','PROD', 'XXXXXX', '72', '1407', 'Production immobilisée', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 91,'PCG99-ABREGE','PROD', 'XXXXXX', '73', '1407', 'Produits nets partiels sur opérations à long terme', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 92,'PCG99-ABREGE','PROD', 'XXXXXX', '74', '1407', 'Subventions d''exploitation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 93,'PCG99-ABREGE','PROD', 'XXXXXX', '75', '1407', 'Autres produits de gestion courante', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 94,'PCG99-ABREGE','PROD', 'XXXXXX', '753', '93', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 95,'PCG99-ABREGE','PROD', 'XXXXXX', '754', '93', 'Ristournes perçues des coopératives', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 96,'PCG99-ABREGE','PROD', 'XXXXXX', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 97,'PCG99-ABREGE','PROD', 'XXXXXX', '76', '1407', 'Produits financiers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 98,'PCG99-ABREGE','PROD', 'XXXXXX', '77', '1407', 'Produits exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 99,'PCG99-ABREGE','PROD', 'XXXXXX', '781', '1407', 'Reprises sur amortissements et provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (100,'PCG99-ABREGE','PROD', 'XXXXXX', '786', '1407', 'Reprises sur provisions pour risques', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (101,'PCG99-ABREGE','PROD', 'XXXXXX', '787', '1407', 'Reprises sur provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (102,'PCG99-ABREGE','PROD', 'XXXXXX', '79', '1407', 'Transferts de charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 65,'PCG99-ABREGE','EXPENSE','PRODUCT', '60', '1406', 'Achats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 66,'PCG99-ABREGE','EXPENSE','XXXXXX', '603', '65', 'Variations des stocks', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 67,'PCG99-ABREGE','EXPENSE','SERVICE', '61', '1406', 'Services extérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 68,'PCG99-ABREGE','EXPENSE','XXXXXX', '62', '1406', 'Autres services extérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 69,'PCG99-ABREGE','EXPENSE','XXXXXX', '63', '1406', 'Impôts, taxes et versements assimiles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 70,'PCG99-ABREGE','EXPENSE','XXXXXX', '641', '1406', 'Rémunérations du personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 71,'PCG99-ABREGE','EXPENSE','XXXXXX', '644', '1406', 'Rémunération du travail de l''exploitant', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 72,'PCG99-ABREGE','EXPENSE','SOCIAL', '645', '1406', 'Charges de sécurité sociale et de prévoyance', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 73,'PCG99-ABREGE','EXPENSE','XXXXXX', '646', '1406', 'Cotisations sociales personnelles de l''exploitant', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 74,'PCG99-ABREGE','EXPENSE','XXXXXX', '65', '1406', 'Autres charges de gestion courante', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 75,'PCG99-ABREGE','EXPENSE','XXXXXX', '66', '1406', 'Charges financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 76,'PCG99-ABREGE','EXPENSE','XXXXXX', '67', '1406', 'Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 77,'PCG99-ABREGE','EXPENSE','XXXXXX', '681', '1406', 'Dotations aux amortissements et aux provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 78,'PCG99-ABREGE','EXPENSE','XXXXXX', '686', '1406', 'Dotations aux amortissements et aux provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 79,'PCG99-ABREGE','EXPENSE','XXXXXX', '687', '1406', 'Dotations aux amortissements et aux provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 80,'PCG99-ABREGE','EXPENSE','XXXXXX', '691', '1406', 'Participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 81,'PCG99-ABREGE','EXPENSE','XXXXXX', '695', '1406', 'Impôts sur les bénéfices', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 82,'PCG99-ABREGE','EXPENSE','XXXXXX', '697', '1406', 'Imposition forfaitaire annuelle des sociétés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 83,'PCG99-ABREGE','EXPENSE','XXXXXX', '699', '1406', 'Produits', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 84,'PCG99-ABREGE','INCOME', 'PRODUCT', '701', '1407', 'Ventes de produits finis', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 85,'PCG99-ABREGE','INCOME', 'SERVICE', '706', '1407', 'Prestations de services', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 86,'PCG99-ABREGE','INCOME', 'PRODUCT', '707', '1407', 'Ventes de marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 87,'PCG99-ABREGE','INCOME', 'PRODUCT', '708', '1407', 'Produits des activités annexes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 88,'PCG99-ABREGE','INCOME', 'XXXXXX', '709', '1407', 'Rabais, remises et ristournes accordés par l''entreprise', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 89,'PCG99-ABREGE','INCOME', 'XXXXXX', '713', '1407', 'Variation des stocks', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 90,'PCG99-ABREGE','INCOME', 'XXXXXX', '72', '1407', 'Production immobilisée', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 91,'PCG99-ABREGE','INCOME', 'XXXXXX', '73', '1407', 'Produits nets partiels sur opérations à long terme', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 92,'PCG99-ABREGE','INCOME', 'XXXXXX', '74', '1407', 'Subventions d''exploitation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 93,'PCG99-ABREGE','INCOME', 'XXXXXX', '75', '1407', 'Autres produits de gestion courante', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 94,'PCG99-ABREGE','INCOME', 'XXXXXX', '753', '93', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 95,'PCG99-ABREGE','INCOME', 'XXXXXX', '754', '93', 'Ristournes perçues des coopératives', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 96,'PCG99-ABREGE','INCOME', 'XXXXXX', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 97,'PCG99-ABREGE','INCOME', 'XXXXXX', '76', '1407', 'Produits financiers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 98,'PCG99-ABREGE','INCOME', 'XXXXXX', '77', '1407', 'Produits exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 99,'PCG99-ABREGE','INCOME', 'XXXXXX', '781', '1407', 'Reprises sur amortissements et provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (100,'PCG99-ABREGE','INCOME', 'XXXXXX', '786', '1407', 'Reprises sur provisions pour risques', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (101,'PCG99-ABREGE','INCOME', 'XXXXXX', '787', '1407', 'Reprises sur provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (102,'PCG99-ABREGE','INCOME', 'XXXXXX', '79', '1407', 'Transferts de charges', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1401,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', '0', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1402,'PCG99-ABREGE','IMMO', 'XXXXXX', '2', '0', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1403,'PCG99-ABREGE','STOCK', 'XXXXXX', '3', '0', 'Stock et commandes en cours d''exécution', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1404,'PCG99-ABREGE','TIERS', 'XXXXXX', '4', '0', 'Créances et dettes à un an au plus', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1405,'PCG99-ABREGE','FINAN', 'XXXXXX', '5', '0', 'Placement de trésorerie et de valeurs disponibles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1406,'PCG99-ABREGE','CHARGE','XXXXXX', '6', '0', 'Charges', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1407,'PCG99-ABREGE','PROD', 'XXXXXX', '7', '0', 'Produits', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1406,'PCG99-ABREGE','EXPENSE','XXXXXX', '6', '0', 'Charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1407,'PCG99-ABREGE','INCOME', 'XXXXXX', '7', '0', 'Produits', 1); -- -- Descriptif des plans comptables FR PCG99-BASE @@ -374,130 +374,130 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (319,'PCG99-BASE','FINAN', 'XXXXXX', '58','1505', 'Virements internes', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (320,'PCG99-BASE','FINAN', 'XXXXXX', '59','1505', 'Provisions pour dépréciation des comptes financiers', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (321,'PCG99-BASE','FINAN', 'XXXXXX', '590', '320', 'Provisions pour dépréciation des valeurs mobilières de placement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (322,'PCG99-BASE','CHARGE','PRODUCT', '60','1506', 'Achats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (323,'PCG99-BASE','CHARGE','XXXXXX', '601', '322', 'Achats stockés - Matières premières (et fournitures)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (324,'PCG99-BASE','CHARGE','XXXXXX', '602', '322', 'Achats stockés - Autres approvisionnements', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (325,'PCG99-BASE','CHARGE','XXXXXX', '603', '322', 'Variations des stocks (approvisionnements et marchandises)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','CHARGE','XXXXXX', '604', '322', 'Achats stockés - Matières premières (et fournitures)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (327,'PCG99-BASE','CHARGE','XXXXXX', '605', '322', 'Achats de matériel, équipements et travaux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (328,'PCG99-BASE','CHARGE','XXXXXX', '606', '322', 'Achats non stockés de matière et fournitures', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (329,'PCG99-BASE','CHARGE','XXXXXX', '607', '322', 'Achats de marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (330,'PCG99-BASE','CHARGE','XXXXXX', '608', '322', '(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (331,'PCG99-BASE','CHARGE','XXXXXX', '609', '322', 'Rabais, remises et ristournes obtenus sur achats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (332,'PCG99-BASE','CHARGE','SERVICE', '61','1506', 'Services extérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (333,'PCG99-BASE','CHARGE','XXXXXX', '611', '332', 'Sous-traitance générale', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (334,'PCG99-BASE','CHARGE','XXXXXX', '612', '332', 'Redevances de crédit-bail', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (335,'PCG99-BASE','CHARGE','XXXXXX', '613', '332', 'Locations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (336,'PCG99-BASE','CHARGE','XXXXXX', '614', '332', 'Charges locatives et de copropriété', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (337,'PCG99-BASE','CHARGE','XXXXXX', '615', '332', 'Entretien et réparations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (338,'PCG99-BASE','CHARGE','XXXXXX', '616', '332', 'Primes d''assurances', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (339,'PCG99-BASE','CHARGE','XXXXXX', '617', '332', 'Etudes et recherches', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (340,'PCG99-BASE','CHARGE','XXXXXX', '618', '332', 'Divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (341,'PCG99-BASE','CHARGE','XXXXXX', '619', '332', 'Rabais, remises et ristournes obtenus sur services extérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (342,'PCG99-BASE','CHARGE','XXXXXX', '62','1506', 'Autres services extérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (343,'PCG99-BASE','CHARGE','XXXXXX', '621', '342', 'Personnel extérieur à l''entreprise', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (344,'PCG99-BASE','CHARGE','XXXXXX', '622', '342', 'Rémunérations d''intermédiaires et honoraires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (345,'PCG99-BASE','CHARGE','XXXXXX', '623', '342', 'Publicité, publications, relations publiques', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (346,'PCG99-BASE','CHARGE','XXXXXX', '624', '342', 'Transports de biens et transports collectifs du personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (347,'PCG99-BASE','CHARGE','XXXXXX', '625', '342', 'Déplacements, missions et réceptions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (348,'PCG99-BASE','CHARGE','XXXXXX', '626', '342', 'Frais postaux et de télécommunications', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (349,'PCG99-BASE','CHARGE','XXXXXX', '627', '342', 'Services bancaires et assimilés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (350,'PCG99-BASE','CHARGE','XXXXXX', '628', '342', 'Divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (351,'PCG99-BASE','CHARGE','XXXXXX', '629', '342', 'Rabais, remises et ristournes obtenus sur autres services extérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (352,'PCG99-BASE','CHARGE','XXXXXX', '63','1506', 'Impôts, taxes et versements assimilés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (353,'PCG99-BASE','CHARGE','XXXXXX', '631', '352', 'Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (354,'PCG99-BASE','CHARGE','XXXXXX', '633', '352', 'Impôts, taxes et versements assimilés sur rémunérations (autres organismes)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (355,'PCG99-BASE','CHARGE','XXXXXX', '635', '352', 'Autres impôts, taxes et versements assimilés (administrations des impôts)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (356,'PCG99-BASE','CHARGE','XXXXXX', '637', '352', 'Autres impôts, taxes et versements assimilés (autres organismes)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (357,'PCG99-BASE','CHARGE','XXXXXX', '64','1506', 'Charges de personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (358,'PCG99-BASE','CHARGE','XXXXXX', '641', '357', 'Rémunérations du personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (359,'PCG99-BASE','CHARGE','XXXXXX', '644', '357', 'Rémunération du travail de l''exploitant', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (360,'PCG99-BASE','CHARGE','SOCIAL', '645', '357', 'Charges de sécurité sociale et de prévoyance', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (361,'PCG99-BASE','CHARGE','XXXXXX', '646', '357', 'Cotisations sociales personnelles de l''exploitant', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (362,'PCG99-BASE','CHARGE','XXXXXX', '647', '357', 'Autres charges sociales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (363,'PCG99-BASE','CHARGE','XXXXXX', '648', '357', 'Autres charges de personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (364,'PCG99-BASE','CHARGE','XXXXXX', '65','1506', 'Autres charges de gestion courante', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (365,'PCG99-BASE','CHARGE','XXXXXX', '651', '364', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (366,'PCG99-BASE','CHARGE','XXXXXX', '653', '364', 'Jetons de présence', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (367,'PCG99-BASE','CHARGE','XXXXXX', '654', '364', 'Pertes sur créances irrécouvrables', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (368,'PCG99-BASE','CHARGE','XXXXXX', '655', '364', 'Quote-part de résultat sur opérations faites en commun', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (369,'PCG99-BASE','CHARGE','XXXXXX', '658', '364', 'Charges diverses de gestion courante', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (370,'PCG99-BASE','CHARGE','XXXXXX', '66','1506', 'Charges financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (371,'PCG99-BASE','CHARGE','XXXXXX', '661', '370', 'Charges d''intérêts', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (372,'PCG99-BASE','CHARGE','XXXXXX', '664', '370', 'Pertes sur créances liées à des participations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (373,'PCG99-BASE','CHARGE','XXXXXX', '665', '370', 'Escomptes accordés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (374,'PCG99-BASE','CHARGE','XXXXXX', '666', '370', 'Pertes de change', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (375,'PCG99-BASE','CHARGE','XXXXXX', '667', '370', 'Charges nettes sur cessions de valeurs mobilières de placement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (376,'PCG99-BASE','CHARGE','XXXXXX', '668', '370', 'Autres charges financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (377,'PCG99-BASE','CHARGE','XXXXXX', '67','1506', 'Charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (378,'PCG99-BASE','CHARGE','XXXXXX', '671', '377', 'Charges exceptionnelles sur opérations de gestion', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (379,'PCG99-BASE','CHARGE','XXXXXX', '672', '377', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les charges sur exercices antérieurs)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (380,'PCG99-BASE','CHARGE','XXXXXX', '675', '377', 'Valeurs comptables des éléments d''actif cédés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (381,'PCG99-BASE','CHARGE','XXXXXX', '678', '377', 'Autres charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (382,'PCG99-BASE','CHARGE','XXXXXX', '68','1506', 'Dotations aux amortissements et aux provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (383,'PCG99-BASE','CHARGE','XXXXXX', '681', '382', 'Dotations aux amortissements et aux provisions - Charges d''exploitation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (384,'PCG99-BASE','CHARGE','XXXXXX', '686', '382', 'Dotations aux amortissements et aux provisions - Charges financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (385,'PCG99-BASE','CHARGE','XXXXXX', '687', '382', 'Dotations aux amortissements et aux provisions - Charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (386,'PCG99-BASE','CHARGE','XXXXXX', '69','1506', 'Participation des salariés - impôts sur les bénéfices et assimiles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (387,'PCG99-BASE','CHARGE','XXXXXX', '691', '386', 'Participation des salariés aux résultats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (388,'PCG99-BASE','CHARGE','XXXXXX', '695', '386', 'Impôts sur les bénéfices', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (389,'PCG99-BASE','CHARGE','XXXXXX', '696', '386', 'Suppléments d''impôt sur les sociétés liés aux distributions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (390,'PCG99-BASE','CHARGE','XXXXXX', '697', '386', 'Imposition forfaitaire annuelle des sociétés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (391,'PCG99-BASE','CHARGE','XXXXXX', '698', '386', 'Intégration fiscale', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (392,'PCG99-BASE','CHARGE','XXXXXX', '699', '386', 'Produits - Reports en arrière des déficits', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (393,'PCG99-BASE','PROD', 'XXXXXX', '70','1507', 'Ventes de produits fabriqués, prestations de services, marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (394,'PCG99-BASE','PROD', 'PRODUCT', '701', '393', 'Ventes de produits finis', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (395,'PCG99-BASE','PROD', 'XXXXXX', '702', '393', 'Ventes de produits intermédiaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (396,'PCG99-BASE','PROD', 'XXXXXX', '703', '393', 'Ventes de produits résiduels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (397,'PCG99-BASE','PROD', 'XXXXXX', '704', '393', 'Travaux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (398,'PCG99-BASE','PROD', 'XXXXXX', '705', '393', 'Etudes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (399,'PCG99-BASE','PROD', 'SERVICE', '706', '393', 'Prestations de services', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (400,'PCG99-BASE','PROD', 'PRODUCT', '707', '393', 'Ventes de marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (401,'PCG99-BASE','PROD', 'PRODUCT', '708', '393', 'Produits des activités annexes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (402,'PCG99-BASE','PROD', 'XXXXXX', '709', '393', 'Rabais, remises et ristournes accordés par l''entreprise', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (403,'PCG99-BASE','PROD', 'XXXXXX', '71','1507', 'Production stockée (ou déstockage)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (404,'PCG99-BASE','PROD', 'XXXXXX', '713', '403', 'Variation des stocks (en-cours de production, produits)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (405,'PCG99-BASE','PROD', 'XXXXXX', '72','1507', 'Production immobilisée', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (406,'PCG99-BASE','PROD', 'XXXXXX', '721', '405', 'Immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (407,'PCG99-BASE','PROD', 'XXXXXX', '722', '405', 'Immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (408,'PCG99-BASE','PROD', 'XXXXXX', '74','1507', 'Subventions d''exploitation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (409,'PCG99-BASE','PROD', 'XXXXXX', '75','1507', 'Autres produits de gestion courante', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (410,'PCG99-BASE','PROD', 'XXXXXX', '751', '409', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (411,'PCG99-BASE','PROD', 'XXXXXX', '752', '409', 'Revenus des immeubles non affectés à des activités professionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (412,'PCG99-BASE','PROD', 'XXXXXX', '753', '409', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (413,'PCG99-BASE','PROD', 'XXXXXX', '754', '409', 'Ristournes perçues des coopératives (provenant des excédents)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (414,'PCG99-BASE','PROD', 'XXXXXX', '755', '409', 'Quotes-parts de résultat sur opérations faites en commun', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (415,'PCG99-BASE','PROD', 'XXXXXX', '758', '409', 'Produits divers de gestion courante', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (416,'PCG99-BASE','PROD', 'XXXXXX', '76','1507', 'Produits financiers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (417,'PCG99-BASE','PROD', 'XXXXXX', '761', '416', 'Produits de participations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (418,'PCG99-BASE','PROD', 'XXXXXX', '762', '416', 'Produits des autres immobilisations financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (419,'PCG99-BASE','PROD', 'XXXXXX', '763', '416', 'Revenus des autres créances', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (420,'PCG99-BASE','PROD', 'XXXXXX', '764', '416', 'Revenus des valeurs mobilières de placement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (421,'PCG99-BASE','PROD', 'XXXXXX', '765', '416', 'Escomptes obtenus', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (422,'PCG99-BASE','PROD', 'XXXXXX', '766', '416', 'Gains de change', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (423,'PCG99-BASE','PROD', 'XXXXXX', '767', '416', 'Produits nets sur cessions de valeurs mobilières de placement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (424,'PCG99-BASE','PROD', 'XXXXXX', '768', '416', 'Autres produits financiers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (425,'PCG99-BASE','PROD', 'XXXXXX', '77','1507', 'Produits exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (426,'PCG99-BASE','PROD', 'XXXXXX', '771', '425', 'Produits exceptionnels sur opérations de gestion', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (427,'PCG99-BASE','PROD', 'XXXXXX', '772', '425', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les produits sur exercices antérieurs)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (428,'PCG99-BASE','PROD', 'XXXXXX', '775', '425', 'Produits des cessions d''éléments d''actif', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (429,'PCG99-BASE','PROD', 'XXXXXX', '777', '425', 'Quote-part des subventions d''investissement virée au résultat de l''exercice', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (430,'PCG99-BASE','PROD', 'XXXXXX', '778', '425', 'Autres produits exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (431,'PCG99-BASE','PROD', 'XXXXXX', '78','1507', 'Reprises sur amortissements et provisions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (432,'PCG99-BASE','PROD', 'XXXXXX', '781', '431', 'Reprises sur amortissements et provisions (à inscrire dans les produits d''exploitation)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (433,'PCG99-BASE','PROD', 'XXXXXX', '786', '431', 'Reprises sur provisions pour risques (à inscrire dans les produits financiers)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (434,'PCG99-BASE','PROD', 'XXXXXX', '787', '431', 'Reprises sur provisions (à inscrire dans les produits exceptionnels)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (435,'PCG99-BASE','PROD', 'XXXXXX', '79','1507', 'Transferts de charges', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (436,'PCG99-BASE','PROD', 'XXXXXX', '791', '435', 'Transferts de charges d''exploitation ', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (437,'PCG99-BASE','PROD', 'XXXXXX', '796', '435', 'Transferts de charges financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (438,'PCG99-BASE','PROD', 'XXXXXX', '797', '435', 'Transferts de charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (322,'PCG99-BASE','EXPENSE','PRODUCT', '60','1506', 'Achats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (323,'PCG99-BASE','EXPENSE','XXXXXX', '601', '322', 'Achats stockés - Matières premières (et fournitures)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (324,'PCG99-BASE','EXPENSE','XXXXXX', '602', '322', 'Achats stockés - Autres approvisionnements', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (325,'PCG99-BASE','EXPENSE','XXXXXX', '603', '322', 'Variations des stocks (approvisionnements et marchandises)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','EXPENSE','XXXXXX', '604', '322', 'Achats stockés - Matières premières (et fournitures)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (327,'PCG99-BASE','EXPENSE','XXXXXX', '605', '322', 'Achats de matériel, équipements et travaux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (328,'PCG99-BASE','EXPENSE','XXXXXX', '606', '322', 'Achats non stockés de matière et fournitures', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (329,'PCG99-BASE','EXPENSE','XXXXXX', '607', '322', 'Achats de marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (330,'PCG99-BASE','EXPENSE','XXXXXX', '608', '322', '(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (331,'PCG99-BASE','EXPENSE','XXXXXX', '609', '322', 'Rabais, remises et ristournes obtenus sur achats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (332,'PCG99-BASE','EXPENSE','SERVICE', '61','1506', 'Services extérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (333,'PCG99-BASE','EXPENSE','XXXXXX', '611', '332', 'Sous-traitance générale', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (334,'PCG99-BASE','EXPENSE','XXXXXX', '612', '332', 'Redevances de crédit-bail', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (335,'PCG99-BASE','EXPENSE','XXXXXX', '613', '332', 'Locations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (336,'PCG99-BASE','EXPENSE','XXXXXX', '614', '332', 'Charges locatives et de copropriété', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (337,'PCG99-BASE','EXPENSE','XXXXXX', '615', '332', 'Entretien et réparations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (338,'PCG99-BASE','EXPENSE','XXXXXX', '616', '332', 'Primes d''assurances', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (339,'PCG99-BASE','EXPENSE','XXXXXX', '617', '332', 'Etudes et recherches', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (340,'PCG99-BASE','EXPENSE','XXXXXX', '618', '332', 'Divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (341,'PCG99-BASE','EXPENSE','XXXXXX', '619', '332', 'Rabais, remises et ristournes obtenus sur services extérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (342,'PCG99-BASE','EXPENSE','XXXXXX', '62','1506', 'Autres services extérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (343,'PCG99-BASE','EXPENSE','XXXXXX', '621', '342', 'Personnel extérieur à l''entreprise', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (344,'PCG99-BASE','EXPENSE','XXXXXX', '622', '342', 'Rémunérations d''intermédiaires et honoraires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (345,'PCG99-BASE','EXPENSE','XXXXXX', '623', '342', 'Publicité, publications, relations publiques', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (346,'PCG99-BASE','EXPENSE','XXXXXX', '624', '342', 'Transports de biens et transports collectifs du personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (347,'PCG99-BASE','EXPENSE','XXXXXX', '625', '342', 'Déplacements, missions et réceptions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (348,'PCG99-BASE','EXPENSE','XXXXXX', '626', '342', 'Frais postaux et de télécommunications', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (349,'PCG99-BASE','EXPENSE','XXXXXX', '627', '342', 'Services bancaires et assimilés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (350,'PCG99-BASE','EXPENSE','XXXXXX', '628', '342', 'Divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (351,'PCG99-BASE','EXPENSE','XXXXXX', '629', '342', 'Rabais, remises et ristournes obtenus sur autres services extérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (352,'PCG99-BASE','EXPENSE','XXXXXX', '63','1506', 'Impôts, taxes et versements assimilés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (353,'PCG99-BASE','EXPENSE','XXXXXX', '631', '352', 'Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (354,'PCG99-BASE','EXPENSE','XXXXXX', '633', '352', 'Impôts, taxes et versements assimilés sur rémunérations (autres organismes)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (355,'PCG99-BASE','EXPENSE','XXXXXX', '635', '352', 'Autres impôts, taxes et versements assimilés (administrations des impôts)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (356,'PCG99-BASE','EXPENSE','XXXXXX', '637', '352', 'Autres impôts, taxes et versements assimilés (autres organismes)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (357,'PCG99-BASE','EXPENSE','XXXXXX', '64','1506', 'Charges de personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (358,'PCG99-BASE','EXPENSE','XXXXXX', '641', '357', 'Rémunérations du personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (359,'PCG99-BASE','EXPENSE','XXXXXX', '644', '357', 'Rémunération du travail de l''exploitant', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (360,'PCG99-BASE','EXPENSE','SOCIAL', '645', '357', 'Charges de sécurité sociale et de prévoyance', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (361,'PCG99-BASE','EXPENSE','XXXXXX', '646', '357', 'Cotisations sociales personnelles de l''exploitant', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (362,'PCG99-BASE','EXPENSE','XXXXXX', '647', '357', 'Autres charges sociales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (363,'PCG99-BASE','EXPENSE','XXXXXX', '648', '357', 'Autres charges de personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (364,'PCG99-BASE','EXPENSE','XXXXXX', '65','1506', 'Autres charges de gestion courante', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (365,'PCG99-BASE','EXPENSE','XXXXXX', '651', '364', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (366,'PCG99-BASE','EXPENSE','XXXXXX', '653', '364', 'Jetons de présence', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (367,'PCG99-BASE','EXPENSE','XXXXXX', '654', '364', 'Pertes sur créances irrécouvrables', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (368,'PCG99-BASE','EXPENSE','XXXXXX', '655', '364', 'Quote-part de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (369,'PCG99-BASE','EXPENSE','XXXXXX', '658', '364', 'Charges diverses de gestion courante', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (370,'PCG99-BASE','EXPENSE','XXXXXX', '66','1506', 'Charges financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (371,'PCG99-BASE','EXPENSE','XXXXXX', '661', '370', 'Charges d''intérêts', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (372,'PCG99-BASE','EXPENSE','XXXXXX', '664', '370', 'Pertes sur créances liées à des participations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (373,'PCG99-BASE','EXPENSE','XXXXXX', '665', '370', 'Escomptes accordés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (374,'PCG99-BASE','EXPENSE','XXXXXX', '666', '370', 'Pertes de change', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (375,'PCG99-BASE','EXPENSE','XXXXXX', '667', '370', 'Charges nettes sur cessions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (376,'PCG99-BASE','EXPENSE','XXXXXX', '668', '370', 'Autres charges financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (377,'PCG99-BASE','EXPENSE','XXXXXX', '67','1506', 'Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (378,'PCG99-BASE','EXPENSE','XXXXXX', '671', '377', 'Charges exceptionnelles sur opérations de gestion', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (379,'PCG99-BASE','EXPENSE','XXXXXX', '672', '377', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les charges sur exercices antérieurs)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (380,'PCG99-BASE','EXPENSE','XXXXXX', '675', '377', 'Valeurs comptables des éléments d''actif cédés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (381,'PCG99-BASE','EXPENSE','XXXXXX', '678', '377', 'Autres charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (382,'PCG99-BASE','EXPENSE','XXXXXX', '68','1506', 'Dotations aux amortissements et aux provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (383,'PCG99-BASE','EXPENSE','XXXXXX', '681', '382', 'Dotations aux amortissements et aux provisions - Charges d''exploitation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (384,'PCG99-BASE','EXPENSE','XXXXXX', '686', '382', 'Dotations aux amortissements et aux provisions - Charges financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (385,'PCG99-BASE','EXPENSE','XXXXXX', '687', '382', 'Dotations aux amortissements et aux provisions - Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (386,'PCG99-BASE','EXPENSE','XXXXXX', '69','1506', 'Participation des salariés - impôts sur les bénéfices et assimiles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (387,'PCG99-BASE','EXPENSE','XXXXXX', '691', '386', 'Participation des salariés aux résultats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (388,'PCG99-BASE','EXPENSE','XXXXXX', '695', '386', 'Impôts sur les bénéfices', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (389,'PCG99-BASE','EXPENSE','XXXXXX', '696', '386', 'Suppléments d''impôt sur les sociétés liés aux distributions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (390,'PCG99-BASE','EXPENSE','XXXXXX', '697', '386', 'Imposition forfaitaire annuelle des sociétés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (391,'PCG99-BASE','EXPENSE','XXXXXX', '698', '386', 'Intégration fiscale', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (392,'PCG99-BASE','EXPENSE','XXXXXX', '699', '386', 'Produits - Reports en arrière des déficits', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (393,'PCG99-BASE','INCOME', 'XXXXXX', '70','1507', 'Ventes de produits fabriqués, prestations de services, marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (394,'PCG99-BASE','INCOME', 'PRODUCT', '701', '393', 'Ventes de produits finis', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (395,'PCG99-BASE','INCOME', 'XXXXXX', '702', '393', 'Ventes de produits intermédiaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (396,'PCG99-BASE','INCOME', 'XXXXXX', '703', '393', 'Ventes de produits résiduels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (397,'PCG99-BASE','INCOME', 'XXXXXX', '704', '393', 'Travaux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (398,'PCG99-BASE','INCOME', 'XXXXXX', '705', '393', 'Etudes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (399,'PCG99-BASE','INCOME', 'SERVICE', '706', '393', 'Prestations de services', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (400,'PCG99-BASE','INCOME', 'PRODUCT', '707', '393', 'Ventes de marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (401,'PCG99-BASE','INCOME', 'PRODUCT', '708', '393', 'Produits des activités annexes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (402,'PCG99-BASE','INCOME', 'XXXXXX', '709', '393', 'Rabais, remises et ristournes accordés par l''entreprise', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (403,'PCG99-BASE','INCOME', 'XXXXXX', '71','1507', 'Production stockée (ou déstockage)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (404,'PCG99-BASE','INCOME', 'XXXXXX', '713', '403', 'Variation des stocks (en-cours de production, produits)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (405,'PCG99-BASE','INCOME', 'XXXXXX', '72','1507', 'Production immobilisée', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (406,'PCG99-BASE','INCOME', 'XXXXXX', '721', '405', 'Immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (407,'PCG99-BASE','INCOME', 'XXXXXX', '722', '405', 'Immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (408,'PCG99-BASE','INCOME', 'XXXXXX', '74','1507', 'Subventions d''exploitation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (409,'PCG99-BASE','INCOME', 'XXXXXX', '75','1507', 'Autres produits de gestion courante', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (410,'PCG99-BASE','INCOME', 'XXXXXX', '751', '409', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (411,'PCG99-BASE','INCOME', 'XXXXXX', '752', '409', 'Revenus des immeubles non affectés à des activités professionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (412,'PCG99-BASE','INCOME', 'XXXXXX', '753', '409', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (413,'PCG99-BASE','INCOME', 'XXXXXX', '754', '409', 'Ristournes perçues des coopératives (provenant des excédents)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (414,'PCG99-BASE','INCOME', 'XXXXXX', '755', '409', 'Quotes-parts de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (415,'PCG99-BASE','INCOME', 'XXXXXX', '758', '409', 'Produits divers de gestion courante', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (416,'PCG99-BASE','INCOME', 'XXXXXX', '76','1507', 'Produits financiers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (417,'PCG99-BASE','INCOME', 'XXXXXX', '761', '416', 'Produits de participations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (418,'PCG99-BASE','INCOME', 'XXXXXX', '762', '416', 'Produits des autres immobilisations financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (419,'PCG99-BASE','INCOME', 'XXXXXX', '763', '416', 'Revenus des autres créances', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (420,'PCG99-BASE','INCOME', 'XXXXXX', '764', '416', 'Revenus des valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (421,'PCG99-BASE','INCOME', 'XXXXXX', '765', '416', 'Escomptes obtenus', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (422,'PCG99-BASE','INCOME', 'XXXXXX', '766', '416', 'Gains de change', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (423,'PCG99-BASE','INCOME', 'XXXXXX', '767', '416', 'Produits nets sur cessions de valeurs mobilières de placement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (424,'PCG99-BASE','INCOME', 'XXXXXX', '768', '416', 'Autres produits financiers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (425,'PCG99-BASE','INCOME', 'XXXXXX', '77','1507', 'Produits exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (426,'PCG99-BASE','INCOME', 'XXXXXX', '771', '425', 'Produits exceptionnels sur opérations de gestion', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (427,'PCG99-BASE','INCOME', 'XXXXXX', '772', '425', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les produits sur exercices antérieurs)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (428,'PCG99-BASE','INCOME', 'XXXXXX', '775', '425', 'Produits des cessions d''éléments d''actif', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (429,'PCG99-BASE','INCOME', 'XXXXXX', '777', '425', 'Quote-part des subventions d''investissement virée au résultat de l''exercice', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (430,'PCG99-BASE','INCOME', 'XXXXXX', '778', '425', 'Autres produits exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (431,'PCG99-BASE','INCOME', 'XXXXXX', '78','1507', 'Reprises sur amortissements et provisions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (432,'PCG99-BASE','INCOME', 'XXXXXX', '781', '431', 'Reprises sur amortissements et provisions (à inscrire dans les produits d''exploitation)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (433,'PCG99-BASE','INCOME', 'XXXXXX', '786', '431', 'Reprises sur provisions pour risques (à inscrire dans les produits financiers)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (434,'PCG99-BASE','INCOME', 'XXXXXX', '787', '431', 'Reprises sur provisions (à inscrire dans les produits exceptionnels)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (435,'PCG99-BASE','INCOME', 'XXXXXX', '79','1507', 'Transferts de charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (436,'PCG99-BASE','INCOME', 'XXXXXX', '791', '435', 'Transferts de charges d''exploitation ', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (437,'PCG99-BASE','INCOME', 'XXXXXX', '796', '435', 'Transferts de charges financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (438,'PCG99-BASE','INCOME', 'XXXXXX', '797', '435', 'Transferts de charges exceptionnelles', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1501,'PCG99-BASE','CAPIT', 'XXXXXX', '1', '0', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1502,'PCG99-BASE','IMMO', 'XXXXXX', '2', '0', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1503,'PCG99-BASE','STOCK', 'XXXXXX', '3', '0', 'Stock et commandes en cours d''exécution', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1504,'PCG99-BASE','TIERS', 'XXXXXX', '4', '0', 'Créances et dettes à un an au plus', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1505,'PCG99-BASE','FINAN', 'XXXXXX', '5', '0', 'Placement de trésorerie et de valeurs disponibles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1506,'PCG99-BASE','CHARGE','XXXXXX', '6', '0', 'Charges', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1507,'PCG99-BASE','PROD', 'XXXXXX', '7', '0', 'Produits', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1506,'PCG99-BASE','EXPENSE','XXXXXX', '6', '0', 'Charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1507,'PCG99-BASE','INCOME', 'XXXXXX', '7', '0', 'Produits', 1); -- -- Descriptif des plans comptables BE PCMN-BASE @@ -1129,297 +1129,297 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1061, 'PCMN-BASE', 'FINAN', 'XXXXXX', '570', '1060', 'à 577 Caisses - espèces ( 0 - centrale ; 7 - succursales et agences)', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1062, 'PCMN-BASE', 'FINAN', 'XXXXXX', '578', '1060', 'Caisses - timbres ( 0 - fiscaux ; 1 - postaux)', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1063, 'PCMN-BASE', 'FINAN', 'XXXXXX', '58', '1355', 'Virements internes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1064, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '60', '1356', 'Approvisionnements et marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1065, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '600', '1064', 'Achats de matières premières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1066, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '601', '1064', 'Achats de fournitures', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1067, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '602', '1064', 'Achats de services, travaux et études', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1068, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '603', '1064', 'Sous-traitances générales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1069, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '604', '1064', 'Achats de marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1070, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '605', '1064', 'Achats d''immeubles destinés à la revente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1071, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '608', '1064', 'Remises , ristournes et rabais obtenus sur achats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1072, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '609', '1064', 'Variations de stocks', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1073, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6090', '1072', 'De matières premières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1074, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6091', '1072', 'De fournitures', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1075, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6094', '1072', 'De marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1076, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6095', '1072', 'd''immeubles destinés à la vente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1077, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61', '1356', 'Services et biens divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1078, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '610', '1077', 'Loyers et charges locatives', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1079, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6100', '1078', 'Loyers divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1080, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6101', '1078', 'Charges locatives (assurances, frais de confort,etc)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1081, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '611', '1077', 'Entretien et réparation (fournitures et prestations)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1082, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '612', '1077', 'Fournitures faites à l''entreprise', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1083, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6120', '1082', 'Eau, gaz, électricité, vapeur', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1084, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61200', '1083', 'Eau', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1085, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61201', '1083', 'Gaz', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1086, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61202', '1083', 'Electricité', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1087, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61203', '1083', 'Vapeur', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1088, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6121', '1082', 'Téléphone, télégrammes, télex, téléfax, frais postaux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1089, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61210', '1088', 'Téléphone', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1090, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61211', '1088', 'Télégrammes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1091, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61212', '1088', 'Télex et téléfax', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1092, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61213', '1088', 'Frais postaux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1093, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6122', '1082', 'Livres, bibliothèque', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1094, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6123', '1082', 'Imprimés et fournitures de bureau (si non comptabilisé au 601)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1095, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '613', '1077', 'Rétributions de tiers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1096, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6130', '1095', 'Redevances et royalties', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1097, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61300', '1096', 'Redevances pour brevets, licences, marques et accessoires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1098, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61301', '1096', 'Autres redevances (procédés de fabrication)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1099, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6131', '1095', 'Assurances non relatives au personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1100, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61310', '1099', 'Assurance incendie', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1101, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61311', '1099', 'Assurance vol', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1102, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61312', '1099', 'Assurance autos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1103, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61313', '1099', 'Assurance crédit', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1104, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61314', '1099', 'Assurances frais généraux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1105, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6132', '1095', 'Divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1106, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61320', '1105', 'Commissions aux tiers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1107, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61321', '1105', 'Honoraires d''avocats, d''experts, etc', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1108, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61322', '1105', 'Cotisations aux groupements professionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1109, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61323', '1105', 'Dons, libéralités, etc', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1110, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61324', '1105', 'Frais de contentieux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1111, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61325', '1105', 'Publications légales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1112, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6133', '1095', 'Transports et déplacements', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1113, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61330', '1112', 'Transports de personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1114, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61331', '1112', 'Voyages, déplacements et représentations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1115, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6134', '1095', 'Personnel intérimaire', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1116, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '614', '1077', 'Annonces, publicité, propagande et documentation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1117, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6140', '1116', 'Annonces et insertions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1118, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6141', '1116', 'Catalogues et imprimés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1119, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6142', '1116', 'Echantillons', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1120, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6143', '1116', 'Foires et expositions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1121, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6144', '1116', 'Primes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1122, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6145', '1116', 'Cadeaux à la clientèle', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1123, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6146', '1116', 'Missions et réceptions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1124, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6147', '1116', 'Documentation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1125, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '615', '1077', 'Sous-traitants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1126, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6150', '1125', 'Sous-traitants pour activités propres', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1127, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6151', '1125', 'Sous-traitants d''associations momentanées (coparticipants)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1128, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6152', '1125', 'Quote-part bénéficiaire des coparticipants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1129, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '617', '1077', 'Personnel intérimaire et personnes mises à la disposition de l''entreprise', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1130, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '618', '1077', 'Rémunérations, primes pour assurances extralégales, pensions de retraite et de survie des administrateurs, gérants et associés actifs qui ne sont pas attribuées en vertu d''un contrat de travail', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1131, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62', '1356', 'Rémunérations, charges sociales et pensions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1132, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '620', '1131', 'Rémunérations et avantages sociaux directs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1133, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6200', '1132', 'Administrateurs ou gérants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1134, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6201', '1132', 'Personnel de direction', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1135, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6202', '1132', 'Employés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1136, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6203', '1132', 'Ouvriers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1137, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6204', '1132', 'Autres membres du personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1138, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '621', '1131', 'Cotisations patronales d''assurances sociales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1139, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6210', '1138', 'Sur salaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1140, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6211', '1138', 'Sur appointements et commissions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1141, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '622', '1131', 'Primes patronales pour assurances extralégales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1142, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '623', '1131', 'Autres frais de personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1143, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6230', '1142', 'Assurances du personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1144, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62300', '1143', 'Assurances loi, responsabilité civile, chemin du travail', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1145, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62301', '1143', 'Assurance salaire garanti', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1146, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62302', '1143', 'Assurances individuelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1147, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6231', '1142', 'Charges sociales diverses', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1148, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62310', '1147', 'Jours fériés payés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1149, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62311', '1147', 'Salaire hebdomadaire garanti', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1150, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62312', '1147', 'Allocations familiales complémentaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1151, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6232', '1142', 'Charges sociales des administrateurs, gérants et commissaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1152, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62320', '1151', 'Allocations familiales complémentaires pour non salariés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1153, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62321', '1151', 'Lois sociales pour indépendants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1154, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62322', '1151', 'Divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1155, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '624', '1131', 'Pensions de retraite et de survie', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1156, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6240', '1155', 'Administrateurs et gérants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1157, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6241', '1155', 'Personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1158, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '625', '1131', 'Provision pour pécule de vacances', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1159, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6250', '1158', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1160, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6251', '1158', 'Utilisations et reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1161, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '63', '1356', 'Amortissements, réductions de valeur et provisions pour risques et charges', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1162, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '630', '1161', 'Dotations aux amortissements et aux réductions de valeur sur immobilisations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1163, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6300', '1162', 'Dotations aux amortissements sur frais d''établissement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1164, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6301', '1162', 'Dotations aux amortissements sur immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1165, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6302', '1162', 'Dotations aux amortissements sur immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1166, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6308', '1162', 'Dotations aux réductions de valeur sur immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1167, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6309', '1162', 'Dotations aux réductions de valeur sur immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1168, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '631', '1161', 'Réductions de valeur sur stocks', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1169, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6310', '1168', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1170, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6311', '1168', 'Reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1171, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '632', '1161', 'Réductions de valeur sur commandes en cours d''exécution', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1172, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6320', '1171', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1173, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6321', '1171', 'Reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1174, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '633', '1161', 'Réductions de valeur sur créances commerciales à plus d''un an', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1175, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6330', '1174', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1176, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6331', '1174', 'Reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1177, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '634', '1161', 'Réductions de valeur sur créances commerciales à un an au plus', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1178, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6340', '1177', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1179, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6341', '1177', 'Reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1180, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '635', '1161', 'Provisions pour pensions et obligations similaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1181, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6350', '1180', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1182, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6351', '1180', 'Utilisations et reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1183, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '636', '11613', 'Provisions pour grosses réparations et gros entretiens', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1184, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6360', '1183', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1185, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6361', '1183', 'Utilisations et reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1186, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '637', '1161', 'Provisions pour autres risques et charges', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1187, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6370', '1186', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1188, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6371', '1186', 'Utilisations et reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1189, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64', '1356', 'Autres charges d''exploitation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1190, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '640', '1189', 'Charges fiscales d''exploitation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1191, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6400', '1190', 'Taxes et impôts directs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1192, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64000', '1191', 'Taxes sur autos et camions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1193, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6401', '1190', 'Taxes et impôts indirects', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1194, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64010', '1193', 'Timbres fiscaux pris en charge par la firme', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1195, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64011', '1193', 'Droits d''enregistrement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1196, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64012', '1193', 'T.V.A. non déductible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1197, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6402', '1190', 'Impôts provinciaux et communaux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1198, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64020', '1197', 'Taxe sur la force motrice', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1199, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64021', '1197', 'Taxe sur le personnel occupé', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1200, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6403', '1190', 'Taxes diverses', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1201, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '641', '1189', 'Moins-values sur réalisations courantes d''immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1202, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '642', '1189', 'Moins-values sur réalisations de créances commerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1203, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '643', '1189', 'à 648 Charges d''exploitations diverses', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1204, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '649', '1189', 'Charges d''exploitation portées à l''actif au titre de restructuration', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1205, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '65', '1356', 'Charges financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1206, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '650', '1205', 'Charges des dettes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1207, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6500', '1206', 'Intérêts, commissions et frais afférents aux dettes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1208, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6501', '1206', 'Amortissements des agios et frais d''émission d''emprunts', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1209, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6502', '1206', 'Autres charges de dettes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1210, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6503', '1206', 'Intérêts intercalaires portés à l''actif', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1211, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '651', '1205', 'Réductions de valeur sur actifs circulants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1212, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6510', '1211', 'Dotations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1213, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6511', '1211', 'Reprises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1214, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '652', '1205', 'Moins-values sur réalisation d''actifs circulants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1215, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '653', '1205', 'Charges d''escompte de créances', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1216, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '654', '1205', 'Différences de change', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1217, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '655', '1205', 'Ecarts de conversion des devises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1218, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '656', '1205', 'Frais de banques, de chèques postaux', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1219, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '657', '1205', 'Commissions sur ouvertures de crédit, cautions et avals', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1220, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '658', '1205', 'Frais de vente des titres', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1221, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '66', '1356', 'Charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1222, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '660', '1221', 'Amortissements et réductions de valeur exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1223, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6600', '1222', 'Sur frais d''établissement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1224, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6601', '1222', 'Sur immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1225, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6602', '1222', 'Sur immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1226, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '661', '1221', 'Réductions de valeur sur immobilisations financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1227, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '662', '1221', 'Provisions pour risques et charges exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1228, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '663', '1221', 'Moins-values sur réalisation d''actifs immobilisés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1229, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6630', '1228', 'Sur immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1230, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6631', '1228', 'Sur immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1231, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6632', '1228', 'Sur immobilisations détenues en location-financement et droits similaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1232, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6633', '1228', 'Sur immobilisations financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1233, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6634', '1228', 'Sur immeubles acquis ou construits en vue de la revente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1234, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '668', '1221', 'Autres charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1235, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '664', '1221', 'Pénalités et amendes diverses', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1236, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '665', '1221', 'Différence de charge', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1237, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '669', '1221', 'Charges exceptionnelles transférées à l''actif en frais de restructuration', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1238, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '67', '1356', 'Impôts sur le résultat', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1239, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '670', '1238', 'Impôts belges sur le résultat de l''exercice', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1240, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6700', '1239', 'Impôts et précomptes dus ou versés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1241, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6701', '1239', 'Excédent de versements d''impôts et précomptes porté à l''actif', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1242, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6702', '1239', 'Charges fiscales estimées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1243, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '671', '1238', 'Impôts belges sur le résultat d''exercices antérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1244, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6710', '1243', 'Suppléments d''impôts dus ou versés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1245, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6711', '1243', 'Suppléments d''impôts estimés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1246, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6712', '1243', 'Provisions fiscales constituées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1247, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '672', '1238', 'Impôts étrangers sur le résultat de l''exercice', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1248, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '673', '1238', 'Impôts étrangers sur le résultat d''exercices antérieurs', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1249, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '68', '1356', 'Transferts aux réserves immunisées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1250, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '69', '1356', 'Affectation des résultats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1251, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '690', '1250', 'Perte reportée de l''exercice précédent', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1252, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '691', '1250', 'Dotation à la réserve légale', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1253, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '692', '1250', 'Dotation aux autres réserves', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1254, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '693', '1250', 'Bénéfice à reporter', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1255, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '694', '1250', 'Rémunération du capital', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1256, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '695', '1250', 'Administrateurs ou gérants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1257, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '696', '1250', 'Autres allocataires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1258, 'PCMN-BASE', 'PROD', 'XXXXXX', '70', '1357', 'Chiffre d''affaires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1260, 'PCMN-BASE', 'PROD', 'XXXXXX', '700', '1258', 'Ventes de marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1261, 'PCMN-BASE', 'PROD', 'XXXXXX', '7000', '1260', 'Ventes en Belgique', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1262, 'PCMN-BASE', 'PROD', 'XXXXXX', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1263, 'PCMN-BASE', 'PROD', 'XXXXXX', '7002', '1260', 'Ventes à l''exportation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1264, 'PCMN-BASE', 'PROD', 'XXXXXX', '701', '1258', 'Ventes de produits finis', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1265, 'PCMN-BASE', 'PROD', 'XXXXXX', '7010', '1264', 'Ventes en Belgique', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1266, 'PCMN-BASE', 'PROD', 'XXXXXX', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1267, 'PCMN-BASE', 'PROD', 'XXXXXX', '7012', '1264', 'Ventes à l''exportation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1268, 'PCMN-BASE', 'PROD', 'XXXXXX', '702', '1258', 'Ventes de déchets et rebuts', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1269, 'PCMN-BASE', 'PROD', 'XXXXXX', '7020', '1268', 'Ventes en Belgique', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1270, 'PCMN-BASE', 'PROD', 'XXXXXX', '7021', '1268', 'Ventes dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1271, 'PCMN-BASE', 'PROD', 'XXXXXX', '7022', '1268', 'Ventes à l''exportation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1272, 'PCMN-BASE', 'PROD', 'XXXXXX', '703', '1258', 'Ventes d''emballages récupérables', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1273, 'PCMN-BASE', 'PROD', 'XXXXXX', '704', '1258', 'Facturations des travaux en cours (associations momentanées)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1274, 'PCMN-BASE', 'PROD', 'XXXXXX', '705', '1258', 'Prestations de services', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1275, 'PCMN-BASE', 'PROD', 'XXXXXX', '7050', '1274', 'Prestations de services en Belgique', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1276, 'PCMN-BASE', 'PROD', 'XXXXXX', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1277, 'PCMN-BASE', 'PROD', 'XXXXXX', '7052', '1274', 'Prestations de services en vue de l''exportation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1278, 'PCMN-BASE', 'PROD', 'XXXXXX', '706', '1258', 'Pénalités et dédits obtenus par l''entreprise', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1279, 'PCMN-BASE', 'PROD', 'XXXXXX', '708', '1258', 'Remises, ristournes et rabais accordés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1280, 'PCMN-BASE', 'PROD', 'XXXXXX', '7080', '1279', 'Sur ventes de marchandises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1281, 'PCMN-BASE', 'PROD', 'XXXXXX', '7081', '1279', 'Sur ventes de produits finis', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1282, 'PCMN-BASE', 'PROD', 'XXXXXX', '7082', '1279', 'Sur ventes de déchets et rebuts', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1283, 'PCMN-BASE', 'PROD', 'XXXXXX', '7083', '1279', 'Sur prestations de services', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1284, 'PCMN-BASE', 'PROD', 'XXXXXX', '7084', '1279', 'Mali sur travaux facturés aux associations momentanées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1285, 'PCMN-BASE', 'PROD', 'XXXXXX', '71', '1357', 'Variation des stocks et des commandes en cours d''exécution', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1286, 'PCMN-BASE', 'PROD', 'XXXXXX', '712', '1285', 'Des en cours de fabrication', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1287, 'PCMN-BASE', 'PROD', 'XXXXXX', '713', '1285', 'Des produits finis', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1288, 'PCMN-BASE', 'PROD', 'XXXXXX', '715', '1285', 'Des immeubles construits destinés à la vente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1289, 'PCMN-BASE', 'PROD', 'XXXXXX', '717', '1285', 'Des commandes en cours d''exécution', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1290, 'PCMN-BASE', 'PROD', 'XXXXXX', '7170', '1289', 'Commandes en cours - Coût de revient', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1291, 'PCMN-BASE', 'PROD', 'XXXXXX', '71700', '1290', 'Coût des commandes en cours d''exécution', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1292, 'PCMN-BASE', 'PROD', 'XXXXXX', '71701', '1290', 'Coût des travaux en cours des associations momentanées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1293, 'PCMN-BASE', 'PROD', 'XXXXXX', '7171', '1289', 'Bénéfices portés en compte sur commandes en cours', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1294, 'PCMN-BASE', 'PROD', 'XXXXXX', '71710', '1293', 'Sur commandes en cours d''exécution', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1295, 'PCMN-BASE', 'PROD', 'XXXXXX', '71711', '1293', 'Sur travaux en cours des associations momentanées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1296, 'PCMN-BASE', 'PROD', 'XXXXXX', '72', '1357', 'Production immobilisée', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1297, 'PCMN-BASE', 'PROD', 'XXXXXX', '720', '1296', 'En frais d''établissement', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1298, 'PCMN-BASE', 'PROD', 'XXXXXX', '721', '1296', 'En immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1299, 'PCMN-BASE', 'PROD', 'XXXXXX', '722', '1296', 'En immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1300, 'PCMN-BASE', 'PROD', 'XXXXXX', '723', '1296', 'En immobilisations en cours', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1301, 'PCMN-BASE', 'PROD', 'XXXXXX', '74', '1357', 'Autres produits d''exploitation', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1302, 'PCMN-BASE', 'PROD', 'XXXXXX', '740', '1301', 'Subsides d''exploitation et montants compensatoires', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1303, 'PCMN-BASE', 'PROD', 'XXXXXX', '741', '1301', 'Plus-values sur réalisations courantes d''immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1304, 'PCMN-BASE', 'PROD', 'XXXXXX', '742', '1301', 'Plus-values sur réalisations de créances commerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1306, 'PCMN-BASE', 'PROD', 'XXXXXX', '743', '1301', 'Produits de services exploités dans l''intérêt du personnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1307, 'PCMN-BASE', 'PROD', 'XXXXXX', '744', '1301', 'Commissions et courtages', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1308, 'PCMN-BASE', 'PROD', 'XXXXXX', '745', '1301', 'Redevances pour brevets et licences', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1309, 'PCMN-BASE', 'PROD', 'XXXXXX', '746', '1301', 'Prestations de services (transports, études, etc)', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1310, 'PCMN-BASE', 'PROD', 'XXXXXX', '747', '1301', 'Revenus des immeubles affectés aux activités non professionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1311, 'PCMN-BASE', 'PROD', 'XXXXXX', '748', '1301', 'Locations diverses à caractère professionnel', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1312, 'PCMN-BASE', 'PROD', 'XXXXXX', '749', '1301', 'Produits divers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1313, 'PCMN-BASE', 'PROD', 'XXXXXX', '7490', '1312', 'Bonis sur reprises d''emballages consignés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1314, 'PCMN-BASE', 'PROD', 'XXXXXX', '7491', '1312', 'Bonis sur travaux en associations momentanées', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1315, 'PCMN-BASE', 'PROD', 'XXXXXX', '75', '1357', 'Produits financiers', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1316, 'PCMN-BASE', 'PROD', 'XXXXXX', '750', '1315', 'Produits des immobilisations financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1317, 'PCMN-BASE', 'PROD', 'XXXXXX', '7500', '1316', 'Revenus des actions', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1318, 'PCMN-BASE', 'PROD', 'XXXXXX', '7501', '1316', 'Revenus des obligations', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1319, 'PCMN-BASE', 'PROD', 'XXXXXX', '7502', '1316', 'Revenus des créances à plus d''un an', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1320, 'PCMN-BASE', 'PROD', 'XXXXXX', '751', '1315', 'Produits des actifs circulants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1321, 'PCMN-BASE', 'PROD', 'XXXXXX', '752', '1315', 'Plus-values sur réalisations d''actifs circulants', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1322, 'PCMN-BASE', 'PROD', 'XXXXXX', '753', '1315', 'Subsides en capital et en intérêts', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1323, 'PCMN-BASE', 'PROD', 'XXXXXX', '754', '1315', 'Différences de change', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1324, 'PCMN-BASE', 'PROD', 'XXXXXX', '755', '1315', 'Ecarts de conversion des devises', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1326, 'PCMN-BASE', 'PROD', 'XXXXXX', '756', '1315', 'Produits des autres créances', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1327, 'PCMN-BASE', 'PROD', 'XXXXXX', '757', '1315', 'Escomptes obtenus', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1328, 'PCMN-BASE', 'PROD', 'XXXXXX', '76', '1357', 'Produits exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1329, 'PCMN-BASE', 'PROD', 'XXXXXX', '760', '1328', 'Reprises d''amortissements et de réductions de valeur', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1330, 'PCMN-BASE', 'PROD', 'XXXXXX', '7600', '1329', 'Sur immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1331, 'PCMN-BASE', 'PROD', 'XXXXXX', '7601', '1329', 'Sur immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1332, 'PCMN-BASE', 'PROD', 'XXXXXX', '761', '1328', 'Reprises de réductions de valeur sur immobilisations financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1333, 'PCMN-BASE', 'PROD', 'XXXXXX', '762', '1328', 'Reprises de provisions pour risques et charges exceptionnelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1334, 'PCMN-BASE', 'PROD', 'XXXXXX', '763', '1328', 'Plus-values sur réalisation d''actifs immobilisés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1335, 'PCMN-BASE', 'PROD', 'XXXXXX', '7630', '1334', 'Sur immobilisations incorporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1336, 'PCMN-BASE', 'PROD', 'XXXXXX', '7631', '1334', 'Sur immobilisations corporelles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1337, 'PCMN-BASE', 'PROD', 'XXXXXX', '7632', '1334', 'Sur immobilisations financières', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1338, 'PCMN-BASE', 'PROD', 'XXXXXX', '764', '1328', 'Autres produits exceptionnels', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1339, 'PCMN-BASE', 'PROD', 'XXXXXX', '77', '1357', 'Régularisations d''impôts et reprises de provisions fiscales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1340, 'PCMN-BASE', 'PROD', 'XXXXXX', '771', '1339', 'Impôts belges sur le résultat', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1341, 'PCMN-BASE', 'PROD', 'XXXXXX', '7710', '1340', 'Régularisations d''impôts dus ou versés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1342, 'PCMN-BASE', 'PROD', 'XXXXXX', '7711', '1340', 'Régularisations d''impôts estimés', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1343, 'PCMN-BASE', 'PROD', 'XXXXXX', '7712', '1340', 'Reprises de provisions fiscales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1344, 'PCMN-BASE', 'PROD', 'XXXXXX', '773', '1339', 'Impôts étrangers sur le résultat', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1345, 'PCMN-BASE', 'PROD', 'XXXXXX', '79', '1357', 'Affectation aux résultats', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1346, 'PCMN-BASE', 'PROD', 'XXXXXX', '790', '1345', 'Bénéfice reporté de l''exercice précédent', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1347, 'PCMN-BASE', 'PROD', 'XXXXXX', '791', '1345', 'Prélèvement sur le capital et les primes d''émission', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1348, 'PCMN-BASE', 'PROD', 'XXXXXX', '792', '1345', 'Prélèvement sur les réserves', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1349, 'PCMN-BASE', 'PROD', 'XXXXXX', '793', '1345', 'Perte à reporter', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1350, 'PCMN-BASE', 'PROD', 'XXXXXX', '794', '1345', 'Intervention d''associés (ou du propriétaire) dans la perte', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1064, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '60', '1356', 'Approvisionnements et marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1065, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '600', '1064', 'Achats de matières premières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1066, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '601', '1064', 'Achats de fournitures', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1067, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '602', '1064', 'Achats de services, travaux et études', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1068, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '603', '1064', 'Sous-traitances générales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1069, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '604', '1064', 'Achats de marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1070, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '605', '1064', 'Achats d''immeubles destinés à la revente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1071, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '608', '1064', 'Remises , ristournes et rabais obtenus sur achats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1072, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '609', '1064', 'Variations de stocks', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1073, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6090', '1072', 'De matières premières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1074, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6091', '1072', 'De fournitures', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1075, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6094', '1072', 'De marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1076, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6095', '1072', 'd''immeubles destinés à la vente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1077, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61', '1356', 'Services et biens divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1078, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '610', '1077', 'Loyers et charges locatives', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1079, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6100', '1078', 'Loyers divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1080, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6101', '1078', 'Charges locatives (assurances, frais de confort,etc)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1081, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '611', '1077', 'Entretien et réparation (fournitures et prestations)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1082, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '612', '1077', 'Fournitures faites à l''entreprise', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1083, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6120', '1082', 'Eau, gaz, électricité, vapeur', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1084, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61200', '1083', 'Eau', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1085, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61201', '1083', 'Gaz', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1086, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61202', '1083', 'Electricité', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1087, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61203', '1083', 'Vapeur', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1088, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6121', '1082', 'Téléphone, télégrammes, télex, téléfax, frais postaux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1089, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61210', '1088', 'Téléphone', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1090, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61211', '1088', 'Télégrammes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1091, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61212', '1088', 'Télex et téléfax', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1092, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61213', '1088', 'Frais postaux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1093, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6122', '1082', 'Livres, bibliothèque', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1094, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6123', '1082', 'Imprimés et fournitures de bureau (si non comptabilisé au 601)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1095, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '613', '1077', 'Rétributions de tiers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1096, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6130', '1095', 'Redevances et royalties', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1097, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61300', '1096', 'Redevances pour brevets, licences, marques et accessoires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1098, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61301', '1096', 'Autres redevances (procédés de fabrication)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1099, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6131', '1095', 'Assurances non relatives au personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1100, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61310', '1099', 'Assurance incendie', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1101, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61311', '1099', 'Assurance vol', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1102, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61312', '1099', 'Assurance autos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1103, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61313', '1099', 'Assurance crédit', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1104, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61314', '1099', 'Assurances frais généraux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1105, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6132', '1095', 'Divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1106, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61320', '1105', 'Commissions aux tiers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1107, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61321', '1105', 'Honoraires d''avocats, d''experts, etc', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1108, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61322', '1105', 'Cotisations aux groupements professionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1109, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61323', '1105', 'Dons, libéralités, etc', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1110, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61324', '1105', 'Frais de contentieux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1111, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61325', '1105', 'Publications légales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1112, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6133', '1095', 'Transports et déplacements', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1113, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61330', '1112', 'Transports de personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1114, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '61331', '1112', 'Voyages, déplacements et représentations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1115, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6134', '1095', 'Personnel intérimaire', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1116, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '614', '1077', 'Annonces, publicité, propagande et documentation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1117, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6140', '1116', 'Annonces et insertions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1118, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6141', '1116', 'Catalogues et imprimés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1119, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6142', '1116', 'Echantillons', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1120, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6143', '1116', 'Foires et expositions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1121, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6144', '1116', 'Primes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1122, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6145', '1116', 'Cadeaux à la clientèle', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1123, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6146', '1116', 'Missions et réceptions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1124, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6147', '1116', 'Documentation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1125, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '615', '1077', 'Sous-traitants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1126, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6150', '1125', 'Sous-traitants pour activités propres', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1127, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6151', '1125', 'Sous-traitants d''associations momentanées (coparticipants)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1128, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6152', '1125', 'Quote-part bénéficiaire des coparticipants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1129, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '617', '1077', 'Personnel intérimaire et personnes mises à la disposition de l''entreprise', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1130, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '618', '1077', 'Rémunérations, primes pour assurances extralégales, pensions de retraite et de survie des administrateurs, gérants et associés actifs qui ne sont pas attribuées en vertu d''un contrat de travail', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1131, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62', '1356', 'Rémunérations, charges sociales et pensions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1132, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '620', '1131', 'Rémunérations et avantages sociaux directs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1133, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6200', '1132', 'Administrateurs ou gérants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1134, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6201', '1132', 'Personnel de direction', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1135, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6202', '1132', 'Employés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1136, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6203', '1132', 'Ouvriers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1137, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6204', '1132', 'Autres membres du personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1138, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '621', '1131', 'Cotisations patronales d''assurances sociales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1139, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6210', '1138', 'Sur salaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1140, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6211', '1138', 'Sur appointements et commissions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1141, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '622', '1131', 'Primes patronales pour assurances extralégales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1142, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '623', '1131', 'Autres frais de personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1143, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6230', '1142', 'Assurances du personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1144, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62300', '1143', 'Assurances loi, responsabilité civile, chemin du travail', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1145, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62301', '1143', 'Assurance salaire garanti', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1146, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62302', '1143', 'Assurances individuelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1147, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6231', '1142', 'Charges sociales diverses', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1148, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62310', '1147', 'Jours fériés payés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1149, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62311', '1147', 'Salaire hebdomadaire garanti', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1150, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62312', '1147', 'Allocations familiales complémentaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1151, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6232', '1142', 'Charges sociales des administrateurs, gérants et commissaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1152, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62320', '1151', 'Allocations familiales complémentaires pour non salariés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1153, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62321', '1151', 'Lois sociales pour indépendants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1154, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '62322', '1151', 'Divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1155, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '624', '1131', 'Pensions de retraite et de survie', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1156, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6240', '1155', 'Administrateurs et gérants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1157, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6241', '1155', 'Personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1158, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '625', '1131', 'Provision pour pécule de vacances', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1159, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6250', '1158', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1160, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6251', '1158', 'Utilisations et reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1161, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '63', '1356', 'Amortissements, réductions de valeur et provisions pour risques et charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1162, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '630', '1161', 'Dotations aux amortissements et aux réductions de valeur sur immobilisations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1163, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6300', '1162', 'Dotations aux amortissements sur frais d''établissement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1164, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6301', '1162', 'Dotations aux amortissements sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1165, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6302', '1162', 'Dotations aux amortissements sur immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1166, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6308', '1162', 'Dotations aux réductions de valeur sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1167, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6309', '1162', 'Dotations aux réductions de valeur sur immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1168, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '631', '1161', 'Réductions de valeur sur stocks', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1169, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6310', '1168', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1170, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6311', '1168', 'Reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1171, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '632', '1161', 'Réductions de valeur sur commandes en cours d''exécution', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1172, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6320', '1171', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1173, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6321', '1171', 'Reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1174, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '633', '1161', 'Réductions de valeur sur créances commerciales à plus d''un an', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1175, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6330', '1174', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1176, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6331', '1174', 'Reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1177, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '634', '1161', 'Réductions de valeur sur créances commerciales à un an au plus', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1178, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6340', '1177', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1179, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6341', '1177', 'Reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1180, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '635', '1161', 'Provisions pour pensions et obligations similaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1181, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6350', '1180', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1182, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6351', '1180', 'Utilisations et reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1183, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '636', '11613', 'Provisions pour grosses réparations et gros entretiens', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1184, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6360', '1183', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1185, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6361', '1183', 'Utilisations et reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1186, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '637', '1161', 'Provisions pour autres risques et charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1187, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6370', '1186', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1188, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6371', '1186', 'Utilisations et reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1189, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64', '1356', 'Autres charges d''exploitation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1190, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '640', '1189', 'Charges fiscales d''exploitation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1191, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6400', '1190', 'Taxes et impôts directs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1192, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64000', '1191', 'Taxes sur autos et camions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1193, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6401', '1190', 'Taxes et impôts indirects', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1194, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64010', '1193', 'Timbres fiscaux pris en charge par la firme', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1195, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64011', '1193', 'Droits d''enregistrement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1196, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64012', '1193', 'T.V.A. non déductible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1197, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6402', '1190', 'Impôts provinciaux et communaux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1198, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64020', '1197', 'Taxe sur la force motrice', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1199, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '64021', '1197', 'Taxe sur le personnel occupé', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1200, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6403', '1190', 'Taxes diverses', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1201, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '641', '1189', 'Moins-values sur réalisations courantes d''immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1202, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '642', '1189', 'Moins-values sur réalisations de créances commerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1203, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '643', '1189', 'à 648 Charges d''exploitations diverses', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1204, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '649', '1189', 'Charges d''exploitation portées à l''actif au titre de restructuration', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1205, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '65', '1356', 'Charges financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1206, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '650', '1205', 'Charges des dettes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1207, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6500', '1206', 'Intérêts, commissions et frais afférents aux dettes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1208, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6501', '1206', 'Amortissements des agios et frais d''émission d''emprunts', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1209, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6502', '1206', 'Autres charges de dettes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1210, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6503', '1206', 'Intérêts intercalaires portés à l''actif', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1211, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '651', '1205', 'Réductions de valeur sur actifs circulants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1212, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6510', '1211', 'Dotations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1213, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6511', '1211', 'Reprises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1214, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '652', '1205', 'Moins-values sur réalisation d''actifs circulants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1215, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '653', '1205', 'Charges d''escompte de créances', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1216, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '654', '1205', 'Différences de change', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1217, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '655', '1205', 'Ecarts de conversion des devises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1218, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '656', '1205', 'Frais de banques, de chèques postaux', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1219, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '657', '1205', 'Commissions sur ouvertures de crédit, cautions et avals', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1220, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '658', '1205', 'Frais de vente des titres', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1221, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '66', '1356', 'Charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1222, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '660', '1221', 'Amortissements et réductions de valeur exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1223, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6600', '1222', 'Sur frais d''établissement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1224, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6601', '1222', 'Sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1225, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6602', '1222', 'Sur immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1226, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '661', '1221', 'Réductions de valeur sur immobilisations financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1227, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '662', '1221', 'Provisions pour risques et charges exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1228, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '663', '1221', 'Moins-values sur réalisation d''actifs immobilisés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1229, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6630', '1228', 'Sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1230, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6631', '1228', 'Sur immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1231, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6632', '1228', 'Sur immobilisations détenues en location-financement et droits similaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1232, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6633', '1228', 'Sur immobilisations financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1233, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6634', '1228', 'Sur immeubles acquis ou construits en vue de la revente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1234, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '668', '1221', 'Autres charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1235, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '664', '1221', 'Pénalités et amendes diverses', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1236, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '665', '1221', 'Différence de charge', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1237, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '669', '1221', 'Charges exceptionnelles transférées à l''actif en frais de restructuration', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1238, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '67', '1356', 'Impôts sur le résultat', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1239, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '670', '1238', 'Impôts belges sur le résultat de l''exercice', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1240, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6700', '1239', 'Impôts et précomptes dus ou versés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1241, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6701', '1239', 'Excédent de versements d''impôts et précomptes porté à l''actif', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1242, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6702', '1239', 'Charges fiscales estimées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1243, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '671', '1238', 'Impôts belges sur le résultat d''exercices antérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1244, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6710', '1243', 'Suppléments d''impôts dus ou versés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1245, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6711', '1243', 'Suppléments d''impôts estimés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1246, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6712', '1243', 'Provisions fiscales constituées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1247, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '672', '1238', 'Impôts étrangers sur le résultat de l''exercice', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1248, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '673', '1238', 'Impôts étrangers sur le résultat d''exercices antérieurs', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1249, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '68', '1356', 'Transferts aux réserves immunisées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1250, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '69', '1356', 'Affectation des résultats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1251, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '690', '1250', 'Perte reportée de l''exercice précédent', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1252, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '691', '1250', 'Dotation à la réserve légale', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1253, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '692', '1250', 'Dotation aux autres réserves', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1254, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '693', '1250', 'Bénéfice à reporter', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1255, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '694', '1250', 'Rémunération du capital', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1256, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '695', '1250', 'Administrateurs ou gérants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1257, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '696', '1250', 'Autres allocataires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1258, 'PCMN-BASE', 'INCOME', 'XXXXXX', '70', '1357', 'Chiffre d''affaires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1260, 'PCMN-BASE', 'INCOME', 'XXXXXX', '700', '1258', 'Ventes de marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1261, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7000', '1260', 'Ventes en Belgique', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1262, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1263, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7002', '1260', 'Ventes à l''exportation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1264, 'PCMN-BASE', 'INCOME', 'XXXXXX', '701', '1258', 'Ventes de produits finis', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1265, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7010', '1264', 'Ventes en Belgique', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1266, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1267, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7012', '1264', 'Ventes à l''exportation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1268, 'PCMN-BASE', 'INCOME', 'XXXXXX', '702', '1258', 'Ventes de déchets et rebuts', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1269, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7020', '1268', 'Ventes en Belgique', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1270, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7021', '1268', 'Ventes dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1271, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7022', '1268', 'Ventes à l''exportation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1272, 'PCMN-BASE', 'INCOME', 'XXXXXX', '703', '1258', 'Ventes d''emballages récupérables', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1273, 'PCMN-BASE', 'INCOME', 'XXXXXX', '704', '1258', 'Facturations des travaux en cours (associations momentanées)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1274, 'PCMN-BASE', 'INCOME', 'XXXXXX', '705', '1258', 'Prestations de services', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1275, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7050', '1274', 'Prestations de services en Belgique', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1276, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1277, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7052', '1274', 'Prestations de services en vue de l''exportation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1278, 'PCMN-BASE', 'INCOME', 'XXXXXX', '706', '1258', 'Pénalités et dédits obtenus par l''entreprise', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1279, 'PCMN-BASE', 'INCOME', 'XXXXXX', '708', '1258', 'Remises, ristournes et rabais accordés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1280, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7080', '1279', 'Sur ventes de marchandises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1281, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7081', '1279', 'Sur ventes de produits finis', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1282, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7082', '1279', 'Sur ventes de déchets et rebuts', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1283, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7083', '1279', 'Sur prestations de services', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1284, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7084', '1279', 'Mali sur travaux facturés aux associations momentanées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1285, 'PCMN-BASE', 'INCOME', 'XXXXXX', '71', '1357', 'Variation des stocks et des commandes en cours d''exécution', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1286, 'PCMN-BASE', 'INCOME', 'XXXXXX', '712', '1285', 'Des en cours de fabrication', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1287, 'PCMN-BASE', 'INCOME', 'XXXXXX', '713', '1285', 'Des produits finis', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1288, 'PCMN-BASE', 'INCOME', 'XXXXXX', '715', '1285', 'Des immeubles construits destinés à la vente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1289, 'PCMN-BASE', 'INCOME', 'XXXXXX', '717', '1285', 'Des commandes en cours d''exécution', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1290, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7170', '1289', 'Commandes en cours - Coût de revient', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1291, 'PCMN-BASE', 'INCOME', 'XXXXXX', '71700', '1290', 'Coût des commandes en cours d''exécution', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1292, 'PCMN-BASE', 'INCOME', 'XXXXXX', '71701', '1290', 'Coût des travaux en cours des associations momentanées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1293, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7171', '1289', 'Bénéfices portés en compte sur commandes en cours', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1294, 'PCMN-BASE', 'INCOME', 'XXXXXX', '71710', '1293', 'Sur commandes en cours d''exécution', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1295, 'PCMN-BASE', 'INCOME', 'XXXXXX', '71711', '1293', 'Sur travaux en cours des associations momentanées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1296, 'PCMN-BASE', 'INCOME', 'XXXXXX', '72', '1357', 'Production immobilisée', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1297, 'PCMN-BASE', 'INCOME', 'XXXXXX', '720', '1296', 'En frais d''établissement', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1298, 'PCMN-BASE', 'INCOME', 'XXXXXX', '721', '1296', 'En immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1299, 'PCMN-BASE', 'INCOME', 'XXXXXX', '722', '1296', 'En immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1300, 'PCMN-BASE', 'INCOME', 'XXXXXX', '723', '1296', 'En immobilisations en cours', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1301, 'PCMN-BASE', 'INCOME', 'XXXXXX', '74', '1357', 'Autres produits d''exploitation', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1302, 'PCMN-BASE', 'INCOME', 'XXXXXX', '740', '1301', 'Subsides d''exploitation et montants compensatoires', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1303, 'PCMN-BASE', 'INCOME', 'XXXXXX', '741', '1301', 'Plus-values sur réalisations courantes d''immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1304, 'PCMN-BASE', 'INCOME', 'XXXXXX', '742', '1301', 'Plus-values sur réalisations de créances commerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1306, 'PCMN-BASE', 'INCOME', 'XXXXXX', '743', '1301', 'Produits de services exploités dans l''intérêt du personnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1307, 'PCMN-BASE', 'INCOME', 'XXXXXX', '744', '1301', 'Commissions et courtages', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1308, 'PCMN-BASE', 'INCOME', 'XXXXXX', '745', '1301', 'Redevances pour brevets et licences', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1309, 'PCMN-BASE', 'INCOME', 'XXXXXX', '746', '1301', 'Prestations de services (transports, études, etc)', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1310, 'PCMN-BASE', 'INCOME', 'XXXXXX', '747', '1301', 'Revenus des immeubles affectés aux activités non professionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1311, 'PCMN-BASE', 'INCOME', 'XXXXXX', '748', '1301', 'Locations diverses à caractère professionnel', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1312, 'PCMN-BASE', 'INCOME', 'XXXXXX', '749', '1301', 'Produits divers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1313, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7490', '1312', 'Bonis sur reprises d''emballages consignés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1314, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7491', '1312', 'Bonis sur travaux en associations momentanées', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1315, 'PCMN-BASE', 'INCOME', 'XXXXXX', '75', '1357', 'Produits financiers', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1316, 'PCMN-BASE', 'INCOME', 'XXXXXX', '750', '1315', 'Produits des immobilisations financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1317, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7500', '1316', 'Revenus des actions', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1318, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7501', '1316', 'Revenus des obligations', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1319, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7502', '1316', 'Revenus des créances à plus d''un an', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1320, 'PCMN-BASE', 'INCOME', 'XXXXXX', '751', '1315', 'Produits des actifs circulants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1321, 'PCMN-BASE', 'INCOME', 'XXXXXX', '752', '1315', 'Plus-values sur réalisations d''actifs circulants', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1322, 'PCMN-BASE', 'INCOME', 'XXXXXX', '753', '1315', 'Subsides en capital et en intérêts', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1323, 'PCMN-BASE', 'INCOME', 'XXXXXX', '754', '1315', 'Différences de change', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1324, 'PCMN-BASE', 'INCOME', 'XXXXXX', '755', '1315', 'Ecarts de conversion des devises', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1326, 'PCMN-BASE', 'INCOME', 'XXXXXX', '756', '1315', 'Produits des autres créances', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1327, 'PCMN-BASE', 'INCOME', 'XXXXXX', '757', '1315', 'Escomptes obtenus', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1328, 'PCMN-BASE', 'INCOME', 'XXXXXX', '76', '1357', 'Produits exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1329, 'PCMN-BASE', 'INCOME', 'XXXXXX', '760', '1328', 'Reprises d''amortissements et de réductions de valeur', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1330, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7600', '1329', 'Sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1331, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7601', '1329', 'Sur immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1332, 'PCMN-BASE', 'INCOME', 'XXXXXX', '761', '1328', 'Reprises de réductions de valeur sur immobilisations financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1333, 'PCMN-BASE', 'INCOME', 'XXXXXX', '762', '1328', 'Reprises de provisions pour risques et charges exceptionnelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1334, 'PCMN-BASE', 'INCOME', 'XXXXXX', '763', '1328', 'Plus-values sur réalisation d''actifs immobilisés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1335, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7630', '1334', 'Sur immobilisations incorporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1336, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7631', '1334', 'Sur immobilisations corporelles', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1337, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7632', '1334', 'Sur immobilisations financières', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1338, 'PCMN-BASE', 'INCOME', 'XXXXXX', '764', '1328', 'Autres produits exceptionnels', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1339, 'PCMN-BASE', 'INCOME', 'XXXXXX', '77', '1357', 'Régularisations d''impôts et reprises de provisions fiscales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1340, 'PCMN-BASE', 'INCOME', 'XXXXXX', '771', '1339', 'Impôts belges sur le résultat', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1341, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7710', '1340', 'Régularisations d''impôts dus ou versés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1342, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7711', '1340', 'Régularisations d''impôts estimés', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1343, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7712', '1340', 'Reprises de provisions fiscales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1344, 'PCMN-BASE', 'INCOME', 'XXXXXX', '773', '1339', 'Impôts étrangers sur le résultat', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1345, 'PCMN-BASE', 'INCOME', 'XXXXXX', '79', '1357', 'Affectation aux résultats', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1346, 'PCMN-BASE', 'INCOME', 'XXXXXX', '790', '1345', 'Bénéfice reporté de l''exercice précédent', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1347, 'PCMN-BASE', 'INCOME', 'XXXXXX', '791', '1345', 'Prélèvement sur le capital et les primes d''émission', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1348, 'PCMN-BASE', 'INCOME', 'XXXXXX', '792', '1345', 'Prélèvement sur les réserves', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1349, 'PCMN-BASE', 'INCOME', 'XXXXXX', '793', '1345', 'Perte à reporter', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1350, 'PCMN-BASE', 'INCOME', 'XXXXXX', '794', '1345', 'Intervention d''associés (ou du propriétaire) dans la perte', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1351, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1', '0', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1352, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2', '0', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1353, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3', '0', 'Stock et commandes en cours d''exécution', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1354, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4', '0', 'Créances et dettes à un an au plus', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1355, 'PCMN-BASE', 'FINAN', 'XXXXXX', '5', '0', 'Placement de trésorerie et de valeurs disponibles', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1356, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6', '0', 'Charges', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1357, 'PCMN-BASE', 'PROD', 'XXXXXX', '7', '0', 'Produits', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1356, 'PCMN-BASE', 'EXPENSE', 'XXXXXX', '6', '0', 'Charges', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1357, 'PCMN-BASE', 'INCOME', 'XXXXXX', '7', '0', 'Produits', 1); -- -- Descriptif des plans comptables ES PCG08-PYME @@ -1432,8 +1432,8 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4003,'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '3', '0', 'Existencias', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4', '0', 'Acreedores y deudores por operaciones comerciales', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5', '0', 'Cuentas financieras', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS_GASTOS','XXXXXX', '6', '0', 'Compras y gastos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7', '0', 'Ventas e ingresos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','EXPENSE','XXXXXX', '6', '0', 'Compras y gastos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','INCOME', 'XXXXXX', '7', '0', 'Ventas e ingresos', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4008, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '10', '4001', 'CAPITAL', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4009, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '100', '4008', 'Capital social', 1); @@ -1920,292 +1920,292 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', 1); INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '60', '4006', 'Compras', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '624', '4514', 'Transportes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '628', '4514', 'Suministros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '63', '4006', 'Tributos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79544','4755', 'Exceso de provisión por contratos onerosos', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79549','4755', 'Exceso de provisión para otras operaciones comerciales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', 1); -INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','EXPENSE', 'XXXXXX', '60', '4006', 'Compras', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','EXPENSE', 'COMPRAS', '600', '4493', 'Compras de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','EXPENSE', 'COMPRAS', '601', '4493', 'Compras de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','EXPENSE', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','EXPENSE', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501, 'PCG08-PYME','EXPENSE', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','EXPENSE', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','EXPENSE', 'XXXXXX', '609', '4493', 'Rappels por compras', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','EXPENSE', 'XXXXXX', '61', '4006', 'Variación de existencias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','EXPENSE', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','EXPENSE', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','EXPENSE', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','EXPENSE', 'XXXXXX', '62', '4006', 'Servicios exteriores', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','EXPENSE', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','EXPENSE', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','EXPENSE', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','EXPENSE', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','EXPENSE', 'XXXXXX', '624', '4514', 'Transportes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','EXPENSE', 'XXXXXX', '625', '4514', 'Primas de seguros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','EXPENSE', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','EXPENSE', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','EXPENSE', 'XXXXXX', '628', '4514', 'Suministros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','EXPENSE', 'XXXXXX', '629', '4514', 'Otros servicios', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','EXPENSE', 'XXXXXX', '63', '4006', 'Tributos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','EXPENSE', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6300', '4526', 'Impuesto corriente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6301', '4526', 'Impuesto diferido', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','EXPENSE', 'XXXXXX', '631', '4525', 'Otros tributos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','EXPENSE', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','EXPENSE', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','EXPENSE', 'XXXXXX', '636', '4525', 'Devolución de impuestos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','EXPENSE', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','EXPENSE', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','EXPENSE', 'XXXXXX', '64', '4006', 'Gastos de personal', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','EXPENSE', 'XXXXXX', '640', '4539', 'Sueldos y salarios', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','EXPENSE', 'XXXXXX', '641', '4539', 'Indemnizaciones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','EXPENSE', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','EXPENSE', 'XXXXXX', '649', '4539', 'Otros gastos sociales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','EXPENSE', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','EXPENSE', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','EXPENSE', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','EXPENSE', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','EXPENSE', 'XXXXXX', '66', '4006', 'Gastos financieros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','EXPENSE', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','EXPENSE', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','EXPENSE', 'XXXXXX', '662', '4550', 'Intereses de deudas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','EXPENSE', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','EXPENSE', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','EXPENSE', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','EXPENSE', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','EXPENSE', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','EXPENSE', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','EXPENSE', 'XXXXXX', '669', '4550', 'Otros gastos financieros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','EXPENSE', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','EXPENSE', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','EXPENSE', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','EXPENSE', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','EXPENSE', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','EXPENSE', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','EXPENSE', 'XXXXXX', '678', '4602', 'Gastos excepcionales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','EXPENSE', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','EXPENSE', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','EXPENSE', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','EXPENSE', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','EXPENSE', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','EXPENSE', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','EXPENSE', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','EXPENSE', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','EXPENSE', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','EXPENSE', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','EXPENSE', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','EXPENSE', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','EXPENSE', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','EXPENSE', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','EXPENSE', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','EXPENSE', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','INCOME', 'XXXXXX', '70', '4007', 'Ventas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','INCOME', 'VENTAS', '700', '4655', 'Ventas de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','INCOME', 'VENTAS', '701', '4655', 'Ventas de productos terminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','INCOME', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','INCOME', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','INCOME', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','INCOME', 'VENTAS', '705', '4655', 'Prestaciones de servicios', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','INCOME', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','INCOME', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','INCOME', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','INCOME', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','INCOME', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','INCOME', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','INCOME', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','INCOME', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','INCOME', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','INCOME', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','INCOME', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','INCOME', 'XXXXXX', '71', '4007', 'Variación de existencias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','INCOME', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','INCOME', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','INCOME', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','INCOME', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','INCOME', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','INCOME', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','INCOME', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','INCOME', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','INCOME', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','INCOME', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','INCOME', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','INCOME', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','INCOME', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','INCOME', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','INCOME', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','INCOME', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','INCOME', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','INCOME', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','INCOME', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','INCOME', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','INCOME', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','INCOME', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','INCOME', 'XXXXXX', '76', '4007', 'Ingresos financieros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','INCOME', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','INCOME', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','INCOME', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','INCOME', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','INCOME', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','INCOME', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','INCOME', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','INCOME', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','INCOME', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','INCOME', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','INCOME', 'XXXXXX', '762', '4696', 'Ingresos de créditos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','INCOME', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','INCOME', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','INCOME', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','INCOME', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','INCOME', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','INCOME', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','INCOME', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','INCOME', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','INCOME', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','INCOME', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','INCOME', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','INCOME', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','INCOME', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','INCOME', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','INCOME', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','INCOME', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','INCOME', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','INCOME', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','INCOME', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','INCOME', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','INCOME', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','INCOME', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','INCOME', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','INCOME', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','INCOME', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','INCOME', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','INCOME', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','INCOME', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','INCOME', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','INCOME', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','INCOME', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','INCOME', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','INCOME', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','INCOME', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','INCOME', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','INCOME', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','INCOME', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','INCOME', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','INCOME', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','INCOME', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','INCOME', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','INCOME', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','INCOME', 'XXXXXX', '795', '4741', 'Exceso de provisiones', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','INCOME', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','INCOME', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','INCOME', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','INCOME', 'XXXXXX', '79544','4755', 'Exceso de provisión por contratos onerosos', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','INCOME', 'XXXXXX', '79549','4755', 'Exceso de provisión para otras operaciones comerciales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','INCOME', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','INCOME', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','INCOME', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','INCOME', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','INCOME', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','INCOME', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','INCOME', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','INCOME', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','INCOME', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','INCOME', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','INCOME', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','INCOME', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','INCOME', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','INCOME', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','INCOME', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','INCOME', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','INCOME', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','INCOME', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','INCOME', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','INCOME', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','INCOME', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','INCOME', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','INCOME', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','INCOME', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','INCOME', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','INCOME', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', 1); +INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','INCOME', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_category.sql b/htdocs/install/mysql/data/llx_accounting_category.sql index 0659bd38a0a..0fd47049efb 100644 --- a/htdocs/install/mysql/data/llx_accounting_category.sql +++ b/htdocs/install/mysql/data/llx_accounting_category.sql @@ -24,6 +24,6 @@ -- Categories compte de résultat Français -- -INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1,'VTE', 'Ventes de marchandises', '707xxx', 0, 0, '', '10', 1, 1); -INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2,'MAR', 'Coût achats marchandises vendues', '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1); -INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3,'MARGE','Marge commerciale', '', 0, 1, '1 + 2', '30', 1, 1); \ No newline at end of file +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VTE', 'Ventes de marchandises', '707xxx', 0, 0, '', '10', 1, 1); +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'MAR', 'Coût achats marchandises vendues', '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1); +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'MARGE', 'Marge commerciale', '', 0, 1, '1 + 2', '30', 1, 1); \ No newline at end of file diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index d9aa1541b76..2f080227f36 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -208,6 +208,10 @@ UPDATE llx_const set name = 'ONLINE_PAYMENT_CSS_URL' where name = 'PAYPAL_CS UPDATE llx_const set name = 'ONLINE_PAYMENT_NEWFORMTEXT' where name = 'PAYPAL_NEWFORMTEXT'; UPDATE llx_const set name = 'ONLINE_PAYMENT_LOGO' where name = 'PAYPAL_LOGO'; +UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'PROD'; +UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'CHARGE'; +UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'VENTAS_E_INGRESOS'; +UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'COMPRAS_GASTOS'; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index e200f0ca7c0..63a37bc921f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -31,6 +31,10 @@ ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account JournalizationInLedgerStatus=Status of journalization AlreadyInGeneralLedger=Already journalized in ledgers NotYetInGeneralLedger=Not yet journalized in ledgers +PreviousYear=Previous year +SelectedPeriod=Selected period +GroupIsEmptyCheckSetup=Group is empty, check setup of the accounting group +DetailByAccount=Show detail by account MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup MainAccountForSuppliersNotDefined=Main accounting account for suppliers not defined in setup @@ -150,7 +154,10 @@ NumPiece=Piece number TransactionNumShort=Num. transaction AccountingCategory=Accounting account groups GroupByAccountAccounting=Group by accounting account +AccountingAccountGroupsDesc=You can define here some groups of accounting account. It will be used in the report %s to show your income/expense with data grouped according to your groups. ByAccounts=By accounts +ByPredefinedAccountGroups=By predefined groups +ByPersonalizedAccountGroups=By personalized groups NotMatch=Not Set DeleteMvt=Delete Ledger lines DelYear=Year to delete @@ -180,8 +187,9 @@ ListAccounts=List of the accounting accounts UnknownAccountForThirdparty=Unknown third party account. We will use %s UnknownAccountForThirdpartyBlocking=Unknown third party account. Blocking error -Pcgtype=Class of account -Pcgsubtype=Subclass of account +Pcgtype=Group of account +Pcgsubtype=Subgroup of account +PcgtypeDesc=Group and subgroup of account are used as predefined 'filter' and 'grouping' criterias for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as group for accounting account products to build the expense/income report. TotalVente=Total turnover before tax TotalMarge=Total sales margin diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 3a1d8bb9c5f..394541e4dd1 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -143,8 +143,9 @@ CalcModeLT2Debt=Mode %sIRPF on customer invoices%s CalcModeLT2Rec= Mode %sIRPF on suppliers invoices%s AnnualSummaryDueDebtMode=Balance of income and expenses, annual summary AnnualSummaryInputOutputMode=Balance of income and expenses, annual summary -AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by third parties, mode %sClaims-Debts%s said Commitment accounting. -AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third parties, mode %sIncomes-Expenses%s said cash accounting. +AnnualByCompanies=Income / Expenses, By predefined groups of account +AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by predefined groups, mode %sClaims-Debts%s said Commitment accounting. +AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by predefined groups, mode %sIncomes-Expenses%s said cash accounting. SeeReportInInputOutputMode=See report %sIncomes-Expenses%s said cash accounting for a calculation on actual payments made SeeReportInDueDebtMode=See report %sClaims-Debts%s said commitment accounting for a calculation on issued invoices SeeReportInBookkeepingMode=See report %sBookeeping%s for a calculation on bookkeeping table analysis @@ -153,6 +154,9 @@ RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whet RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries.
        - It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation. RulesCADue=- It includes the client's due invoices whether they are paid or not.
        - It is based on the validation date of these invoices.
        RulesCAIn=- It includes all the effective payments of invoices received from clients.
        - It is based on the payment date of these invoices
        +RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" (See %s) +RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" (See %s) +RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts grouped by personalized groups (See menu %s to define accounting account groups) DepositsAreNotIncluded=- Down payment invoices are nor included DepositsAreIncluded=- Down payment invoices are included LT2ReportByCustomersInInputOutputModeES=Report by third party IRPF @@ -227,3 +231,4 @@ ImportDataset_tax_vat=Vat payments ErrorBankAccountNotFound=Error: Bank account not found FiscalPeriod=Accounting period ListSocialContributionAssociatedProject=List of social contributions associated with the project +DeleteFromCat=Remove from accounting group diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index d8c35c64a81..d0aebfab7c1 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -69,6 +69,7 @@ class MyObject extends CommonObject * 'position' is the sort order of field. * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'help' is a string visible as a tooltip on field * 'comment' is not used. You can store here any text of your choice. */ @@ -81,7 +82,7 @@ class MyObject extends CommonObject 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'index'=>1, 'position'=>20), 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1), - 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1), + 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Amount'), 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000), 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), From 2ab12f54ff33beee452e3881230df751cb969e43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2017 22:42:14 +0200 Subject: [PATCH 0226/1137] Fix install error due to too large column with index --- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 1 + htdocs/install/mysql/tables/llx_holiday_config.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index b1a7088062d..f6a2c18da82 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -24,6 +24,7 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_holiday_config.sql b/htdocs/install/mysql/tables/llx_holiday_config.sql index 2f08bf5aa41..d5989747778 100644 --- a/htdocs/install/mysql/tables/llx_holiday_config.sql +++ b/htdocs/install/mysql/tables/llx_holiday_config.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_holiday_config ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, -name VARCHAR( 255 ) NOT NULL UNIQUE, +name VARCHAR(128) NOT NULL UNIQUE, value TEXT NULL ) ENGINE=innodb; \ No newline at end of file From 84fcbb724e24b37b5a9d3cbdb9d28979efa70cea Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 1 Sep 2017 07:21:27 +0200 Subject: [PATCH 0227/1137] Add project on various_payment --- .../bank/class/paymentvarious.class.php | 67 ++++++++++++++- htdocs/compta/bank/various_payment/card.php | 84 +++++++++++++++++-- htdocs/compta/bank/various_payment/index.php | 2 +- htdocs/langs/en_US/banks.lang | 3 +- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/element.php | 24 +++++- 6 files changed, 165 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 1d0568c8064..45ae8d5dd95 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -30,8 +30,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class PaymentVarious extends CommonObject { - //public $element='payment_various'; //!< Id that identify managed objects - //public $table_element='payment_various'; //!< Name of table without prefix where object is stored + public $element='variouspayment'; //!< Id that identify managed objects + public $table_element='payment_various'; //!< Name of table without prefix where object is stored + public $picto = 'bill'; var $tms; var $datep; @@ -42,6 +43,7 @@ class PaymentVarious extends CommonObject var $num_payment; var $label; var $accountancy_code; + var $fk_project; var $fk_bank; var $fk_user_author; var $fk_user_modif; @@ -96,6 +98,7 @@ class PaymentVarious extends CommonObject $sql.= " label='".$this->db->escape($this->label)."',"; $sql.= " note='".$this->db->escape($this->note)."',"; $sql.= " accountancy_code='".$this->db->escape($this->accountancy_code)."',"; + $sql.= " fk_projet='".$this->db->escape($this->fk_project)."',"; $sql.= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank:"null").","; $sql.= " fk_user_author=".$this->fk_user_author.","; $sql.= " fk_user_modif=".$this->fk_user_modif; @@ -154,6 +157,7 @@ class PaymentVarious extends CommonObject $sql.= " v.label,"; $sql.= " v.note,"; $sql.= " v.accountancy_code,"; + $sql.= " v.fk_projet as fk_project,"; $sql.= " v.fk_bank,"; $sql.= " v.fk_user_author,"; $sql.= " v.fk_user_modif,"; @@ -185,6 +189,7 @@ class PaymentVarious extends CommonObject $this->label = $obj->label; $this->note = $obj->note; $this->accountancy_code = $obj->accountancy_code; + $this->fk_project = $obj->fk_project; $this->fk_bank = $obj->fk_bank; $this->fk_user_author = $obj->fk_user_author; $this->fk_user_modif = $obj->fk_user_modif; @@ -317,6 +322,7 @@ class PaymentVarious extends CommonObject if ($this->note) $sql.= ", note"; $sql.= ", label"; $sql.= ", accountancy_code"; + $sql.= ", fk_projet"; $sql.= ", fk_user_author"; $sql.= ", datec"; $sql.= ", fk_bank"; @@ -451,6 +457,63 @@ class PaymentVarious extends CommonObject } + /** + * Retourne le libelle du statut + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Libelle + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $statut Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Libelle + */ + function LibStatut($statut,$mode=0) + { + global $langs; + + if ($mode == 0) + { + return $langs->trans($this->statuts[$statut]); + } + if ($mode == 1) + { + return $langs->trans($this->statuts_short[$statut]); + } + if ($mode == 2) + { + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); + } + if ($mode == 3) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + } + if ($mode == 4) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); + } + if ($mode == 5) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==2 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + } + } + + /** * Send name clicable (with possibly the picto) * diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index e16c822db9b..4c57ab5f324 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -29,6 +29,11 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} $langs->loadLangs(array("compta", "banks", "bills", "users", "accountancy")); @@ -44,6 +49,7 @@ $sens=GETPOST("sens","int"); $amount=GETPOST("amount"); $paymenttype=GETPOST("paymenttype"); $accountancy_code=GETPOST("accountancy_code","int"); +$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); // Security check $socid = GETPOST("socid","int"); @@ -67,6 +73,13 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + // Link to a project + if ($action == 'classin' && $user->rights->banque->modifier) + { + $object->fetch($id); + $object->setProject(GETPOST('projectid')); + } + if ($cancel) { if ($action != 'addlink') @@ -98,6 +111,7 @@ if (empty($reshook)) $object->fk_user_author=$user->id; $object->accountancy_code=GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code","int") : ""; $object->sens=GETPOST('sens'); + $object->fk_project= GETPOST('fk_project'); if (empty($datep) || empty($datev)) { @@ -205,6 +219,7 @@ llxHeader("",$langs->trans("VariousPayment")); $form = new Form($db); if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db); if ($id) { @@ -306,6 +321,21 @@ if ($action == 'create') print ''; } + // Project + if (! empty($conf->projet->enabled)) + { + $formproject=new FormProjets($db); + + // Associated project + $langs->load("projects"); + + print ''.$langs->trans("Project").''; + + $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1); + + print ''; + } + // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -333,19 +363,52 @@ if ($action == 'create') if ($id) { - $head=various_payment_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("VariousPayment"), 0, 'payment'); - - print ''; + dol_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, 'payment'); + $morehtmlref='
        '; + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.=$langs->trans('Project') . ' '; + if ($user->rights->tax->charges->creer) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.=''; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.='
        '; $linkback = ''.$langs->trans("BackToList").''; - print ""; - print ''; + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright); + + print '
        '; + print '
        '; + + print '
        '.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', ''); - print '
        '; // Label print ''; @@ -404,6 +467,11 @@ if ($id) print '
        '.$langs->trans("Label").''.$object->label.'
        '; + print '
        '; + print '
        '; + + print '
        '; + dol_fiche_end(); diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 42558d11635..48f37d24235 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -243,7 +243,7 @@ if ($result) $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($obj->accountancy_journal); - $accountstatic->accountancy_journal = $accountingjournal->code; + $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); } $accountstatic->label=$obj->blabel; diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 46222fca80c..d261fe8a53d 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -156,4 +156,5 @@ DocumentModelBan=Template to print a page with BAN information. NewVariousPayment=New miscellaneous payments VariousPayment=Miscellaneous payments VariousPayments=Miscellaneous payments -ShowVariousPayment=Show miscellaneous payments +ShowVariousPayment=Show miscellaneous payments +AddVariousPayment=Add miscellaneous payments \ No newline at end of file diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 8b380645f73..92282fd29f0 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -88,6 +88,7 @@ ListShippingAssociatedProject=List of shippings associated with the project ListFichinterAssociatedProject=List of interventions associated with the project ListExpenseReportsAssociatedProject=List of expense reports associated with the project ListDonationsAssociatedProject=List of donations associated with the project +ListVariousPaymentsAssociatedProject=List of various payments associated with the project ListActionsAssociatedProject=List of events associated with the project ListTaskTimeUserProject=List of time consumed on tasks of project ActivityOnProjectToday=Activity on project today diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bda8d793840..0dcb710cfb5 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -51,6 +51,7 @@ if (! empty($conf->don->enabled)) require_once DOL_DOCUMENT_ROOT.'/don/class/d if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; $langs->load("projects"); $langs->load("companies"); @@ -439,6 +440,19 @@ $listofreferent=array( 'datefieldname'=>'datem', 'disableamount'=>0, 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))), +'variouspayment'=>array( + 'name'=>"VariousPayments", + 'title'=>"ListVariousPaymentsAssociatedProject", + 'class'=>'PaymentVarious', + 'table'=>'payment_various', + 'datefieldname'=>'datev', + 'margin'=>'minus', + 'disableamount'=>0, + 'urlnew'=>DOL_URL_ROOT.'/compta/bank_various_payment/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'lang'=>'banks', + 'buttonnew'=>'AddVariousPayment', + 'testnew'=>$user->rights->banque->modifier, + 'test'=>$conf->banque->enabled && $user->rights->banque->lire), /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", @@ -769,6 +783,7 @@ foreach ($listofreferent as $key => $value) // Thirdparty or user print ''; if (in_array($tablename, array('projet_task')) && $key == 'project_task') print ''; // if $key == 'project_task', we don't want details per user + elseif (in_array($tablename, array('payment_various'))) print ''; // if $key == 'payment_various', we don't have any thirdparty elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; @@ -898,7 +913,8 @@ foreach ($listofreferent as $key => $value) $date=''; $total_time_by_line = null; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif ($tablename == 'stock_mouvement') $date = $element->datem; - if ($tablename == 'chargesociales') $date = $element->date_ech; + elseif ($tablename == 'payment_various') $date = $element->datev; + elseif ($tablename == 'chargesociales') $date = $element->date_ech; elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) { if ($tablename == 'don') $date = $element->datedon; @@ -909,7 +925,7 @@ foreach ($listofreferent as $key => $value) elseif ($tablename == 'supplier_proposal') $date=$element->date_validation; // There is no other date for this elseif ($tablename == 'fichinter') $date=$element->datev; // There is no other date for this elseif ($tablename == 'projet_task') $date=''; // We show no date. Showing date of beginning of task make user think it is date of time consumed - else + else { $date=$element->date; // invoice, ... if (empty($date)) $date=$element->date_contrat; @@ -963,7 +979,7 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_line=null; $othermessage=''; - if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ht_by_line=$element->amount; else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); elseif (in_array($tablename, array('projet_task'))) @@ -1004,7 +1020,7 @@ foreach ($listofreferent as $key => $value) if (empty($value['disableamount'])) { $total_ttc_by_line=null; - if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ttc_by_line=$element->amount; else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') From be63eb8cef9b1f37f98cf0adb09af638f957c1b8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 1 Sep 2017 07:34:01 +0200 Subject: [PATCH 0228/1137] Fix : missing language key "Events" everywhere --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b8544ee3eda..d5cbd14c11d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -794,6 +794,7 @@ TitleSetToDraft=Go back to draft ConfirmSetToDraft=Are you sure you want to go back to Draft status ? ImportId=Import id Websites=Web sites +Events=Events # Week day Monday=Monday Tuesday=Tuesday From d9008cd3021cce01ab8ad4ac012bf9731f225740 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Sep 2017 08:20:33 +0200 Subject: [PATCH 0229/1137] Fix: missing $dolibarrdataroot value --- htdocs/admin/modules.php | 184 +++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 94 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index a59d6fca3bb..6b290ab8f07 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -843,115 +843,111 @@ if ($mode == 'marketplace') if ($mode == 'deploy') { - dol_fiche_head($head, $mode, '', -1); + dol_fiche_head($head, $mode, '', -1); + $dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT); + $allowonlineinstall=true; + $allowfromweb=1; + if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; - $allowonlineinstall=true; - $allowfromweb=1; - if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; + $fullurl=''.$urldolibarrmodules.''; + $message=''; + if (! empty($allowonlineinstall)) + { + if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) + { + $message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); + $allowfromweb=-1; + } + else + { + if ($dirins_ok) + { + if (! is_writable(dol_osencode($dirins))) + { + $langs->load("errors"); + $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); + $allowfromweb=0; + } + } + else + { + $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); + $allowfromweb=0; + } + } + } + else + { + $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); + $allowfromweb=0; + } - $fullurl=''.$urldolibarrmodules.''; - $message=''; - if (! empty($allowonlineinstall)) - { - if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) - { - $message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); - $allowfromweb=-1; - } - else - { - if ($dirins_ok) - { - if (! is_writable(dol_osencode($dirins))) - { - $langs->load("errors"); - $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); - $allowfromweb=0; - } - } - else - { + if ($allowfromweb < 1) + { + print $langs->trans("SomethingMakeInstallFromWebNotPossible"); + print $message; + //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); + print '
        '; + } - $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); - $allowfromweb=0; - } - } - } - else - { - $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); - $allowfromweb=0; - } + print '
        '; - if ($allowfromweb < 1) - { - print $langs->trans("SomethingMakeInstallFromWebNotPossible"); - print $message; - //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); - print '
        '; - } + if ($allowfromweb >= 0) + { + if ($allowfromweb == 1) + { + //print $langs->trans("ThisIsProcessToFollow").'
        '; + } + else + { + print $langs->trans("ThisIsAlternativeProcessToFollow").'
        '; + print ''.$langs->trans("StepNb",1).': '; + print $langs->trans("FindPackageFromWebSite",$fullurl).'
        '; + print ''.$langs->trans("StepNb",2).': '; + print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
        '; + print ''.$langs->trans("StepNb",3).': '; + } - print '
        '; + if ($allowfromweb == 1) + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
        '; - if ($allowfromweb >= 0) - { - if ($allowfromweb == 1) - { - //print $langs->trans("ThisIsProcessToFollow").'
        '; - } - else - { - print $langs->trans("ThisIsAlternativeProcessToFollow").'
        '; - print ''.$langs->trans("StepNb",1).': '; - print $langs->trans("FindPackageFromWebSite",$fullurl).'
        '; - print ''.$langs->trans("StepNb",2).': '; - print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
        '; - print ''.$langs->trans("StepNb",3).': '; - } + print '
        '; - if ($allowfromweb == 1) - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
        '; + print '
        '; + print ''; + print ''; + print $langs->trans("YouCanSubmitFile").' '; + print ''; + print '
        '; - print '
        '; + print '
        '; + print '
        '; - print '
        '; - print ''; - print ''; - print $langs->trans("YouCanSubmitFile").' '; - print ''; - print '
        '; + print '
        '; + } + else + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
        '; + print ''.$langs->trans("StepNb",4).': '; + print $langs->trans("SetupIsReadyForUse").'
        '; + } + } - print '
        '; - print '
        '; + if (! empty($result['return'])) + { + print '
        '; - print '
        '; - } - else - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
        '; - print ''.$langs->trans("StepNb",4).': '; - print $langs->trans("SetupIsReadyForUse").'
        '; - } - } + foreach($result['return'] as $value) + { + echo $value.'
        '; + } + } - - if (! empty($result['return'])) - { - print '
        '; - - foreach($result['return'] as $value) - { - echo $value.'
        '; - } - } - - dol_fiche_end(); + dol_fiche_end(); } - - llxFooter(); $db->close(); From 1a956cce9a1524a9fb502a72cda8b2e2c3841952 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Sep 2017 10:31:22 +0200 Subject: [PATCH 0230/1137] Fix : insert line extrafield --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4b6c1263026..bd1f6198a95 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4156,6 +4156,10 @@ abstract class CommonObject foreach($this->array_options as $key => $value) { $attributeKey = substr($key,8); // Remove 'options_' prefix + + // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them + if(empty($extrafields->attribute_type[$attributeKey])) continue; + $attributeType = $extrafields->attribute_type[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey]; $attributeParam = $extrafields->attribute_param[$attributeKey]; From cf49c274a642c721ef6074127ba8369f95e2363b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Sep 2017 10:38:50 +0200 Subject: [PATCH 0231/1137] Better fix --- htdocs/core/class/commonobject.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bd1f6198a95..fed6ef1df3d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4156,9 +4156,12 @@ abstract class CommonObject foreach($this->array_options as $key => $value) { $attributeKey = substr($key,8); // Remove 'options_' prefix - - // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them - if(empty($extrafields->attribute_type[$attributeKey])) continue; + + // array_option may contain extrafields from an origin object that doesn't exist in current object, we should not try to insert them + if(empty($extrafields->attribute_type[$attributeKey])) { + unset($this->array_options[$key]); + continue; + } $attributeType = $extrafields->attribute_type[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey]; From 1da71d48cd415a6abd48cbf53d494f8c9eab1f81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 11:10:03 +0200 Subject: [PATCH 0232/1137] Work on export site --- htdocs/core/lib/website.lib.php | 93 +++++++++++++++++++++++++ htdocs/websites/class/website.class.php | 3 +- htdocs/websites/index.php | 16 +++++ 3 files changed, 111 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 4396b5a862c..122c3a6aa7d 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -184,3 +184,96 @@ function dolIncludeHtmlContent($contentfile) $includehtmlcontentopened--; } +/** + * Generate a zip with all data of web site. + * + * @param Website $website Object website + * @return void + */ +function exportWebSite($website) +{ + global $db, $conf; + + dol_mkdir($conf->websites->dir_temp); + $srcdir = $conf->websites->dir_output.'/'.$website->ref; + $destdir = $conf->websites->dir_temp.'/'.$website->ref; + + $arrayreplacement=array(); + + dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacement); + + $srcdir = DOL_DATA_ROOT.'/medias/images/'.$website->ref; + $destdir = $conf->websites->dir_temp.'/'.$website->ref.'/medias/images/'.$website->ref; + + dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacement); + + // Build sql file + dol_mkdir($conf->websites->dir_temp.'/'.$website->ref.'/export'); + + $filesql = $conf->websites->dir_temp.'/'.$website->ref.'/export/pages.sql'; + $fp = fopen($filesql,"w"); + + $objectpages = new WebsitePage($db); + $listofpages = $objectpages->fetchAll($website->id); + + // Assign ->newid and ->newfk_page + $i=1; + foreach($listofpages as $pageid => $objectpageold) + { + $objectpageold->newid=$i; + $i++; + } + $i=1; + foreach($listofpages as $pageid => $objectpageold) + { + // Search newid + $newfk_page=0; + foreach($listofpages as $pageid2 => $objectpageold2) + { + if ($pageid2 == $objectpageold->fk_page) + { + $newfk_page = $objectpageold2->newid; + break; + } + } + $objectpageold->newfk_page=$newfk_page; + $i++; + } + foreach($listofpages as $pageid => $objectpageold) + { + $line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, title, description, keyword, status, date_creation, tms, lang, import_key, grabbed_from, content)'; + $line.= " VALUES("; + $line.= $objectpageold->newid."+__MAXROWID__, "; + $line.= ($objectpageold->newfk_page ? $db->escape($objectpageold->newfk_page)."+__MAXROWID__" : "null").", "; + $line.= "__WEBSITE_ID__, "; + $line.= "'".$db->escape($objectpageold->pageurl)."', "; + $line.= "'".$db->escape($objectpageold->title)."', "; + $line.= "'".$db->escape($objectpageold->description)."', "; + $line.= "'".$db->escape($objectpageold->keyword)."', "; + $line.= "'".$db->escape($objectpageold->status)."', "; + $line.= "'".$db->idate($objectpageold->date_creation)."', "; + $line.= "'".$db->idate($objectpageold->date_modification)."', "; + $line.= "'".$db->escape($objectpageold->lang)."', "; + $line.= ($objectpageold->import_key ? "'".$db->escape($objectpageold->import_key)."'" : "null").", "; + $line.= "'".$db->escape($objectpageold->grabbed_from)."', "; + $line.= "'".$db->escape($objectpageold->content)."'"; + $line.= ");"; + $line.= "\n"; + fputs($fp, $line); + } + + fclose($fp); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filesql, octdec($conf->global->MAIN_UMASK)); + + // Build zip file + $filedir = $conf->websites->dir_temp.'/'.$website->ref; + $fileglob = $conf->websites->dir_temp.'/'.$website->ref.'/export/'.$website->ref.'_export_*.zip'; + $filename = $conf->websites->dir_temp.'/'.$website->ref.'/export/'.$website->ref.'_export_'.dol_print_date(dol_now(),'dayhourlog').'.zip'; + + dol_delete_file($fileglob, 0); + dol_compress_file($filedir, $filename, 'zip'); + + return $filename; +} + diff --git a/htdocs/websites/class/website.class.php b/htdocs/websites/class/website.class.php index 28e54fad1af..2fd86208934 100644 --- a/htdocs/websites/class/website.class.php +++ b/htdocs/websites/class/website.class.php @@ -480,7 +480,8 @@ class Website extends CommonObject } /** - * Load an object from its id and create a new one in database + * Load an object from its id and create a new one in database. + * This copy website directories, regenerate all the pages + alias pages and recreate the medias link. * * @param User $user User making the clone * @param int $fromid Id of object to clone diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 1d0bda1ec04..85752a3158f 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -783,6 +783,21 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf } } +// Export site +if (GETPOST('exportsite')) +{ + $fileofzip = exportWebSite($object); + + $file_name = basename($yourfile); + + header("Content-Type: application/zip"); + header("Content-Disposition: attachment; filename=".$file_name); + header("Content-Length: " . filesize($yourfile)); + + readfile($fileofzip); + exit; +} + /* @@ -894,6 +909,7 @@ if (count($object->records) > 0) print ''; print ''; print ''; + print ''; print '   '; From 9a0576ff79bc5108dd39ecea66f797334e7eab70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 12:19:55 +0200 Subject: [PATCH 0233/1137] Enhance website module --- htdocs/langs/en_US/website.lang | 2 + htdocs/websites/index.php | 149 ++++++++++++++++++++++++++++++-- 2 files changed, 144 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 816dae7e4a2..ebbcadaf944 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -18,6 +18,7 @@ EditPageMeta=Edit Meta EditPageSource=Edit HTML Source EditPageContent=Edit with CKEditor Website=Web site +AddWebsite=Add website Webpage=Web page/container AddPage=Add page/container HomePage=Home Page @@ -49,3 +50,4 @@ WebsiteId=Website ID CreateByFetchingExternalPage=Create page/container by fetching page from external URL... OrEnterPageInfoManually=Or create empty page from scratch... FetchAndCreate=Fetch and Create +ExportSite=Export site diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 85752a3158f..c48e81c9e03 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -96,6 +96,7 @@ $action=GETPOST('action','alpha'); if (GETPOST('delete')) { $action='delete'; } if (GETPOST('preview')) $action='preview'; +if (GETPOST('createsite')) { $action='createsite'; } if (GETPOST('create')) { $action='create'; } if (GETPOST('editmedias')) { $action='editmedias'; } if (GETPOST('editcss')) { $action='editcss'; } @@ -155,9 +156,67 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain * Actions */ -if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid. +if (GETPOST('refreshsite')) // If we change the site, we reset the pageid and cancel addsite action. +{ + $pageid=0; + if ($action == 'addsite') $action = 'preview'; +} if (GETPOST('refreshpage') && ! in_array($action, array('updatecss'))) $action='preview'; + +// Add site +if ($action == 'addsite') +{ + $db->begin(); + + if (! $error && empty(GETPOST('WEBSITE_REF','alpha'))) + { + $error++; + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); + } + if (! $error && ! preg_match('/^[a-z0-9_\-\.]+$/i', GETPOST('WEBSITE_REF','alpha'))) + { + $error++; + setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities("Ref")), null, 'errors'); + } + + if (! $error) + { + $tmpobject=new Website($db); + $tmpobject->ref = GETPOST('WEBSITE_REF','alpha'); + $tmpobject->description = GETPOST('WEBSITE_DESCRIPTION','alpha'); + $tmpobject->virtualhost = GETPOST('WEBSITE_VIRTUALHOST','alpha'); + + $result = $tmpobject->create($user); + if ($result <= 0) + { + $error++; + setEventMessages($tmpobject->error, $tmpobject->errors, 'errors'); + } + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SiteAdded", $object->ref), null, 'mesgs'); + $action=''; + + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$tmpobject->ref); + exit; + } + else + { + $db->rollback(); + $action='createsite'; + } + + if (! $error) + { + $action = 'preview'; + $id = $object->id; + } +} + // Add page if ($action == 'add') { @@ -820,6 +879,10 @@ llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, 0, print "\n".'
        '; print ''; +if ($action == 'createsite') +{ + print ''; +} if ($action == 'create') { print ''; @@ -865,6 +928,10 @@ if (count($object->records) > 0) { // ***** Part for web sites + print '
        '; + print ''; + print '
        '; + print '
        '; print $langs->trans("Website").': '; print '
        '; @@ -907,7 +974,7 @@ if (count($object->records) > 0) print '   '; print ''; - print ''; + //print ''; print ''; print ''; @@ -963,7 +1030,7 @@ if (count($object->records) > 0) print '
        '; - print '
        '; + print '
        '; print ''; print '
        '; @@ -1091,7 +1158,7 @@ if (count($object->records) > 0) // TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext } - if (! in_array($action, array('editcss','editmenu','editmedias','create','createpagefromclone'))) + if (! in_array($action, array('editcss','editmenu','editmedias','createsite','create','createpagefromclone'))) { if (preg_match('/^create/',$action)) print ''; if (preg_match('/^edit/',$action)) print ''; @@ -1268,13 +1335,80 @@ if ($action == 'editcss') print '
        '; } +if ($action == 'createsite') +{ + print '
        '; + + print '
        '; + + /*$h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath('/websites/index.php',1).'?id='.$object->id; + $head[$h][1] = $langs->trans("AddSite"); + $head[$h][2] = 'card'; + $h++; + + dol_fiche_head($head, 'card', $langs->trans("AddSite"), -1, 'globe'); + */ + if ($action == 'create') print_fiche_titre($langs->trans("AddSite")); + + print ''."\n"; + //print '
        '; + + print ''; + + if (GETPOST('WEBSITE_REF')) $siteref=GETPOST('WEBSITE_REF','alpha'); + if (GETPOST('WEBSITE_DESCRIPTION')) $sitedesc=GETPOST('WEBSITE_DESCRIPTION','alpha'); + + print ''; + + print ''; + + print ''; + + + print '
        '; + print $langs->trans('Ref'); + print ''; + print ''; + print '
        '; + print $langs->trans('Description'); + print ''; + print ''; + print '
        '; + print $form->textwithpicto($langs->trans('Virtualhost'), $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/websites/websiteref'), 1, 'help', '', 0, 2, 'tooltipvirtual'); + print ''; + print ''; + print '
        '; + + if ($action == 'createsite') + { + print '
        '; + + print ''; + print ''; + + print '
        '; + } + + + //print '
        '; + + //dol_fiche_end(); + + print '
        '; + + print '
        '; +} + if ($action == 'editmeta' || $action == 'create') { print '
        '; print '
        '; - $h = 0; + /*$h = 0; $head = array(); $head[$h][0] = dol_buildpath('/websites/index.php',1).'?id='.$object->id; @@ -1282,10 +1416,11 @@ if ($action == 'editmeta' || $action == 'create') $head[$h][2] = 'card'; $h++; - //dol_fiche_head($head, 'card', $langs->trans("AddPage"), -1, 'globe'); + dol_fiche_head($head, 'card', $langs->trans("AddPage"), -1, 'globe'); + */ if ($action == 'create') print_fiche_titre($langs->trans("AddPage")); - print ''."\n"; + print ''."\n"; //print '
        '; if ($action == 'create') From 61cf69f2bb769238e7028673b6b14383e403d5a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 13:09:13 +0200 Subject: [PATCH 0234/1137] NEW Include a color syntaxed HTML editor for emailing edition. --- htdocs/comm/mailing/card.php | 50 +++++++++++++++++++-------- htdocs/core/class/doleditor.class.php | 31 +++++++++-------- htdocs/langs/en_US/main.lang | 2 ++ htdocs/langs/en_US/website.lang | 2 -- htdocs/websites/index.php | 14 ++++---- 5 files changed, 61 insertions(+), 38 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 14c8bf81510..86a5504d409 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -463,7 +463,7 @@ if (empty($reshook)) $object->email_errorsto = trim($_POST["errorsto"]); $object->titre = trim($_POST["titre"]); $object->sujet = trim($_POST["sujet"]); - $object->body = trim($_POST["body"]); + $object->body = trim($_POST["bodyemail"]); $object->bgcolor = trim($_POST["bgcolor"]); $object->bgimage = trim($_POST["bgimage"]); @@ -560,7 +560,7 @@ if (empty($reshook)) $mesgs = array(); $object->sujet = trim($_POST["sujet"]); - $object->body = trim($_POST["body"]); + $object->body = trim($_POST["bodyemail"]); $object->bgcolor = trim($_POST["bgcolor"]); $object->bgimage = trim($_POST["bgimage"]); @@ -686,7 +686,13 @@ $form = new Form($db); $htmlother = new FormOther($db); $help_url='EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; -llxHeader('',$langs->trans("Mailing"),$help_url); +llxHeader('', $langs->trans("Mailing"), $help_url, '', 0, 0, + array( + '/includes/ace/ace.js', + '/includes/ace/ext-statusbar.js', + '/includes/ace/ext-language_tools.js', + //'/includes/ace/ext-chromevox.js' + ), array()); if ($action == 'create') { @@ -740,7 +746,7 @@ if ($action == 'create') print '
        '; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('body',$_POST['body'],'',600,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%'); + $doleditor=new DolEditor('bodyemail',GETPOST('bodyemail','none'),'',600,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%'); $doleditor->Create(); print '
        '; @@ -780,7 +786,7 @@ else } - if ($action != 'edit') + if ($action != 'edit' && $action != 'edithtml') { dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); @@ -935,7 +941,9 @@ else if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer) { - print ''.$langs->trans("EditMailing").''; + print ''.$langs->trans("EditWithEditor").''; + + if (! empty($conf->use_javascript_ajax)) print ''.$langs->trans("EditHTMLSource").''; } //print ''.$langs->trans("PreviewMailing").''; @@ -1095,7 +1103,7 @@ else $readonly=1; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('body',$object->body,'',600,'dolibarr_mailings','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,120,$readonly); + $doleditor=new DolEditor('bodyemail',$object->body,'',600,'dolibarr_mailings','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,120,$readonly); $doleditor->Create(); } else print dol_htmlentitiesbr($object->body); @@ -1107,7 +1115,7 @@ else else { /* - * Mailing en mode edition + * Mailing en mode edition (CKeditor or HTML source) */ dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); @@ -1187,7 +1195,8 @@ else // Print mail content print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic'); - dol_fiche_head(); + + dol_fiche_head(null, '', '', -1); print ''; @@ -1203,6 +1212,7 @@ else print '
        '; // List of files $listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0); + // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript $out.= ''."\n"; $out.= ''; if ($showform) print "param["returnurl"]."\">\n"; - + print ''; foreach ($this->param as $key=>$value) { @@ -259,7 +259,7 @@ function limitChars(textarea, limit, infodiv) if (! empty($this->withtosocid) && $this->withtosocid > 0) { $liste=array(); - foreach ($soc->thirdparty_and_contact_phone_array() as $key=>$value) + foreach ($soc->thirdparty_and_contact_phone_array() as $key => $value) { $liste[$key]=$value; } @@ -323,8 +323,8 @@ function limitChars(textarea, limit, infodiv) print "
        \n"; - - if ($showform) + + if ($showform) { print '
        '; print ''; @@ -334,10 +334,10 @@ function limitChars(textarea, limit, infodiv) print ''; } print '
        '; - + print "\n"; } - + print "\n"; } From 2768878618587f0cc4caf08bac01b014d43275af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 16:37:45 +0200 Subject: [PATCH 0240/1137] FIX Bad condition on sms log debug --- htdocs/core/class/CSMSFile.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 4456df76f83..3bdd644ecc1 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -107,6 +107,7 @@ class CSMSFile if (empty($conf->global->MAIN_DISABLE_ALL_SMS)) { + // Action according to choosed sending method if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // Backward compatibility @deprecated { @@ -129,7 +130,7 @@ class CSMSFile { dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); //var_dump($res); // 1973128 - $this->dump_sms_result($res); + if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module' @@ -159,7 +160,7 @@ class CSMSFile { dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); //var_dump($res); // 1973128 - $this->dump_sms_result($res); + if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } catch(Exception $e) From 9443cb0c1baf322f0a9dc6491f897ec705de2014 Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Fri, 1 Sep 2017 15:53:06 +0100 Subject: [PATCH 0241/1137] NEW Added Region name to state/province form field --- htdocs/core/class/html.formcompany.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 131cdae3952..ef4a3cb739e 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -217,7 +217,7 @@ class FormCompany $out=''; // On recherche les departements/cantons/province active d'une region et pays actif - $sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code FROM"; + $sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM"; $sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c"; $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid"; $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1"; @@ -265,7 +265,15 @@ class FormCompany $out.= ''; } $i++; From 920d6270c33a1f9ec3af29bde14fcaae322a8b38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 16:54:06 +0200 Subject: [PATCH 0242/1137] Fix missing the nostop tag --- htdocs/core/class/CSMSFile.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 3bdd644ecc1..570cf6f9b6c 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -42,6 +42,7 @@ class CSMSFile var $priority; var $class; var $message; + var $nostop; /** @@ -81,6 +82,7 @@ class CSMSFile $this->priority=$priority; $this->class=$class; $this->message=$msg; + $this->nostop=false; } @@ -119,6 +121,7 @@ class CSMSFile $sms->deferred=$this->deferred; $sms->priority=$this->priority; $sms->class=$this->class; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); if ($res <= 0) @@ -148,6 +151,7 @@ class CSMSFile $sms->priority=$this->priority; $sms->class=$this->class; $sms->message=$this->message; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); $this->error = $sms->error; From 0fc8a0f84063bfa911a6f1103a238861852f6543 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Sep 2017 16:54:06 +0200 Subject: [PATCH 0243/1137] Fix: avoid warning "non-numeric value encountered" --- htdocs/projet/tasks.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 204b393cc6d..c00e93e239f 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * * 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 @@ -70,7 +70,9 @@ $hookmanager->initHooks(array('projecttaskcard','globalcard')); $progress=GETPOST('progress', 'int'); $label=GETPOST('label', 'alpha'); $description=GETPOST('description'); -$planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60; +$planned_workloadhour=(GETPOST('planned_workloadhour','int')?GETPOST('planned_workloadhour','int'):0); +$planned_workloadmin=(GETPOST('planned_workloadmin','int')?GETPOST('planned_workloadmin','int'):0); +$planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60; $userAccess=0; From 223e1b1cd4228e42cd63f97917b803ccae73cb1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 16:54:06 +0200 Subject: [PATCH 0244/1137] Fix missing the nostop tag --- htdocs/core/class/CSMSFile.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 3bdd644ecc1..570cf6f9b6c 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -42,6 +42,7 @@ class CSMSFile var $priority; var $class; var $message; + var $nostop; /** @@ -81,6 +82,7 @@ class CSMSFile $this->priority=$priority; $this->class=$class; $this->message=$msg; + $this->nostop=false; } @@ -119,6 +121,7 @@ class CSMSFile $sms->deferred=$this->deferred; $sms->priority=$this->priority; $sms->class=$this->class; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); if ($res <= 0) @@ -148,6 +151,7 @@ class CSMSFile $sms->priority=$this->priority; $sms->class=$this->class; $sms->message=$this->message; + $sms->nostop=$this->nostop; $res=$sms->SmsSend(); $this->error = $sms->error; From cd8362498f292b3a3e881e2f74cf10ce72a27d57 Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Fri, 1 Sep 2017 16:07:07 +0100 Subject: [PATCH 0245/1137] NEW Added regions to third party/societe lists, can be filtered --- htdocs/societe/list.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c7ede7c5e3f..00ff84d6bfe 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -7,6 +7,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2016 Josep Lluis Amador * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2017 Rui Strecht * * 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 @@ -63,6 +64,7 @@ $search_account_supplier_code=trim(GETPOST('search_account_supplier_code')); $search_town=trim(GETPOST("search_town")); $search_zip=trim(GETPOST("search_zip")); $search_state=trim(GETPOST("search_state")); +$search_region=trim(GETPOST("search_region")); $search_email=trim(GETPOST('search_email')); $search_phone=trim(GETPOST('search_phone')); $search_url=trim(GETPOST('search_url')); @@ -168,6 +170,7 @@ $arrayfields=array( 's.town'=>array('label'=>"Town", 'checked'=>1), 's.zip'=>array('label'=>"Zip", 'checked'=>1), 'state.nom'=>array('label'=>"State", 'checked'=>0), + 'region.nom'=>array('label'=>"Region", 'checked'=>0), 'country.code_iso'=>array('label'=>"Country", 'checked'=>0), 's.email'=>array('label'=>"Email", 'checked'=>0), 's.url'=>array('label'=>"Url", 'checked'=>0), @@ -387,7 +390,8 @@ $sql.= " s.email, s.phone, s.url, s.siren as idprof1, s.siret as idprof2, s.ape $sql.= " s.tms as date_update, s.datec as date_creation,"; $sql.= " s.code_compta,s.code_compta_fournisseur,"; $sql.= " typent.code as typent_code,"; -$sql.= " state.code_departement as state_code, state.nom as state_name"; +$sql.= " state.code_departement as state_code, state.nom as state_name,"; +$sql.= " region.code_region as region_code, region.nom as region_name"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We'll need these fields in order to filter by categ @@ -404,6 +408,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)"; // We'll need this table joined to the select in order to filter by categ if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ if (! empty($search_categ_sup)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ @@ -436,6 +441,7 @@ if ($search_account_supplier_code) $sql.= natural_search("s.code_compta_fourniss if ($search_town) $sql.= natural_search("s.town",$search_town); if (strlen($search_zip)) $sql.= natural_search("s.zip",$search_zip); if ($search_state) $sql.= natural_search("state.nom",$search_state); +if ($search_region) $sql.= natural_search("region.nom",$search_region); if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_email) $sql.= natural_search("s.email",$search_email); if (strlen($search_phone)) $sql.= natural_search("s.phone", $search_phone); @@ -728,6 +734,13 @@ if (! empty($arrayfields['state.nom']['checked'])) print ''; print ''; } +// Region +if (! empty($arrayfields['region.nom']['checked'])) +{ + print ''; + print ''; + print ''; +} // Country if (! empty($arrayfields['country.code_iso']['checked'])) { @@ -937,6 +950,7 @@ if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) print_liste_f if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],"s.town","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],"s.zip","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'],$_SERVER["PHP_SELF"],"s.email","",$param,'',$sortfield,$sortorder); @@ -1068,6 +1082,12 @@ while ($i < min($num, $limit)) print "".$obj->state_name."\n"; if (! $i) $totalarray['nbfield']++; } + // Region + if (! empty($arrayfields['region.nom']['checked'])) + { + print "".$obj->region_name."\n"; + if (! $i) $totalarray['nbfield']++; + } // Country if (! empty($arrayfields['country.code_iso']['checked'])) { From bda507d191c2541deeac1fc919975047b97395a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:07:26 +0200 Subject: [PATCH 0246/1137] Fix nostop option --- htdocs/core/class/CSMSFile.class.php | 1 + htdocs/core/class/html.formsms.class.php | 18 ++++++++++++------ htdocs/langs/en_US/sms.lang | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 570cf6f9b6c..0a149feabf4 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -212,6 +212,7 @@ class CSMSFile fputs($fp, "Priority: ".$this->priority."\n"); fputs($fp, "Class: ".$this->class."\n"); fputs($fp, "Deferred: ".$this->deferred."\n"); + fputs($fp, "DisableStop: ".$this->nostop."\n"); fputs($fp, "Message:\n".$this->message); fclose($fp); diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index a3e2a0bb844..2015d4e47af 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -147,7 +147,7 @@ function limitChars(textarea, limit, infodiv) { if ($this->withfromreadonly) { - print ''.$langs->trans("SmsFrom"); + print ''.$langs->trans("SmsFrom"); print ''; print ""; if ($this->fromtype == 'user') @@ -223,7 +223,7 @@ function limitChars(textarea, limit, infodiv) if (is_array($resultsender) && count($resultsender) > 0) { - print ''; foreach($resultsender as $obj) { print ''; @@ -244,7 +244,7 @@ function limitChars(textarea, limit, infodiv) // To (target) if ($this->withto || is_array($this->withto)) { - print ''; + print ''; //$moretext=$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"); $moretext=''; print $form->textwithpicto($langs->trans("SmsTo"),$moretext); @@ -285,7 +285,7 @@ function limitChars(textarea, limit, infodiv) $defaultmessage=str_replace('\n',"\n",$defaultmessage); print ""; - print "".$langs->trans("SmsText").""; + print ''.$langs->trans("SmsText").""; print ""; if ($this->withbodyreadonly) { @@ -306,7 +306,7 @@ function limitChars(textarea, limit, infodiv) '.$langs->trans("Priority").' : - @@ -314,11 +314,17 @@ function limitChars(textarea, limit, infodiv) '.$langs->trans("Type").' : - + + + '.$langs->trans("DisableStopIfSupported").' : + '; print "\n"; diff --git a/htdocs/langs/en_US/sms.lang b/htdocs/langs/en_US/sms.lang index 8918aa6a365..05b521aae36 100644 --- a/htdocs/langs/en_US/sms.lang +++ b/htdocs/langs/en_US/sms.lang @@ -48,4 +48,4 @@ SmsInfoNumero= (format international ie : +33899701761) DelayBeforeSending=Delay before sending (minutes) SmsNoPossibleSenderFound=No sender available. Check setup of your SMS provider. SmsNoPossibleRecipientFound=No target available. Check setup of your SMS provider. - +DisableStopIfSupported=Disable STOP message (if supported) From 4660bc58fc80c5921373307f4d0b9a200aceadb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:07:26 +0200 Subject: [PATCH 0247/1137] Fix nostop option --- htdocs/core/class/CSMSFile.class.php | 1 + htdocs/core/class/html.formsms.class.php | 18 ++++++++++++------ htdocs/langs/en_US/sms.lang | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 570cf6f9b6c..0a149feabf4 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -212,6 +212,7 @@ class CSMSFile fputs($fp, "Priority: ".$this->priority."\n"); fputs($fp, "Class: ".$this->class."\n"); fputs($fp, "Deferred: ".$this->deferred."\n"); + fputs($fp, "DisableStop: ".$this->nostop."\n"); fputs($fp, "Message:\n".$this->message); fclose($fp); diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 9412582599d..4c64e04187a 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -147,7 +147,7 @@ function limitChars(textarea, limit, infodiv) { if ($this->withfromreadonly) { - print ''.$langs->trans("SmsFrom"); + print ''.$langs->trans("SmsFrom"); print ''; print ""; if ($this->fromtype == 'user') @@ -223,7 +223,7 @@ function limitChars(textarea, limit, infodiv) if (is_array($resultsender) && count($resultsender) > 0) { - print ''; foreach($resultsender as $obj) { print ''; @@ -244,7 +244,7 @@ function limitChars(textarea, limit, infodiv) // To (target) if ($this->withto || is_array($this->withto)) { - print ''; + print ''; //$moretext=$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"); $moretext=''; print $form->textwithpicto($langs->trans("SmsTo"),$moretext); @@ -285,7 +285,7 @@ function limitChars(textarea, limit, infodiv) $defaultmessage=str_replace('\n',"\n",$defaultmessage); print ""; - print "".$langs->trans("SmsText").""; + print ''.$langs->trans("SmsText").""; print ""; if ($this->withbodyreadonly) { @@ -306,7 +306,7 @@ function limitChars(textarea, limit, infodiv) '.$langs->trans("Priority").' : - @@ -314,11 +314,17 @@ function limitChars(textarea, limit, infodiv) '.$langs->trans("Type").' : - + + + '.$langs->trans("DisableStopIfSupported").' : + '; print "\n"; diff --git a/htdocs/langs/en_US/sms.lang b/htdocs/langs/en_US/sms.lang index 8918aa6a365..05b521aae36 100644 --- a/htdocs/langs/en_US/sms.lang +++ b/htdocs/langs/en_US/sms.lang @@ -48,4 +48,4 @@ SmsInfoNumero= (format international ie : +33899701761) DelayBeforeSending=Delay before sending (minutes) SmsNoPossibleSenderFound=No sender available. Check setup of your SMS provider. SmsNoPossibleRecipientFound=No target available. Check setup of your SMS provider. - +DisableStopIfSupported=Disable STOP message (if supported) From 1ee0077e4ee9b91a47285e495f6fb383b0b2078b Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Fri, 1 Sep 2017 16:10:19 +0100 Subject: [PATCH 0248/1137] Fix: Added name to contributors --- htdocs/core/class/html.formcompany.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ef4a3cb739e..6389733f72c 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2012 Laurent Destailleur * Copyright (C) 2008-2012 Regis Houssin * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2017 Rui Strecht * * 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 From 0d0b7f8af27d7f2a604e4d31cbfca15e04bc8538 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:18:07 +0200 Subject: [PATCH 0249/1137] Fix email --- htdocs/societe/tpl/linesalesrepresentative.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 34a7ce3f4c4..3ec07697ec7 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -32,6 +32,8 @@ $userstatic->firstname=$val['firstname']; $userstatic->statut=$val['statut']; $userstatic->photo=$val['photo']; + $userstatic->email=$val['email']; + $userstatic->entity=$val['entity']; print $userstatic->getNomUrl(-1); $i++; if ($i < $nbofsalesrepresentative) print ', '; From 9b51810653c212ca1d97e8cbd8f396fb01dbdef0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:30:09 +0200 Subject: [PATCH 0250/1137] Clean code --- htdocs/accountancy/admin/categories_list.php | 240 +------------------ htdocs/langs/en_US/accountancy.lang | 2 +- 2 files changed, 14 insertions(+), 228 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index fb3328c047d..d8f93ee1af5 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -100,7 +100,7 @@ $tablib[32]= "DictionaryAccountancyCategory"; // Requests to extract data $tabsql=array(); -$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -108,15 +108,15 @@ $tabsqlsort[32]="position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country"; +$tabfield[32]= "code,label,range_account,category_type,formula,position,country_id,country"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country"; +$tabfieldvalue[32]= "code,label,range_account,category_type,formula,position,country"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; +$tabfieldinsert[32]= "code,label,range_account,category_type,formula,position,fk_country"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on @@ -167,24 +167,15 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory if ($value == 'formula' && empty($_POST['formula'])) continue; - if ((! isset($_POST[$value]) || $_POST[$value]=='') - && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory - && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 - ) - ) + if (! isset($_POST[$value]) || $_POST[$value]=='') { $ok=0; $fieldnamekey=$listfield[$f]; // We take translate key of field if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; - if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments'; - if ($fieldnamekey == 'module') $fieldnamekey='Module'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; if ($fieldnamekey == 'note') $fieldnamekey = 'Note'; - if ($fieldnamekey == 'taux') $fieldnamekey = 'Rate'; if ($fieldnamekey == 'type') $fieldnamekey = 'Type'; if ($fieldnamekey == 'position') $fieldnamekey = 'Position'; if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated'; @@ -550,8 +541,7 @@ if ($id) if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); } if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); } if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } - if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } - if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Direction"); } + if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Comment"); } if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); } if ($valuetoshow != '') @@ -704,8 +694,7 @@ if ($id) if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); } if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); } - if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Direction"); } + if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Comment"); } if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); } // Affiche nom du champ if ($showfield) @@ -763,17 +752,9 @@ if ($id) $showfield=1; $align="left"; $valuetoshow=$obj->{$fieldlist[$field]}; - if ($value == 'type_template') + if ($value == 'category_type') { - $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; - } - if ($value == 'element') - { - $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; - } - else if ($value == 'source') - { - $valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow; + $valuetoshow = yn($valuetoshow); } else if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); @@ -789,12 +770,6 @@ if ($id) $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country); } } - else if ($fieldlist[$field]=='libelle_facture') { - $langs->load("bills"); - $key=$langs->trans("PaymentCondition".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - $valuetoshow=nl2br($valuetoshow); - } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') { $key=$langs->trans("Country".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); @@ -808,83 +783,11 @@ if ($id) $key=$langs->trans("Action".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') { - $key=$langs->trans("Currency".strtoupper($obj->code_iso)); - $valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') { - $key=$langs->trans(strtoupper($obj->code)); - $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') { - $key=$langs->trans(strtoupper($obj->code)); - $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') { - $key=$langs->trans("Civility".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { - $langs->load('agenda'); - $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { - $langs->load("bills"); - $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { - $langs->load("bills"); - $key=$langs->trans("PaymentType".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') { - $key=$langs->trans("DemandReasonType".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { - $langs->load("orders"); - $key=$langs->trans($obj->code); - $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]}; - } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { - $langs->load("sendings"); - $key=$langs->trans("SendingMethod".strtoupper($obj->code)); - $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format') - { - $key = $langs->trans('PaperFormat'.strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') - { - $langs->load('trips'); - $key = $langs->trans(strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } - else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); - $valuetoshow=$langs->trans($obj->{$fieldlist[$field]}); - } - else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); - $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); - } - else if (in_array($fieldlist[$field],array('recuperableonly'))) - { - $align="center"; - } - else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { - $valuetoshow = length_accountg($valuetoshow); - } $class='tddict'; - if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto'; // Show value for field if ($showfield) print ''.$valuetoshow.''; } @@ -1010,130 +913,14 @@ function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $contex print ''; } } - elseif ($fieldlist[$field] == 'region') - { - print ''; - $formcompany->select_region($region_id,'region'); + elseif ($fieldlist[$field] == 'category_type') { + print ''; + print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); print ''; } - elseif ($fieldlist[$field] == 'region_id') - { - $region_id = (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:0); - print ''; - print ''; - print ''; - } - elseif ($fieldlist[$field] == 'lang') - { - print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); - print ''; - } - // Le type de template - elseif ($fieldlist[$field] == 'type_template') - { - print ''; - print $form->selectarray('type_template', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - // Le type de l'element (pour les type de contact) - elseif ($fieldlist[$field] == 'element') - { - print ''; - print $form->selectarray('element', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - // La source de l'element (pour les type de contact) - elseif ($fieldlist[$field] == 'source') - { - print ''; - print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") - { - print ''; - print 'user'; - print ''; - } - elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { - if ($fieldlist[$field] == 'type_cdr') print ''; - else print ''; - if ($fieldlist[$field] == 'type_cdr') { - print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - } else { - print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); - } - print ''; - } - elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) { - $align="left"; - if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="center"; // Fields aligned on right - print ''; - print ''; - print ''; - } - elseif (in_array($fieldlist[$field], array('libelle_facture'))) { - print ''; - } - elseif (in_array($fieldlist[$field], array('content'))) - { - if ($tabname == MAIN_DB_PREFIX.'c_email_templates') - { - print ''; // To create an artificial CR for the current tr we are on - } - else print ''; - if ($context != 'hide') - { - //print ''; - $okforextended=true; - if ($tabname == MAIN_DB_PREFIX.'c_email_templates' && empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false; - $doleditor = new DolEditor($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_5, '90%'); - print $doleditor->Create(1); - } - else print ' '; - print ''; - } - elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { - print ''; - } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { print ''; } - elseif ($fieldlist[$field]=='unit') { - print ''; - $units = array( - 'mm' => $langs->trans('SizeUnitmm'), - 'cm' => $langs->trans('SizeUnitcm'), - 'point' => $langs->trans('SizeUnitpoint'), - 'inch' => $langs->trans('SizeUnitinch') - ); - print $form->selectarray('unit', $units, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 0, 0, 0); - print ''; - } - // Le type de taxe locale - elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type') - { - print ''; - print $form->selectarray($fieldlist[$field], $localtax_typeList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); - print ''; - } - elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') - { - print ''; - if (! empty($conf->accounting->enabled)) - { - $fieldname = $fieldlist[$field]; - $accountancy_account = (! empty($obj->$fieldname) ? $obj->$fieldname : 0); - print $formaccounting->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone'); - } - else - { - $fieldname = $fieldlist[$field]; - print ''; - } - print ''; - } else { print ''; @@ -1141,8 +928,7 @@ function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $contex if ($fieldlist[$field]=='code') $class='maxwidth100'; if ($fieldlist[$field]=='position') $class='maxwidth50'; if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" '; + if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='category_type') $size='size="2" '; print ''; print ''; } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 63a37bc921f..1362fd71b81 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -154,7 +154,7 @@ NumPiece=Piece number TransactionNumShort=Num. transaction AccountingCategory=Accounting account groups GroupByAccountAccounting=Group by accounting account -AccountingAccountGroupsDesc=You can define here some groups of accounting account. It will be used in the report %s to show your income/expense with data grouped according to your groups. +AccountingAccountGroupsDesc=You can define here some groups of accounting account. It will be used in the report %s to show your income/expense with data grouped according to these groups. ByAccounts=By accounts ByPredefinedAccountGroups=By predefined groups ByPersonalizedAccountGroups=By personalized groups From d71359b634bc0f934713e549a769361948ef3150 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 17:42:04 +0200 Subject: [PATCH 0251/1137] Update data --- htdocs/install/mysql/data/llx_accounting_category.sql | 2 +- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_category.sql b/htdocs/install/mysql/data/llx_accounting_category.sql index 776e0edf066..10b0ea07ae7 100644 --- a/htdocs/install/mysql/data/llx_accounting_category.sql +++ b/htdocs/install/mysql/data/llx_accounting_category.sql @@ -19,5 +19,5 @@ -- Group of accounting account for French result INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VTE', 'Income of products', '707xxx', 0, 0, '', '10', 1, 1); -INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'MAR', 'Expenses of products', '603xxx | 607xxx | 609xxx', 0, 0, '', '20', 1, 1); +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'MAR', 'Expenses of products', '603xxx - 607xxx - 609xxx', 0, 0, '', '20', 1, 1); INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'MARGE', 'Commercial margin', '', 0, 1, 'VTE+MAR', '30', 1, 1); \ No newline at end of file diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 1fcb5e7c089..a4b6af7917e 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -25,6 +25,10 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VTE', 'Income of products', '707xxx', 0, 0, '', '10', 1, 1); +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'MAR', 'Expenses of products', '603xxx - 607xxx - 609xxx', 0, 0, '', '20', 1, 1); +INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'MARGE', 'Commercial margin', '', 0, 1, 'VTE+MAR', '30', 1, 1); + UPDATE llx_c_accounting_category set formula = 'VTE+MAR' where code = 'MARGE'; ALTER TABLE llx_menu MODIFY COLUMN perms text; From 30eefb34aaf9f70de1ebe5ecaba56e67b56c1552 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 18:03:26 +0200 Subject: [PATCH 0252/1137] Fix payment suffix --- htdocs/public/payment/newpayment.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b6c525f1924..2519e4d0d46 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -62,24 +62,24 @@ $action=GETPOST('action','aZ09'); // tag (a free text, required if type is empty) // currency (iso code) -$suffix=GETPOST("suffix",'alpha'); -$amount=price2num(GETPOST("amount")); +$suffix=GETPOST("suffix",'aZ09'); +$amount=price2num(GETPOST("amount",'alpha')); if (! GETPOST("currency",'alpha')) $currency=$conf->currency; else $currency=GETPOST("currency",'alpha'); if (! $action) { - if (! GETPOST("amount") && ! GETPOST("source")) + if (! GETPOST("amount",'alpha') && ! GETPOST("source",'alpha')) { dol_print_error('',$langs->trans('ErrorBadParameters')." - amount or source"); exit; } - if (is_numeric($amount) && ! GETPOST("tag") && ! GETPOST("source")) + if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! GETPOST("source",'alpha')) { dol_print_error('',$langs->trans('ErrorBadParameters')." - tag or source"); exit; } - if (GETPOST("source") && ! GETPOST("ref")) + if (GETPOST("source",'alpha') && ! GETPOST("ref",'alpha')) { dol_print_error('',$langs->trans('ErrorBadParameters')." - ref"); exit; @@ -551,20 +551,21 @@ $width=0; // Define logo and logosmall $logosmall=$mysoc->logo_small; $logo=$mysoc->logo; -$paramlogo='PAYMENT_LOGO_'.$suffix; +$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix; if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; -else if (! empty($conf->global->PAYMENT_LOGO)) $logosmall=$conf->global->PAYMENT_LOGO; +else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO; //print ''."\n"; // Define urllogo $urllogo=''; if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $width=128; } elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); - $width=96; + $width=128; } // Output html code for logo if ($urllogo) From 796684713f6dedee7826d25b95251c715f9eac5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 18:49:55 +0200 Subject: [PATCH 0253/1137] Work on generic payment module --- htdocs/public/payment/newpayment.php | 15 ++++++++---- htdocs/public/payment/paymentko.php | 34 ++++++++++++++++++++++++++++ htdocs/public/payment/paymentok.php | 33 +++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 5 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 2519e4d0d46..005131e1d08 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -71,17 +71,17 @@ if (! $action) { if (! GETPOST("amount",'alpha') && ! GETPOST("source",'alpha')) { - dol_print_error('',$langs->trans('ErrorBadParameters')." - amount or source"); + print $langs->trans('ErrorBadParameters')." - amount or source"; exit; } if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! GETPOST("source",'alpha')) { - dol_print_error('',$langs->trans('ErrorBadParameters')." - tag or source"); + print $langs->trans('ErrorBadParameters')." - tag or source"; exit; } if (GETPOST("source",'alpha') && ! GETPOST("ref",'alpha')) { - dol_print_error('',$langs->trans('ErrorBadParameters')." - ref"); + print $langs->trans('ErrorBadParameters')." - ref"; exit; } } @@ -117,6 +117,11 @@ $FULLTAG=GETPOST("fulltag",'alpha'); // fulltag is tag with more informations $SECUREKEY=GETPOST("securekey"); // Secure key if ($paymentmethod && ! preg_match('/'.preg_quote('PM='.$paymentmethod,'/').'/', $FULLTAG)) $FULLTAG.=($FULLTAG?'.':'').'PM='.$paymentmethod; +if (! empty($suffix)) +{ + $urlok.='suffix='.urlencode($suffix).'&'; + $urlko.='suffix='.urlencode($suffix).'&'; +} if (! empty($SOURCE)) { $urlok.='source='.urlencode($SOURCE).'&'; @@ -560,12 +565,12 @@ $urllogo=''; if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); - $width=128; + $width=150; } elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); - $width=128; + $width=150; } // Output html code for logo if ($urllogo) diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index d4dea960b2f..c5eb9f7e698 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -70,6 +70,8 @@ if (! empty($conf->stripe->enabled)) $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); +$suffix=GETPOST("suffix",'aZ09'); + // Detect $paymentmethod $paymentmethod=''; @@ -202,6 +204,38 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online // Show ko message print ''."\n"; print '
        '."\n"; + + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +$width=0; +// Define logo and logosmall +$logosmall=$mysoc->logo_small; +$logo=$mysoc->logo; +$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix; +if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; +else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO; +//print ''."\n"; +// Define urllogo +$urllogo=''; +if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $width=150; +} +elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); + $width=150; +} +// Output html code for logo +if ($urllogo) +{ + print '
        '; + print '
        '; +} + print $langs->trans("YourPaymentHasNotBeenRecorded")."

        "; if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 4cb7dc0427c..ceda6a8c5a7 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -79,6 +79,8 @@ if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); $source=GETPOST('source'); $ref=GETPOST('ref'); +$suffix=GETPOST("suffix",'aZ09'); + // Detect $paymentmethod $paymentmethod=''; @@ -149,6 +151,37 @@ print ''."\n"; print '
        '."\n"; +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +$width=0; +// Define logo and logosmall +$logosmall=$mysoc->logo_small; +$logo=$mysoc->logo; +$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix; +if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo; +else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO; +//print ''."\n"; +// Define urllogo +$urllogo=''; +if (! empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('thumbs/'.$logosmall); + $width=150; +} +elseif (! empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($logo); + $width=150; +} +// Output html code for logo +if ($urllogo) +{ + print '
        '; + print '
        '; +} + + if (! empty($conf->paypal->enabled)) { if ($paymentmethod == 'paypal') From 1a5f96123abd75e066c7d1d9bd07f0b534df84de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 19:30:56 +0200 Subject: [PATCH 0254/1137] Work on generic payment module --- htdocs/public/payment/newpayment.php | 24 +++++++++++++----------- htdocs/theme/common/credit_card.png | Bin 0 -> 7676 bytes htdocs/theme/eldy/style.css.php | 11 +++++++++++ 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 htdocs/theme/common/credit_card.png diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 005131e1d08..faf0b5ea165 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1225,7 +1225,19 @@ if ($action != 'dopayment') { // Buttons for all payments registration methods - if (! empty($conf->paypal->enabled)) + if (! empty($conf->paybox->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox + print '
        '; + } + + if (! empty($conf->stripe->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe + print '
        '; + } + + if (! empty($conf->paypal->enabled)) { if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; @@ -1238,16 +1250,6 @@ if ($action != 'dopayment') print '
        '; } } - - if (! empty($conf->paybox->enabled)) - { - print '
        '; - } - - if (! empty($conf->stripe->enabled)) - { - print '
        '; - } } else { diff --git a/htdocs/theme/common/credit_card.png b/htdocs/theme/common/credit_card.png new file mode 100644 index 0000000000000000000000000000000000000000..1d2fc827f61763bf217699ed4fc145bdeb6de873 GIT binary patch literal 7676 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 + background-size: 24px; + background-repeat: no-repeat; + background-position: 5px 4px; +} +input.buttonpaymentcheque { + background-image: url(); + background-repeat: no-repeat; + background-position: 5px 4px; +} input.buttonpaymentpaypal { background-image: url(); background-repeat: no-repeat; From 55691bfbc2065f19ca2b676755ca266627c94976 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 19:30:56 +0200 Subject: [PATCH 0255/1137] Work on generic payment module --- htdocs/public/payment/newpayment.php | 24 +++++++++++++----------- htdocs/theme/common/credit_card.png | Bin 0 -> 7676 bytes htdocs/theme/eldy/style.css.php | 18 +++++++++++++++--- 3 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 htdocs/theme/common/credit_card.png diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 005131e1d08..faf0b5ea165 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1225,7 +1225,19 @@ if ($action != 'dopayment') { // Buttons for all payments registration methods - if (! empty($conf->paypal->enabled)) + if (! empty($conf->paybox->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox + print '
        '; + } + + if (! empty($conf->stripe->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe + print '
        '; + } + + if (! empty($conf->paypal->enabled)) { if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; @@ -1238,16 +1250,6 @@ if ($action != 'dopayment') print '
        '; } } - - if (! empty($conf->paybox->enabled)) - { - print '
        '; - } - - if (! empty($conf->stripe->enabled)) - { - print '
        '; - } } else { diff --git a/htdocs/theme/common/credit_card.png b/htdocs/theme/common/credit_card.png new file mode 100644 index 0000000000000000000000000000000000000000..1d2fc827f61763bf217699ed4fc145bdeb6de873 GIT binary patch literal 7676 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 + background-size: 26px; + background-repeat: no-repeat; + background-position: 5px 5px; +} +input.buttonpaymentcheque { + background-image: url(); + background-repeat: no-repeat; + background-position: 8px 7px; } input.buttonpaymentpaypal { background-image: url(); background-repeat: no-repeat; - background-position: 5px 4px; + background-position: 8px 7px; } input.buttonpaymentpaybox { background-image: url(); background-repeat: no-repeat; - background-position: 5px 4px; + background-position: 8px 7px; } input.buttonpaymentstripe { background-image: url(); background-repeat: no-repeat; - background-position: 5px 3px; + background-position: 8px 7px; } span.timesheetalreadyrecorded input { border: none; From 407febc14134f02b3efe44e1af5bf55293efd7c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 22:49:33 +0200 Subject: [PATCH 0256/1137] Fix travis --- htdocs/websites/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index f763c8dd39b..0d4763f5dc3 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -169,7 +169,7 @@ if ($action == 'addsite') { $db->begin(); - if (! $error && empty(GETPOST('WEBSITE_REF','alpha'))) + if (! $error && ! GETPOST('WEBSITE_REF','alpha')) { $error++; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); From 58b08c7de8a1c7e0bcd39cf542d3b381c364fe18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2017 23:56:59 +0200 Subject: [PATCH 0257/1137] Clean code --- htdocs/admin/dolistore/ajax/image.php | 2 +- .../admin/dolistore/class/dolistore.class.php | 268 +++++++++--------- htdocs/admin/dolistore/class/init.php | 2 +- htdocs/cashdesk/css/style.css | 4 - htdocs/cashdesk/javascript/dhtml.js | 16 +- htdocs/cashdesk/tpl/facturation1.tpl.php | 3 +- 6 files changed, 141 insertions(+), 154 deletions(-) diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index 10ce4656c40..6d63dd3e08b 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -42,7 +42,7 @@ if (!$res) die("Include of main fails"); global $lang, $user, $conf; -dol_include_once('/dolistore/class/dolistore.class.php'); +require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; $dolistore = new Dolistore(); $id_product = GETPOST('id_product', 'int'); diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 5e0aa546cc0..0c5a7f08568 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -19,9 +19,145 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class.php'; + + /** * Class DolistoreModel */ +class DolistoreModel +{ + + function get_categories($parent = 0) + { + if (!isset($this->categories)) die('not possible'); + if ($parent != 0) { + $html = '
          '; + } else { + $html = ''; + } + + $nbofcateg = count($this->categories); + for ($i = 0; $i < $nbofcateg; $i++) + { + $cat = $this->categories[$i]; + if ($cat->is_root_category == 1 && $parent == 0) { + $html .= '
        • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'

          '; + $html .= self::get_categories($cat->id); + $html .= "
        • \n"; + } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau + $select = ($cat->id == $this->categorie) ? ' selected' : ''; + $html .= '
        • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.''; + $html .= self::get_categories($cat->id); + $html .= "
        • \n"; + } else { + + } + } + + if ($html == '
            ') { + return ''; + } + if ($parent != 0) { + return $html.'
          '; + } else { + return $html; + } + } + + function get_products() + { + global $langs, $conf; + $html = ""; + $parity = "pair"; + $last_month = time() - (30 * 24 * 60 * 60); + foreach ($this->products as $product) { + $parity = ($parity == "impair") ? 'pair' : 'impair'; + + // check new product ? + $newapp = ''; + if ($last_month < strtotime($product->date_add)) { + $newapp .= ''.$langs->trans('New').' '; + } + + // check updated ? + if ($last_month < strtotime($product->date_upd) && $newapp == '') { + $newapp .= ''.$langs->trans('Updated').' '; + } + + // add image or default ? + if ($product->id_default_image != '') { + $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image; + $images = ''. + ''; + } else { + $images = ''; + } + + // free or pay ? + if ($product->price > 0) { + $price = '

          '.price(round((float) $product->price * $this->vat_rate, 2)).' €

          '; + $download_link = ''; + } else { + $price = $langs->trans('Free'); + $download_link = ''; + } + + //checking versions + if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { + if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { + //compatible + $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = ''; + } else { + //never compatible, module expired + $version = ''.$langs->trans('NotCompatible', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = 'NotCompatible'; + } + } else { + //need update + $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).''; + $compatible = 'NotCompatible'; + } + + //output template + $html .= ' +
          '.$newapp.$images.'
          +

          '.$product->name->language[$this->lang].'Details' + .'
          '.$version.'

          + '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

          '.$product->description_short->language[$this->lang].' + '.$product->description->language[$this->lang].' + '.$price.' + '.$download_link.' + '; + } + return $html; + } + + function get_previous_link($text = '<<') + { + return ''.$text.''; + } + + function get_next_link($text = '>>') + { + return ''.$text.''; + } +} + + + +/** + * Class Dolistore + */ class Dolistore extends DolistoreModel { // params @@ -182,135 +318,3 @@ class Dolistore extends DolistoreModel } } - -/** - * Class DolistoreModel - */ -class DolistoreModel -{ - - function get_categories($parent = 0) - { - if (!isset($this->categories)) die('not possible'); - if ($parent != 0) { - $html = '
            '; - } else { - $html = ''; - } - - $nbofcateg = count($this->categories); - for ($i = 0; $i < $nbofcateg; $i++) - { - $cat = $this->categories[$i]; - if ($cat->is_root_category == 1 && $parent == 0) { - $html .= '
          • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'

            '; - $html .= self::get_categories($cat->id); - $html .= "
          • \n"; - } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau - $select = ($cat->id == $this->categorie) ? ' selected' : ''; - $html .= '
          • '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.''; - $html .= self::get_categories($cat->id); - $html .= "
          • \n"; - } else { - - } - } - - if ($html == '
              ') { - return ''; - } - if ($parent != 0) { - return $html.'
            '; - } else { - return $html; - } - } - - function get_products() - { - global $langs, $conf; - $html = ""; - $parity = "pair"; - $last_month = time() - (30 * 24 * 60 * 60); - foreach ($this->products as $product) { - $parity = ($parity == "impair") ? 'pair' : 'impair'; - - // check new product ? - $newapp = ''; - if ($last_month < strtotime($product->date_add)) { - $newapp .= ''.$langs->trans('New').' '; - } - - // check updated ? - if ($last_month < strtotime($product->date_upd) && $newapp == '') { - $newapp .= ''.$langs->trans('Updated').' '; - } - - // add image or default ? - if ($product->id_default_image != '') { - $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image; - $images = ''. - ''; - } else { - $images = ''; - } - - // free or pay ? - if ($product->price > 0) { - $price = '

            '.price(round((float) $product->price * $this->vat_rate, 2)).' €

            '; - $download_link = ''; - } else { - $price = $langs->trans('Free'); - $download_link = ''; - } - - //checking versions - if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { - if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { - //compatible - $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max, - $product->dolibarr_min, $product->dolibarr_max).''; - $compatible = ''; - } else { - //never compatible, module expired - $version = ''.$langs->trans('NotCompatible', DOL_VERSION, - $product->dolibarr_min, $product->dolibarr_max).''; - $compatible = 'NotCompatible'; - } - } else { - //need update - $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, - $product->dolibarr_min, $product->dolibarr_max).''; - $compatible = 'NotCompatible'; - } - - //output template - $html .= ' -
            '.$newapp.$images.'
            -

            '.$product->name->language[$this->lang].'Details' - .'
            '.$version.'

            - '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'

            '.$product->description_short->language[$this->lang].' - '.$product->description->language[$this->lang].' - '.$price.' - '.$download_link.' - '; - } - return $html; - } - - function get_previous_link($text = '<<') - { - return ''.$text.''; - } - - function get_next_link($text = '>>') - { - return ''.$text.''; - } -} diff --git a/htdocs/admin/dolistore/class/init.php b/htdocs/admin/dolistore/class/init.php index df5773d9e7d..4a94e08002c 100644 --- a/htdocs/admin/dolistore/class/init.php +++ b/htdocs/admin/dolistore/class/init.php @@ -29,7 +29,7 @@ // Here we define constants /!\ You need to replace this parameters //https://dolistorecatalogpublickey1234567@vmdevwww.dolistore.com/api/ define('DEBUG', true); // Debug mode -define('PS_SHOP_PATH', 'http://vmdevwww.dolistore.com/'); // Root path of your PrestaShop store +define('PS_SHOP_PATH', 'https://www.dolistore.com/'); // Root path of your PrestaShop store define('PS_WS_AUTH_KEY', 'dolistorecatalogpublickey1234567'); // Auth key (Get it in your Back Office) require_once('./PSWebServiceLibrary.php'); // Here we make the WebService Call diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index c34e8596f01..d4149619aae 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -260,10 +260,6 @@ p.titre { padding: 0; } -.resultats_dhtml { - width: 400px; - position: absolute; -} /* --------------------- Combo lists ------------------- */ .select_design { diff --git a/htdocs/cashdesk/javascript/dhtml.js b/htdocs/cashdesk/javascript/dhtml.js index 7f5df55a767..db05855a3b2 100644 --- a/htdocs/cashdesk/javascript/dhtml.js +++ b/htdocs/cashdesk/javascript/dhtml.js @@ -51,26 +51,14 @@ function file(fichier) { } -// Affichage des donnees aTexte dans le bloc identifie par aId -function afficheDonnees(aId, aTexte) { - - document.getElementById(aId).innerHTML = aTexte; - -} - - // aCible : id du bloc de destination; aCode : argument a passer a la page php chargee du traitement et de l'affichage function verifResultat(aCible, aCode, iLimit) { if (aCode != '' && aCode.length >= iLimit) { if (texte = file('facturation_dhtml.php?code='+escape(aCode))) { - - afficheDonnees (aCible, texte); - + document.getElementById(aCible).innerHTML = texte; } else - - afficheDonnees (aCible, ''); - + document.getElementById(aCible).innerHTML = ''; } } diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 8cfe70638e3..3f0a0f4c371 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -45,8 +45,7 @@ $langs->load("cashdesk"); + onfocus="javascript: this.select();" /> Date: Sat, 2 Sep 2017 00:33:18 +0200 Subject: [PATCH 0258/1137] Fix double translation --- htdocs/compta/resultat/clientfourn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 195292e6471..927774e82d9 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Dourseanud @@ -197,7 +197,7 @@ if ($date_endyear) $param.='&date_endyear='.$date_startyear; print ''; print ''; print_liste_field_titre(''); -print_liste_field_titre($langs->trans("Groups"), $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder); +print_liste_field_titre("Groups", $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder); if ($modecompta == 'BOOKKEEPING') { print_liste_field_titre("Amount", $_SERVER["PHP_SELF"],'amount','',$param,'align="right"',$sortfield,$sortorder); From 7c722def0fad9e5b4d7d4fff491a04adcef53652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 01:28:19 +0200 Subject: [PATCH 0259/1137] FIX #7312 --- htdocs/margin/customerMargins.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 85f13a881ab..c83ca406347 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -180,26 +180,27 @@ $sql = "SELECT"; $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; -// Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) +// Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this) $sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; $sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; +if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; +if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; +if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " AND f.fk_statut > 0"; $sql.= ' AND s.entity IN ('.getEntity('societe').')'; $sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; -if ($client) - $sql.= " AND f.fk_soc = ".$socid; if (!empty($startdate)) - $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; +$sql.= " AND f.datef >= '".$db->idate($startdate)."'"; if (!empty($enddate)) - $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; +$sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) - $sql .= " AND d.buy_price_ht <> 0"; +$sql .= " AND d.buy_price_ht <> 0"; if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client"; $sql.=$db->order($sortfield,$sortorder); From 015bc51c43202ed9ba2cf53f5580580c4ddfecb3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 12:17:29 +0200 Subject: [PATCH 0260/1137] Fix regression adding a false error message --- htdocs/core/class/extrafields.class.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 7e015d951b1..0040f1e3184 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -769,8 +769,8 @@ class ExtraFields $this->attributes[$tab->elementtype]['ishidden'][$tab->name]=$tab->ishidden; $this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity; - - if (!empty($conf->multicompany->enabled)) { + if (!empty($conf->multicompany->enabled)) + { $sql_entity_name='SELECT label FROM '.MAIN_DB_PREFIX.'entity WHERE rowid='.$tab->entity; $resql_entity_name=$this->db->query($sql_entity_name); if ($resql_entity_name) @@ -785,11 +785,6 @@ class ExtraFields } } } - else - { - $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::fetch_name_optionals_label ".$this->error, LOG_ERR); - } } } if ($elementtype) $this->attributes[$elementtype]['loaded']=1; From a6a560257229eec3af6241865a05e0f3a9a0e6ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 12:36:22 +0200 Subject: [PATCH 0261/1137] NEW Can set email of thirdparty as unique and/or mandatory --- htdocs/compta/facture/card.php | 63 ++++++--- htdocs/core/actions_builddoc.inc.php | 18 +-- htdocs/core/lib/functions.lib.php | 4 +- htdocs/societe/admin/societe.php | 115 +++++++--------- .../canvas/company/tpl/card_create.tpl.php | 2 +- .../canvas/company/tpl/card_edit.tpl.php | 2 +- .../canvas/individual/tpl/card_create.tpl.php | 2 +- .../canvas/individual/tpl/card_edit.tpl.php | 2 +- htdocs/societe/card.php | 65 +++------ .../class/api_deprecated_thirdparty.class.php | 2 +- .../societe/class/api_thirdparties.class.php | 2 +- htdocs/societe/class/societe.class.php | 129 ++++++++++++++---- 12 files changed, 230 insertions(+), 176 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5a9dad480a0..1349d3b9199 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -73,7 +73,7 @@ if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (! empty($conf->margin->enabled)) $langs->load('margins'); -$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : 0); $id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); @@ -83,7 +83,7 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $lineid = GETPOST('lineid', 'int'); $userid = GETPOST('userid', 'int'); -$search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); +$search_ref = GETPOST('sf_ref','alpha') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); $search_montant_ttc = GETPOST('search_montant_ttc', 'alpha'); @@ -430,27 +430,52 @@ if (empty($reshook)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate))) ) { - $idwarehouse = GETPOST('idwarehouse'); + $idwarehouse = GETPOST('idwarehouse','int'); $object->fetch($id); $object->fetch_thirdparty(); // Check parameters - // Check for mandatory prof id (but only if country is than than ours) - if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id) + // Check for mandatory fields defined into setup + $array_to_check=array('IDPROF1','IDPROF2','IDPROF3','IDPROF4','IDPROF5','IDPROF6','EMAIL'); + foreach($array_to_check as $key) { - for ($i = 1; $i <= 6; $i++) - { - $idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY'; - $idprof = 'idprof' . $i; - if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) - { - if (! $error) $langs->load("errors"); - $error++; - setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors'); - } - } + $keymin=strtolower($key); + $i=(int) preg_replace('/[^0-9]/','',$key); + $vallabel=$object->thirdparty->$keymin; + + if ($i > 0) + { + if ($object->thirdparty->isACompany()) + { + // Check for mandatory prof id (but only if country is other than ours) + if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id) + { + $idprof_mandatory ='SOCIETE_'.$key.'_INVOICE_MANDATORY'; + if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) + { + $langs->load("errors"); + $error++; + setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $object->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors'); + } + } + } + } + else + { + //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); + if ($key == 'EMAIL') + { + // Check for mandatory + if (! empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && ! isValidEMail($object->thirdparty->email)) + { + $langs->load("errors"); + $error++; + setEventMessages($langs->trans("ErrorBadEMail", $object->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").')', null, 'errors'); + } + } + } } $qualified_for_stock_change = 0; @@ -4260,7 +4285,7 @@ else if ($id > 0 || ! empty($ref)) print '
            '; // Select mail models is same action as presend - if (GETPOST('modelselected')) { + if (GETPOST('modelselected','alpha')) { $action = 'presend'; } if ($action != 'prerelance' && $action != 'presend') @@ -4347,7 +4372,7 @@ else if ($id > 0 || ! empty($ref)) // Build document if it not exists if (! $file || ! is_readable($file)) { - $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + $result = $object->generateDocument(GETPOST('model','alpha') ? GETPOST('model','alpha') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $object->error, $object->errors); exit(); @@ -4367,7 +4392,7 @@ else if ($id > 0 || ! empty($ref)) include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); + $formmail->fromtype = (GETPOST('fromtype','alpha')?GETPOST('fromtype','alpha'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); if($formmail->fromtype === 'user'){ $formmail->fromid = $user->id; diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 076a7a6a035..a1ff6417f92 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -33,8 +33,8 @@ // Build doc if ($action == 'builddoc' && $permissioncreate) { - - if (is_numeric(GETPOST('model'))) + + if (is_numeric(GETPOST('model','alpha'))) { $error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model")); } @@ -48,18 +48,18 @@ if ($action == 'builddoc' && $permissioncreate) dol_print_error('Object must have been loaded by a fetch'); exit; }*/ - + // Save last template used to generate document - if (GETPOST('model')) + if (GETPOST('model','alpha')) { $object->setDocModel($user, GETPOST('model','alpha')); } - + // Special case to force bank account //if (property_exists($object, 'fk_bank')) //{ - if (GETPOST('fk_bank')) { // this field may come from an external module - $object->fk_bank = GETPOST('fk_bank'); + if (GETPOST('fk_bank','int')) { // this field may come from an external module + $object->fk_bank = GETPOST('fk_bank','int'); } else if (! empty($object->fk_account)) { $object->fk_bank = $object->fk_account; } @@ -76,13 +76,13 @@ if ($action == 'builddoc' && $permissioncreate) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - + // To be sure vars is defined if (empty($hidedetails)) $hidedetails=0; if (empty($hidedesc)) $hidedesc=0; if (empty($hideref)) $hideref=0; if (empty($moreparams)) $moreparams=null; - + $result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); if ($result <= 0) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4aa3ab65ce5..da6cbc6c15c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5738,8 +5738,8 @@ function dol_osencode($str) * @param DoliDB $db Database handler * @param string $key Code or Id to get Id or Code * @param string $tablename Table name without prefix - * @param string $fieldkey Field for code - * @param string $fieldid Field for id + * @param string $fieldkey Field for search ('code' or 'id') + * @param string $fieldid Field to get ('id' or 'code') * @return int <0 if KO, Id of code if OK * @see $langs->getLabelFromKey */ diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 89ef7d0323d..ed4704471d0 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -167,23 +167,6 @@ if ($action == 'setdoc') } } -//Activate ProfId -if ($action == 'setprofid') -{ - $status = GETPOST('status','alpha'); - - $idprof="SOCIETE_IDPROF".$value."_UNIQUE"; - if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } -} - //Activate Set ref in list if ($action=="setaddrefinlist") { $setaddrefinlist = GETPOST('value','int'); @@ -214,16 +197,33 @@ if ($action=="setaskforshippingmet") { } } +//Activate ProfId unique +if ($action == 'setprofid') +{ + $status = GETPOST('status','alpha'); + + $idprof="SOCIETE_".$value."_UNIQUE"; + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) + { + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; + } + else + { + dol_print_error($db); + } +} + //Activate ProfId mandatory if ($action == 'setprofidmandatory') { $status = GETPOST('status','alpha'); - $idprof="SOCIETE_IDPROF".$value."_MANDATORY"; - if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) + $idprof="SOCIETE_".$value."_MANDATORY"; + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; } else { @@ -236,11 +236,11 @@ if ($action == 'setprofidinvoicemandatory') { $status = GETPOST('status','alpha'); - $idprof="SOCIETE_IDPROF".$value."_INVOICE_MANDATORY"; - if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) + $idprof="SOCIETE_".$value."_INVOICE_MANDATORY"; + if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + //header("Location: ".$_SERVER["PHP_SELF"]); + //exit; } else { @@ -298,7 +298,6 @@ print '
            '; print ' '; print "\n"; -$var = true; foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot,0); @@ -327,7 +326,6 @@ foreach ($dirsociete as $dirroot) if ($modCodeTiers->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($modCodeTiers->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var = !$var; print ''."\n"; print ''."\n"; print ''."\n"; @@ -380,7 +378,6 @@ print ''; print ''; print "\n"; -$var=true; foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot,0); @@ -403,7 +400,6 @@ foreach ($dirsociete as $dirroot) } $modCodeCompta = new $file; - $var = !$var; print ''; print ''; print ''; print "\n"; -$var=true; foreach ($dirsociete as $dirroot) { $dir = dol_buildpath($dirroot.'doc/',0); @@ -507,7 +502,6 @@ foreach ($dirsociete as $dirroot) if ($modulequalified) { - $var = !$var; print ''; print ''; print "\n"; -$profid[0][0]=$langs->trans("ProfId1"); -$profid[0][1]=$langs->transcountry('ProfId1', $mysoc->country_code); -$profid[1][0]=$langs->trans("ProfId2"); -$profid[1][1]=$langs->transcountry('ProfId2', $mysoc->country_code); -$profid[2][0]=$langs->trans("ProfId3"); -$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code); -$profid[3][0]=$langs->trans("ProfId4"); -$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code); -$profid[4][0]=$langs->trans("ProfId5"); -$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code); -$profid[5][0]=$langs->trans("ProfId6"); -$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code); - -$var = true; -$i=0; +$profid['IDPROF1'][0]=$langs->trans("ProfId1"); +$profid['IDPROF1'][1]=$langs->transcountry('ProfId1', $mysoc->country_code); +$profid['IDPROF2'][0]=$langs->trans("ProfId2"); +$profid['IDPROF2'][1]=$langs->transcountry('ProfId2', $mysoc->country_code); +$profid['IDPROF3'][0]=$langs->trans("ProfId3"); +$profid['IDPROF3'][1]=$langs->transcountry('ProfId3', $mysoc->country_code); +$profid['IDPROF4'][0]=$langs->trans("ProfId4"); +$profid['IDPROF4'][1]=$langs->transcountry('ProfId4', $mysoc->country_code); +$profid['IDPROF5'][0]=$langs->trans("ProfId5"); +$profid['IDPROF5'][1]=$langs->transcountry('ProfId5', $mysoc->country_code); +$profid['IDPROF6'][0]=$langs->trans("ProfId6"); +$profid['IDPROF6'][1]=$langs->transcountry('ProfId6', $mysoc->country_code); +$profid['EMAIL'][0]=$langs->trans("EMail"); +$profid['EMAIL'][1]=$langs->trans('Email'); $nbofloop=count($profid); -while ($i < $nbofloop) +foreach($profid as $key => $val) { - if ($profid[$i][1]!='-') + if ($profid[$key][1]!='-') { - $var = !$var; - print ''; - print ''; - $idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE'; - $idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY'; - $idprof_invoice_mandatory ='SOCIETE_IDPROF'.($i+1).'_INVOICE_MANDATORY'; + $idprof_unique ='SOCIETE_'.$key.'_UNIQUE'; + $idprof_mandatory ='SOCIETE_'.$key.'_MANDATORY'; + $idprof_invoice_mandatory ='SOCIETE_'.$key.'_INVOICE_MANDATORY'; + $verif=(empty($conf->global->$idprof_unique)?false:true); $mandatory=(empty($conf->global->$idprof_mandatory)?false:true); $invoice_mandatory=(empty($conf->global->$idprof_invoice_mandatory)?false:true); if ($verif) { - print ''; } else { - print ''; } if ($mandatory) { - print ''; } else { - print ''; } if ($invoice_mandatory) { - print ''; } else { - print ''; } @@ -683,7 +675,6 @@ print load_fiche_titre($langs->trans("Other"),'',''); // Autres options $form=new Form($db); -$var=true; print ''; print ''; diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index d542f0553ba..45b5e76fcda 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -133,7 +133,7 @@ - + diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 1f6201ec829..951d17c5b63 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -148,7 +148,7 @@ if ($this->control->tpl['fournisseur']) { - + diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index 1be20214c35..44bf9dadf58 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -143,7 +143,7 @@ - + diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 90543958902..81e0b66c103 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -145,7 +145,7 @@ if ($this->control->tpl['fournisseur']) { - + diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 53c5a1add14..00b463f647a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -325,7 +325,6 @@ if (empty($reshook)) $action='create'; } - if ($action == 'update') { $ret=$object->fetch($socid); @@ -333,7 +332,7 @@ if (empty($reshook)) } else $object->canvas=$canvas; - if (GETPOST("private") == 1) + if (GETPOST("private") == 1) // Ask to create a contact { $object->particulier = GETPOST("private"); @@ -356,14 +355,14 @@ if (empty($reshook)) $object->skype = GETPOST('skype', 'alpha'); $object->phone = GETPOST('phone', 'alpha'); $object->fax = GETPOST('fax','alpha'); - $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); - $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->idprof1 = GETPOST('idprof1', 'alpha'); - $object->idprof2 = GETPOST('idprof2', 'alpha'); - $object->idprof3 = GETPOST('idprof3', 'alpha'); - $object->idprof4 = GETPOST('idprof4', 'alpha'); - $object->idprof5 = GETPOST('idprof5', 'alpha'); - $object->idprof6 = GETPOST('idprof6', 'alpha'); + $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); + $object->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); + $object->idprof1 = trim(GETPOST('idprof1', 'alpha')); + $object->idprof2 = trim(GETPOST('idprof2', 'alpha')); + $object->idprof3 = trim(GETPOST('idprof3', 'alpha')); + $object->idprof4 = trim(GETPOST('idprof4', 'alpha')); + $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); + $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->code_client = GETPOST('code_client', 'alpha'); $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); @@ -383,7 +382,9 @@ if (empty($reshook)) $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->typent_id = GETPOST('typent_id'); + $object->typent_id = GETPOST('typent_id','int'); + + $object->typent_code = dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type $object->client = GETPOST('client', 'int'); $object->fournisseur = GETPOST('fournisseur', 'int'); @@ -461,40 +462,6 @@ if (empty($reshook)) $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; } - - // Check for duplicate or mandatory prof id - // Only for companies - if (!($object->particulier || $private)) - { - for ($i = 1; $i <= 6; $i++) - { - $slabel="idprof".$i; - $_POST[$slabel]=trim($_POST[$slabel]); - $vallabel=$_POST[$slabel]; - if ($vallabel && $object->id_prof_verifiable($i)) - { - if($object->id_prof_exists($i,$vallabel,$object->id)) - { - $langs->load("errors"); - $error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel); - $action = (($action=='add'||$action=='create')?'create':'edit'); - } - } - - // Check for mandatory prof id (but only if country is than than ours) - if ($mysoc->country_id > 0 && $object->country_id == $mysoc->country_id) - { - $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) - { - $langs->load("errors"); - $error++; - $errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code)); - $action = (($action=='add'||$action=='create')?'create':'edit'); - } - } - } - } } if (! $error) @@ -512,7 +479,7 @@ if (empty($reshook)) { if ($object->particulier) { - dol_syslog("This thirdparty is a personal people",LOG_DEBUG); + dol_syslog("We ask to create a contact/address too", LOG_DEBUG); $result=$object->create_individual($user); if (! $result >= 0) { @@ -1152,7 +1119,7 @@ else } // Email web - print ''; + print ''; print ''; print ''; print ''; @@ -1710,7 +1677,7 @@ else } // EMail / Web - print ''; + print ''; print ''; print ''; print ''; @@ -1740,7 +1707,7 @@ else if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if(empty($conf->global->$idprof_mandatory)) + if (empty($conf->global->$idprof_mandatory) || ! $object->isACompany()) print ''; - $out .= ''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; $out .=''; From 9923c87fd808de7b99968ad8bfb1f4ca6b2ea2a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 13:03:14 +0200 Subject: [PATCH 0264/1137] Fix translation of extrafields --- htdocs/core/class/commonobject.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 14d8f03b84b..b84f9887abb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4622,7 +4622,9 @@ abstract class CommonObject $labeltoshow = $langs->trans($label); if($extrafields->attribute_required[$key]) - $label = ''.$labeltoshow.''; + { + $labeltoshow = ''.$labeltoshow.''; + } $out .= ''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; From 3beee569a653aec0c3bb355630f4da71fe9fa4c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 15:12:21 +0200 Subject: [PATCH 0265/1137] Enhance support of default value in extrafields --- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/db/mysqli.class.php | 23 ++++++++++++- htdocs/core/db/pgsql.class.php | 22 +++++++++++-- htdocs/core/tpl/admin_extrafields_add.tpl.php | 32 +++++++++---------- .../core/tpl/admin_extrafields_edit.tpl.php | 10 +++--- 5 files changed, 64 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0040f1e3184..e25809559d2 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -528,7 +528,7 @@ class ExtraFields $typedb=$type; $lengthdb=$length; } - $field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required?'NOT NULL':'NULL')); + $field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required?'NOT NULL':'NULL'), 'default'=>$default); if ($type != 'separate') // No table update when separate type { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 4358e8695fe..14256b37d29 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -779,7 +779,28 @@ class DoliDBMysqli extends DoliDB if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { $sql.="(".$field_desc['value'].")"; } - if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; + if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') + { + // We will try to change format of column to NOT NULL. To be sure the ALTER works, we try to update fields that are NULL + if ($field_desc['type'] == 'varchar' || $field_desc['type'] == 'text') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = '".$this->escape($field_desc['default'] ? $field_desc['default'] : '')."' WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + elseif ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = ".((int) $this->escape($field_desc['default'] ? $field_desc['default'] : 0))." WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + + $sql.=" NOT NULL"; + } + + if ($field_desc['default']) + { + if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); + elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields + } dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG); if (! $this->query($sql)) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index d02ff4a1341..0448789fc50 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1088,8 +1088,26 @@ class DoliDBPgsql extends DoliDB $sql.="(".$field_desc['value'].")"; } - // TODO May not work with pgsql. May need to run a second request. If it works, just remove the comment - if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; + if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') + { + // We will try to change format of column to NOT NULL. To be sure the ALTER works, we try to update fields that are NULL + if ($field_desc['type'] == 'varchar' || $field_desc['type'] == 'text') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = '".$this->escape($field_desc['default'] ? $field_desc['default'] : '')."' WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + elseif ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') + { + $sqlbis="UPDATE ".$table." SET ".$field_name." = ".((int) $this->escape($field_desc['default'] ? $field_desc['default'] : 0))." WHERE ".$field_name." IS NULL"; + $this->query($sqlbis); + } + } + + if ($field_desc['default']) + { + if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); + elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields + } dol_syslog($sql,LOG_DEBUG); if (! $this->query($sql)) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index a7f98bdba72..6c5f563e106 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -42,12 +42,12 @@ var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); '); + init_typeoffields(''); jQuery("#type").change(function() { init_typeoffields($(this).val()); }); @@ -130,15 +130,15 @@
            '.$langs->trans("Status").''.$langs->trans("ShortInfo").'
            '.$modCodeTiers->name.''.$modCodeTiers->info($langs).''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
            '.$modCodeCompta->name."\n"; @@ -474,7 +470,6 @@ print ''.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
            '; print $module->name; print "\n"; @@ -597,76 +591,74 @@ print ''.$langs->trans("MustBeMandatory").''.$langs->trans("MustBeInvoiceMandatory").'
            '.$profid[$i][0]."\n"; - print $profid[$i][1]; + print ''.$profid[$key][0]."\n"; + print $profid[$key][1]; print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); print '
            trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?>trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?>
            trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?>trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?>
            trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?>trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?>
            trans('EMail').($conf->global->SOCIETE_MAIL_REQUIRED?'*':''); ?>trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY?'*':''); ?> trans('Web'); ?>
            '.fieldLabel('EMail','email').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
            '.fieldLabel('EMail','email',$conf->global->SOCIETE_EMAIL_MANDATORY).'
            '.fieldLabel('Web','url').'
            '.fieldLabel('EMail','email',(! empty($conf->global->SOCIETE_MAIL_REQUIRED))).'
            '.fieldLabel('EMail','email',(! empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
            '.fieldLabel('Web','url').'
            '.fieldLabel($idprof,$key).''; else print ''.fieldLabel($idprof,$key).''; diff --git a/htdocs/societe/class/api_deprecated_thirdparty.class.php b/htdocs/societe/class/api_deprecated_thirdparty.class.php index b335fb35183..c31e4278f46 100644 --- a/htdocs/societe/class/api_deprecated_thirdparty.class.php +++ b/htdocs/societe/class/api_deprecated_thirdparty.class.php @@ -60,7 +60,7 @@ class ThirdpartyApi extends DolibarrApi $this->company = new Societe($this->db); $this->customer = new Client($this->db); - if (! empty($conf->global->SOCIETE_MAIL_REQUIRED)) { + if (! empty($conf->global->SOCIETE_EMAIL_MANDATORY)) { static::$FIELDS[] = 'email'; } } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 24cf991da52..f25fda9a5fb 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -49,7 +49,7 @@ class Thirdparties extends DolibarrApi $this->db = $db; $this->company = new Societe($this->db); - if (! empty($conf->global->SOCIETE_MAIL_REQUIRED)) { + if (! empty($conf->global->SOCIETE_EMAIL_MANDATORY)) { static::$FIELDS[] = 'email'; } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2bd764c92ed..00f49046d45 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -400,7 +400,7 @@ class Societe extends CommonObject */ function create($user) { - global $langs,$conf; + global $langs,$conf,$mysoc; $error=0; @@ -422,14 +422,6 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::create ".$this->name); - // Check parameters - if (! empty($conf->global->SOCIETE_MAIL_REQUIRED) && ! isValidEMail($this->email)) - { - $langs->load("errors"); - $this->error = $langs->trans("ErrorBadEMail",$this->email); - return -1; - } - $now=dol_now(); $this->db->begin(); @@ -438,7 +430,7 @@ class Societe extends CommonObject if ($this->code_client == -1) $this->get_codeclient($this,0); if ($this->code_fournisseur == -1) $this->get_codefournisseur($this,1); - // Check more parameters + // Check more parameters (including mandatory setup // If error, this->errors[] is filled $result = $this->verify(); @@ -524,6 +516,7 @@ class Societe extends CommonObject } } + /** * Create a contact/address from thirdparty * @@ -568,6 +561,9 @@ class Societe extends CommonObject */ function verify() { + global $conf, $langs, $mysoc; + + $error = 0; $this->errors=array(); $result = 0; @@ -630,6 +626,69 @@ class Societe extends CommonObject } } + // Check for duplicate or mandatory fields defined into setup + $array_to_check=array('IDPROF1','IDPROF2','IDPROF3','IDPROF4','IDPROF5','IDPROF6','EMAIL'); + foreach($array_to_check as $key) + { + $keymin=strtolower($key); + $i=(int) preg_replace('/[^0-9]/','',$key); + $vallabel=$this->$keymin; + + if ($i > 0) + { + if ($this->isACompany()) + { + // Check for unicity + if ($vallabel && $this->id_prof_verifiable($i)) + { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) + { + $langs->load("errors"); + $error++; $this->errors[] = $langs->transcountry('ProfId'.$i, $this->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } + + // Check for mandatory prof id (but only if country is other than ours) + if ($mysoc->country_id > 0 && $this->country_id == $mysoc->country_id) + { + $idprof_mandatory ='SOCIETE_'.$key.'_MANDATORY'; + if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) + { + $langs->load("errors"); + $error++; + $this->errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $this->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } + } + } + else + { + //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); + if ($key == 'EMAIL') + { + // Check for unicity + if ($vallabel) + { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) + { + $langs->load("errors"); + $error++; $this->errors[] = $langs->transcountry('ProfId'.$i, $this->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } + + // Check for mandatory + if (! empty($conf->global->SOCIETE_EMAIL_MANDATORY) && ! isValidEMail($this->email)) + { + $langs->load("errors"); + $error++; + $this->errors[] = $langs->trans("ErrorBadEMail", $this->email).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } + } + } + + if ($error) $result = -4; + return $result; } @@ -719,13 +778,7 @@ class Societe extends CommonObject $this->code_compta=trim($this->code_compta); $this->code_compta_fournisseur=trim($this->code_compta_fournisseur); - // Check parameters - if (! empty($conf->global->SOCIETE_MAIL_REQUIRED) && ! isValidEMail($this->email)) - { - $langs->load("errors"); - $this->error = $langs->trans("ErrorBadEMail",$this->email); - return -1; - } + // Check parameters. More tests are done later in the ->verify() if (! is_numeric($this->client) && ! is_numeric($this->fournisseur)) { $langs->load("errors"); @@ -2581,7 +2634,7 @@ class Societe extends CommonObject /** * Returns if a profid sould be verified * - * @param int $idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm) + * @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6) * @return boolean true , false */ function id_prof_verifiable($idprof) @@ -2602,6 +2655,12 @@ class Societe extends CommonObject case 4: $ret=(!$conf->global->SOCIETE_IDPROF4_UNIQUE?false:true); break; + case 5: + $ret=(!$conf->global->SOCIETE_IDPROF5_UNIQUE?false:true); + break; + case 6: + $ret=(!$conf->global->SOCIETE_IDPROF6_UNIQUE?false:true); + break; default: $ret=false; } @@ -2612,28 +2671,40 @@ class Societe extends CommonObject /** * Verify if a profid exists into database for others thirds * - * @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm) + * @param string $idprof 'idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','email' (Example: idprof1=siren, idprof2=siret, idprof3=naf, idprof4=rcs/rm) * @param string $value Value of profid - * @param int $socid Id of thirdparty if update - * @return boolean true if exists, false if not + * @param int $socid Id of thirdparty to exclude (if update) + * @return boolean True if exists, False if not */ - function id_prof_exists($idprof,$value,$socid=0) + function id_prof_exists($idprof, $value, $socid=0) { - switch($idprof) + $field = $idprof; + + switch($idprof) // For backward compatibility { - case 1: + case '1': + case 'idprof1': $field="siren"; break; - case 2: + case '2': + case 'idprof2': $field="siret"; break; - case 3: + case '3': + case 'idprof3': $field="ape"; break; - case 4: + case '4': + case 'idprof4': $field="idprof4"; break; - } + case '5': + $field="idprof5"; + break; + case '6': + $field="idprof6"; + break; + } //Verify duplicate entries $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."' AND entity IN (".getEntity('societe').")"; @@ -2895,7 +2966,7 @@ class Societe extends CommonObject $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default if (! empty($this->tva_intra)) $isacompany=1; else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_SMALL','TE_MEDIUM','TE_LARGE'))) $isacompany=1; + else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_SMALL','TE_MEDIUM','TE_LARGE','TE_GROUP'))) $isacompany=1; return $isacompany; } From e5400a4a36a668c32a2ab9da94e098d2c1eb74b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 13:01:41 +0200 Subject: [PATCH 0262/1137] Fix translation of extrafields --- htdocs/core/class/commonobject.class.php | 5 +++-- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 450bc4ba393..292492eb9fc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4620,10 +4620,11 @@ abstract class CommonObject $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]); } + $labeltoshow = $langs->trans($labeltoshow); if($extrafields->attribute_required[$key]) - $label = ''.$label.''; + $label = ''.$labeltoshow.''; + $out .= ''.$labeltoshow.''.$langs->trans($label).''; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 8458a6167d2..7ae8b4d8e76 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -204,6 +204,8 @@ ALTER TABLE llx_extrafields ADD COLUMN fk_user_modif integer; ALTER TABLE llx_extrafields ADD COLUMN datec datetime; ALTER TABLE llx_extrafields ADD COLUMN tms timestamp; +ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64); + ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name); From 36eb21c13554a970e0cf50d8b6c526609c6cdde5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 13:02:01 +0200 Subject: [PATCH 0263/1137] Fix translation of extrafields --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 292492eb9fc..14d8f03b84b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4620,7 +4620,7 @@ abstract class CommonObject $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]); } - $labeltoshow = $langs->trans($labeltoshow); + $labeltoshow = $langs->trans($label); if($extrafields->attribute_required[$key]) $label = ''.$labeltoshow.''; $out .= ''.$labeltoshow.''.$labeltoshow.'
            - + - + - + - - + + From 75e639db6c06c2fd99f8eaad5f449d4a2d46b341 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 15:23:53 +0200 Subject: [PATCH 0266/1137] Fix error management --- htdocs/societe/card.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 00b463f647a..bc62e71dd04 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -701,6 +701,10 @@ if (empty($reshook)) } } } + else + { + $action='create'; + } } // Delete third party From e6f0e769881dc418607a3f6a29e816cbbed87b0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 15:30:00 +0200 Subject: [PATCH 0267/1137] Add option MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH --- htdocs/core/lib/functions.lib.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index da6cbc6c15c..9b643efa086 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -345,8 +345,20 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) } elseif (isset($user->default_values[$relativepathstring]['filters'][$paramname])) { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace); + if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) + { + // We made a search from quick search menu, do we still use default filter ? + if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace); + } + } + else + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], '', $forbidden_chars_to_replace); + } } } } From ec0d2771238bcd5e5d6ce50daa17eb2d5a49f416 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 00:46:28 +0200 Subject: [PATCH 0268/1137] Code comment --- htdocs/societe/class/societe.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 00f49046d45..22dc96a0c8b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -393,7 +393,8 @@ class Societe extends CommonObject /** - * Create third party in database + * Create third party in database. + * $this->code_client = -1 and $this->code_fournisseur = -1 means automatic assignement. * * @param User $user Object of user that ask creation * @return int >= 0 if OK, < 0 if KO From f92129dcdb667eccb88f0657f912a31d061299a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 00:55:49 +0200 Subject: [PATCH 0269/1137] Fix packager to avoid symlinks into custom --- build/makepack-dolibarr.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index fdd14fcf5a2..a6f052efa82 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -594,7 +594,9 @@ if ($nboftargetok) { print "Remove subdir of custom dir\n"; print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n"; - $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep dir + $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only + print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n"; + $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to keep files only } # Build package for each target From cf5c34c8fb88964b9861e7edc126d75e1560ebb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 02:13:55 +0200 Subject: [PATCH 0270/1137] Remove useless link --- htdocs/compta/facture/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1349d3b9199..23b310fd9f7 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2235,7 +2235,6 @@ if ($action == 'create') print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); } print ')'; - print ' '.$langs->trans("AddThirdParty").''; print ''; } else From a3d5d97d05f75abe542cd0707d28bee5abd644ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 02:19:38 +0200 Subject: [PATCH 0271/1137] Fix translation --- htdocs/compta/facture/fiche-rec.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 025940c8b3a..5c1d33e7808 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -402,16 +402,16 @@ if (empty($reshook)) $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); if ($ret < 0) $error ++; - + if (! $error) { - + $result = $object->insertExtraFields(); if ($result < 0) { $error ++; } } else if ($reshook < 0) $error ++; - + if ($error) { $action = 'edit_extras'; setEventMessages($object->error, $object->errors, 'errors'); @@ -760,7 +760,7 @@ if (empty($reshook)) $extrafieldsline = new ExtraFields($db); $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); - + $objectline = new FactureLigneRec($db); if ($objectline->fetch(GETPOST('lineid'))) { @@ -771,7 +771,7 @@ if (empty($reshook)) setEventMessages($langs->trans('Error').$result, null, 'errors'); } } - + // Unset extrafield if (is_array($extralabelsline)) { @@ -1054,7 +1054,7 @@ if ($action == 'create') // Bank account if ($object->fk_account > 0) { - print ""; } @@ -1361,11 +1361,11 @@ else print ""; print ''; - + // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print '
            trans("Label"); ?>
            trans("Label"); ?>
            trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)
            trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)
            trans("Type"); ?> -selectarray('type',$type2label,GETPOST('type')); ?> +selectarray('type',$type2label,GETPOST('type','alpha')); ?>
            trans("Size"); ?>
            trans("Size"); ?>
            @@ -147,7 +147,7 @@ - + - + - + - + - +global->MAIN_CAN_HIDE_EXTRAFIELDS)) { ?> - +multicompany->enabled) { ?> - + global->MAIN_FEATURES_LEVEL >= 2) { ?> +
            - + textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?> textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?> @@ -162,27 +162,27 @@
            trans("LanguageFile"); ?>
            textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>">
            textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
            trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>">
            trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
            trans("Unique"); ?>>
            trans("Unique"); ?>>
            trans("Required"); ?>>
            trans("Required"); ?>>
            trans("AlwaysEditable"); ?>>
            trans("AlwaysEditable"); ?>>
            trans("Hidden"); ?>>
            trans("Hidden"); ?>>
            trans("AllEntities"); ?>>
            trans("AllEntities"); ?>>
            trans("ByDefaultInList"); ?> trans("FeatureNotYetSupported")); ?> ->
            >
            diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index beb1e34055e..85cfe510df8 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -41,12 +41,12 @@ var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); $val) { $selected=''; - if ($key == (GETPOST('type')?GETPOST('type'):$type)) $selected=' selected="selected"'; + if ($key == (GETPOST('type','alpha')?GETPOST('type','alpha'):$type)) $selected=' selected="selected"'; if (in_array($key, $typewecanchangeinto[$type])) print ''; else print ''; } @@ -222,8 +222,8 @@ else
            trans("LanguageFile"); ?>
            textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?>
            trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
            trans("Unique"); ?>>
            ".$langs->trans('RIB').""; + print "
            ".$langs->trans('BankAccount').""; $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); print "
            '; print '
        '; From ca93be5eed8287359f17a13822cebe2fe7b299d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 02:40:00 +0200 Subject: [PATCH 0272/1137] Fix priority of crons --- htdocs/core/modules/modCron.class.php | 4 ++-- htdocs/core/modules/modFacture.class.php | 8 +------ htdocs/core/modules/modGravatar.class.php | 7 ------ .../core/modules/modMultiCurrency.class.php | 22 +++++++------------ 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 55f0f96c546..f72fb6abe20 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -97,8 +97,8 @@ class modCron extends DolibarrModules // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>10, 'status'=>1, 'test'=>true), - 1=>array('label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>20, 'status'=>0, 'test'=>in_array($db->type, array('mysql','mysqli'))), + 0=>array('label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true), + 1=>array('label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>in_array($db->type, array('mysql','mysqli'))), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) ); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 40e2a03d161..5f28a3db54d 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -117,15 +117,9 @@ class modFacture extends DolibarrModules // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600*24), + 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600*24, 'priority'=>50, 'status'=>1, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) ); - // List of cron jobs entries to add - // Example: - // $this->cronjobs=array( - // 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600) - // ); // Permissions $this->rights = array(); diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 237778309c2..495ad152f2a 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -99,13 +99,6 @@ class modGravatar extends DolibarrModules //$r++; - // Cronjobs - $this->cronjobs = array(); // List of cron jobs entries to add - // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - // ); - $r=0; - // Permissions $this->rights = array(); // Permission array used by this module $r=0; diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 7eb58e32a3a..5e921e83597 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2016 Pierre-Henry Favre - * + * * 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 3 of the License, or @@ -60,7 +60,7 @@ class modMultiCurrency extends DolibarrModules $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Module to enter elements with a foreign currency"; - + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) @@ -175,12 +175,6 @@ class modMultiCurrency extends DolibarrModules // 2=>array('file'=>'myboxc.php@multicurrency','note'=>'') //); - // Cronjobs - $this->cronjobs = array(); // List of cron jobs entries to add - // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - // ); - // Permissions $this->rights = array(); // Permission array used by this module $r=0; @@ -266,12 +260,12 @@ class modMultiCurrency extends DolibarrModules //$this->_load_tables('/multicurrency/sql/'); $res = $this->_init($sql, $options); - + if ($res) { $this->createFirstCurrency(); } - + return $res; } @@ -293,22 +287,22 @@ class modMultiCurrency extends DolibarrModules /** * Function called when module is enabled * Create the currency from general setting - * + * * @return int 1 if OK, 0 if KO */ private function createFirstCurrency() { global $conf,$user,$langs; - + if (!MultiCurrency::checkCodeAlreadyExists($conf->currency)) { $langs->loadCacheCurrencies(''); - + $multicurrency = new MultiCurrency($this->db); $multicurrency->code = $conf->currency; $multicurrency->name = $langs->cache_currencies[$conf->currency]['label'].' ('.$langs->getCurrencySymbol($conf->currency).')'; $r = $multicurrency->create($user); - + if ($r > 0) $multicurrency->addRate(1); } } From e549e6cde1edbb8c72ac097c050f14fdfb9969fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 04:16:43 +0200 Subject: [PATCH 0273/1137] Error management --- htdocs/comm/card.php | 4 ++-- htdocs/contrat/class/contrat.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index cf7b5bf3dc0..f4a634aad6c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -206,7 +206,7 @@ if ($id > 0 && empty($object->id)) { // Load data of third party $res=$object->fetch($id); - if ($object->id <= 0) dol_print_error($db,$object->error); + if ($object->id <= 0) dol_print_error($db,$object->error,$object->errors); } $title=$langs->trans("CustomerCard"); @@ -608,7 +608,7 @@ if ($id > 0) if(empty($reshook)){ $boxstat.= $hookmanager->resPrint; } - + $boxstat.=''; $boxstat.=''; $boxstat.='
        '; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a521f05269b..21df722bf9d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1278,7 +1278,7 @@ class Contrat extends CommonObject //// End call triggers } } - + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used { $result=$this->insertExtraFields(); From acb87ad8eaad86477516f9ffb97867b6ec3f6530 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 12:02:48 +0200 Subject: [PATCH 0274/1137] addline must return id of contract --- htdocs/contrat/class/contrat.class.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 21df722bf9d..747eb747441 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1464,6 +1464,8 @@ class Contrat extends CommonObject $resql=$this->db->query($sql); if ($resql) { + $contractlineid = $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $result=$this->update_statut($user); if ($result > 0) { @@ -1472,7 +1474,7 @@ class Contrat extends CommonObject { $contractline = new ContratLigne($this->db); $contractline->array_options=$array_options; - $contractline->id= $this->db->last_insert_id(MAIN_DB_PREFIX.$contractline->table_element); + $contractline->id=$contractlineid; $result=$contractline->insertExtraFields(); if ($result < 0) { @@ -1486,13 +1488,20 @@ class Contrat extends CommonObject $result=$this->call_trigger('LINECONTRACT_INSERT',$user); if ($result < 0) { - $this->db->rollback(); - return -1; + $error++; } // End call triggers + } + if ($error) + { + $this->db->rollback(); + return -1; + } + else + { $this->db->commit(); - return 1; + return $contractlineid; } } else From ac7f1035e1c33f0525caae04e266febf80e65023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garc=C3=ADa?= Date: Sun, 3 Sep 2017 12:25:27 +0200 Subject: [PATCH 0275/1137] FIX #7325 Default VAT rate when editing template invoices is 0% Close #7325 --- htdocs/compta/facture/fiche-rec.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index a6b238ba3c7..5af3d71f3af 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -896,7 +896,7 @@ if ($action == 'create') $langs->load('projects'); print '' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects($socid, $projectid, 'projectid', 0); - print '   id).'">' . $langs->trans("AddProject") . ''; + print '   thirdparty->id).'">' . $langs->trans("AddProject") . ''; print ''; } @@ -963,7 +963,7 @@ if ($action == 'create') $disableedit=1; $disablemove=1; $disableremove=1; - $ret = $object->printObjectLines('', $mysoc, $soc, $lineid, 0); // No date selector for template invoice + $ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid); // No date selector for template invoice } print "\n"; @@ -1307,7 +1307,7 @@ else { //$disableedit=1; //$disablemove=1; - $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 0); // No date selector for template invoice + $ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice } // Form to add new line @@ -1318,7 +1318,7 @@ else $var = true; // Add free products/services - $object->formAddObjectLine(0, $mysoc, $soc); // No date selector for template invoice + $object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook From a4d3e487734f1faff8f1fe0831fa7e5150c860a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 12:40:49 +0200 Subject: [PATCH 0276/1137] FIX inert of extra field must not change extrafield values in memory --- htdocs/core/class/commonobject.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b84f9887abb..8d7e0309a1d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4349,7 +4349,7 @@ abstract class CommonObject } elseif ($value=='') { - $this->array_options[$key] = null; + $new_array_options[$key] = null; } break; /*case 'select': // Not required, we chosed value='0' for undefined values @@ -4359,13 +4359,13 @@ abstract class CommonObject } break;*/ case 'price': - $this->array_options[$key] = price2num($this->array_options[$key]); + $new_array_options[$key] = price2num($this->array_options[$key]); break; case 'date': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + $new_array_options[$key] = $this->db->idate($this->array_options[$key]); break; case 'datetime': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + $new_array_options[$key] = $this->db->idate($this->array_options[$key]); break; case 'link': $param_list=array_keys($attributeParam ['options']); @@ -4381,7 +4381,7 @@ abstract class CommonObject if (is_numeric($value)) $res=$object->fetch($value); else $res=$object->fetch('',$value); - if ($res > 0) $this->array_options[$key]=$object->id; + if ($res > 0) $new_array_options[$key]=$object->id; else { $this->error="Ref '".$value."' for object '".$object->element."' not found"; @@ -4421,9 +4421,9 @@ abstract class CommonObject // Add field o fattribut if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) { - if ($this->array_options[$key] != '') + if ($new_array_options[$key] != '') { - $sql.=",'".$this->db->escape($this->array_options[$key])."'"; + $sql.=",'".$this->db->escape($new_array_options[$key])."'"; } else { From eb9e8c9dfcb9f94e8c1f06d8b4ecfc881c265d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garc=C3=ADa?= Date: Sun, 3 Sep 2017 12:42:05 +0200 Subject: [PATCH 0277/1137] FIX #7000 Dashboard link for late pending payment supplier invoices do not work Close #7000 --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/facture/list.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index bb3d303b32e..3aa9051a5c6 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1507,7 +1507,7 @@ class FactureFournisseur extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SupplierBillsToPay"); - $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0&mainmenu=accountancy&leftmenu=suppliers_bills'; + $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=f.fk_statut:1,paye:0&mainmenu=accountancy&leftmenu=suppliers_bills'; $response->img=img_object($langs->trans("Bills"),"bill"); $facturestatic = new FactureFournisseur($this->db); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 66411dc8422..706a78ccb1e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -84,9 +84,12 @@ $day_lim = GETPOST('day_lim','int'); $month_lim = GETPOST('month_lim','int'); $year_lim = GETPOST('year_lim','int'); $toselect = GETPOST('toselect', 'array'); +$filter = GETPOST('filtre'); $option = GETPOST('option'); -if ($option == 'late') $filter = 'paye:0'; +if ($option == 'late') { + $filter = 'paye:0'; +} $search_all = GETPOST('sall'); $search_label = GETPOST("search_label","alpha"); From c6cbf2345d7f05170026c6601f1a6c4680ac35f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 14:25:54 +0200 Subject: [PATCH 0278/1137] FIX Management of default value in extrafields when default is '0' --- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/db/mysqli.class.php | 6 +++--- htdocs/core/db/pgsql.class.php | 6 +++--- htdocs/langs/en_US/contracts.lang | 3 +++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e25809559d2..920ddefb964 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -660,7 +660,7 @@ class ExtraFields $sql.= " '".$param."',"; $sql.= " ".$list.", "; $sql.= " ".$ishidden.", "; - $sql.= " ".($default?"'".$this->db->escape($default)."'":"null").","; + $sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").","; $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").","; $sql .= " " . $user->id . ","; $sql .= " " . $user->id . ","; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 14256b37d29..1e5306a93f4 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -776,7 +776,7 @@ class DoliDBMysqli extends DoliDB { $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; - if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { $sql.="(".$field_desc['value'].")"; } if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') @@ -796,9 +796,9 @@ class DoliDBMysqli extends DoliDB $sql.=" NOT NULL"; } - if ($field_desc['default']) + if ($field_desc['default'] != '') { - if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 0448789fc50..bc967ffb0b7 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1084,7 +1084,7 @@ class DoliDBPgsql extends DoliDB { $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; - if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { $sql.="(".$field_desc['value'].")"; } @@ -1103,9 +1103,9 @@ class DoliDBPgsql extends DoliDB } } - if ($field_desc['default']) + if ($field_desc['default'] != '') { - if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); + if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']); elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields } diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index f742ca4cecd..63d3c403e50 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -31,9 +31,11 @@ NewContract=New contract NewContractSubscription=New contract/subscription AddContract=Create contract DeleteAContract=Delete a contract +ActivateAllOnContract=Activate all services CloseAContract=Close a contract ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? ConfirmValidateContract=Are you sure you want to validate this contract under name %s? +ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? ConfirmCloseService=Are you sure you want to close this service with date %s? ValidateAContract=Validate a contract @@ -67,6 +69,7 @@ BoardRunningServices=Expired running services ServiceStatus=Status of service DraftContracts=Drafts contracts CloseRefusedBecauseOneServiceActive=Contract can't be closed as ther is at least one open service on it +ActivateAllContracts=Activate all contract lines CloseAllContracts=Close all contract lines DeleteContractLine=Delete a contract line ConfirmDeleteContractLine=Are you sure you want to delete this contract line? From 07fc0ed3ff3811856de03b107cba632a01adf0e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 14:26:27 +0200 Subject: [PATCH 0279/1137] NEW Add a button "Activate all services" on contracts --- htdocs/contrat/card.php | 35 ++++++++---- htdocs/contrat/class/contrat.class.php | 73 +++++++++++++++++++++----- 2 files changed, 86 insertions(+), 22 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index a39698cd815..787f69de4a3 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -752,7 +752,13 @@ if (empty($reshook)) // Close all lines else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) { - $object->cloture($user); + $object->closeAll($user); + } + + // Close all lines + else if ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer) + { + $object->activateAll($user); } else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) @@ -1313,6 +1319,11 @@ else { print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); + } + if ($action == 'activate') + { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ActivateAllOnContract"),$langs->trans("ConfirmActivateAllOnContract"),"confirm_activate",'',0,1); + } /* @@ -1617,7 +1628,7 @@ else print $langs->trans("DateStartPlanned").': '; if ($objp->date_debut) { - print dol_print_date($db->jdate($objp->date_debut)); + print dol_print_date($db->jdate($objp->date_debut), 'day'); // Warning si date prevu passee et pas en service if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) { $warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24; @@ -1630,7 +1641,7 @@ else print $langs->trans("DateEndPlanned").': '; if ($objp->date_fin) { - print dol_print_date($db->jdate($objp->date_fin)); + print dol_print_date($db->jdate($objp->date_fin), 'day'); if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) { $warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); @@ -1849,21 +1860,21 @@ else // Si pas encore active if (! $objp->date_debut_reelle) { print $langs->trans("DateStartReal").': '; - if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle); + if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle, 'day'); else print $langs->trans("ContractStatusNotRunning"); } // Si active et en cours if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) { print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle); + print dol_print_date($objp->date_debut_reelle, 'day'); } // Si desactive if ($objp->date_debut_reelle && $objp->date_fin_reelle) { print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle); + print dol_print_date($objp->date_debut_reelle, 'day'); print '  -  '; print $langs->trans("DateEndReal").': '; - print dol_print_date($objp->date_fin_reelle); + print dol_print_date($objp->date_fin_reelle, 'day'); } if (! empty($objp->comment)) print "
        ".$objp->comment; print ''; @@ -2071,6 +2082,10 @@ else print ''; } + if ($object->nbofservicesclosed > 0) + { + print ''; + } if ($object->nbofservicesclosed < $nbofservices) { //if (! $numactive) @@ -2121,9 +2136,9 @@ else print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); print '
        '; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 747eb747441..9d6f4cce856 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -247,13 +247,61 @@ class Contrat extends CommonObject } + /** + * Open all lines of a contract + * + * @param User $user Object User making action + * @param int|string $date_start Date start (now if empty) + * @return void + */ + function activateAll($user, $date_start='') + { + if (empty($date_start)) $date_start = dol_now(); + + $this->db->begin(); + + // Load lines + $this->fetch_lines(); + + $ok=true; + foreach($this->lines as $contratline) + { + // Open lines not already open + if ($contratline->statut != 4) + { + $result = $contratline->active_line($user, $date_start, -1); + if ($result < 0) + { + $ok=false; + break; + } + } + } + + if ($this->statut == 0) + { + $result=$this->validate($user); + if ($result < 0) $ok=false; + } + + if ($ok) + { + $this->db->commit(); + } + else + { + dol_print_error($this->db,'Error in activateAll function'); + $this->db->rollback(); + } + } + /** * Close all lines of a contract * * @param User $user Object User making action * @return void */ - function cloture($user) + function closeAll($user) { $this->db->begin(); @@ -263,7 +311,7 @@ class Contrat extends CommonObject $ok=true; foreach($this->lines as $contratline) { - // Close line not already closed + // Close lines not already closed if ($contratline->statut != 5) { $contratline->date_cloture=dol_now(); @@ -290,7 +338,7 @@ class Contrat extends CommonObject } else { - dol_print_error($this->db,'Error in cloture function'); + dol_print_error($this->db,'Error in closeAll function'); $this->db->rollback(); } } @@ -920,8 +968,8 @@ class Contrat extends CommonObject { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $result=$this->insertExtraFields(); - if ($result < 0) + $result=$this->insertExtraFields(); + if ($result < 0) { $error++; } @@ -1361,7 +1409,8 @@ class Contrat extends CommonObject if (empty($info_bits)) $info_bits=0; if (empty($pu_ht) || ! is_numeric($pu_ht)) $pu_ht=0; if (empty($pu_ttc)) $pu_ttc=0; - if (empty($txlocaltax1) || ! is_numeric($txlocaltax1)) $txlocaltax1=0; + if (empty($txtva) || ! is_numeric($txtva)) $txtva=0; + if (empty($txlocaltax1) || ! is_numeric($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2) || ! is_numeric($txlocaltax2)) $txlocaltax2=0; if ($price_base_type=='HT') @@ -3007,11 +3056,11 @@ class ContratLigne extends CommonObjectLine /** * Activate a contract line * - * @param User $user Objet User who activate contract - * @param int $date Date d'ouverture - * @param int|string $date_end Date fin prevue - * @param string $comment A comment typed by user - * @return int <0 if KO, >0 if OK + * @param User $user Objet User who activate contract + * @param int $date Date activation + * @param int|string $date_end Date planned end. Use '-1' to keep it unchanged. + * @param string $comment A comment typed by user + * @return int <0 if KO, >0 if OK */ function active_line($user, $date, $date_end = '', $comment = '') { @@ -3030,7 +3079,7 @@ class ContratLigne extends CommonObjectLine $sql = "UPDATE " . MAIN_DB_PREFIX . "contratdet SET statut = 4,"; $sql .= " date_ouverture = " . (dol_strlen($date) != 0 ? "'" . $this->db->idate($date) . "'" : "null") . ","; - $sql .= " date_fin_validite = " . (dol_strlen($date_end) != 0 ? "'" . $this->db->idate($date_end) . "'" : "null") . ","; + if ($date_end >= 0) $sql .= " date_fin_validite = " . (dol_strlen($date_end) != 0 ? "'" . $this->db->idate($date_end) . "'" : "null") . ","; $sql .= " fk_user_ouverture = " . $user->id . ","; $sql .= " date_cloture = null,"; $sql .= " commentaire = '" . $this->db->escape($comment) . "'"; From 3126676ffb7b563b5a82b17e9152008faca4b656 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 12:40:49 +0200 Subject: [PATCH 0280/1137] FIX inert of extra field must not change extrafield values in memory --- htdocs/core/class/commonobject.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a79f01d6ed8..b32aa8cca05 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4294,7 +4294,7 @@ abstract class CommonObject } elseif ($value=='') { - $this->array_options[$key] = null; + $new_array_options[$key] = null; } break; /*case 'select': // Not required, we chosed value='0' for undefined values @@ -4304,13 +4304,13 @@ abstract class CommonObject } break;*/ case 'price': - $this->array_options[$key] = price2num($this->array_options[$key]); + $new_array_options[$key] = price2num($this->array_options[$key]); break; case 'date': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + $new_array_options[$key] = $this->db->idate($this->array_options[$key]); break; case 'datetime': - $this->array_options[$key]=$this->db->idate($this->array_options[$key]); + $new_array_options[$key] = $this->db->idate($this->array_options[$key]); break; case 'link': $param_list=array_keys($attributeParam ['options']); @@ -4326,7 +4326,7 @@ abstract class CommonObject if (is_numeric($value)) $res=$object->fetch($value); else $res=$object->fetch('',$value); - if ($res > 0) $this->array_options[$key]=$object->id; + if ($res > 0) $new_array_options[$key]=$object->id; else { $this->error="Ref '".$value."' for object '".$object->element."' not found"; @@ -4366,9 +4366,9 @@ abstract class CommonObject // Add field o fattribut if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) { - if ($this->array_options[$key] != '') + if ($new_array_options[$key] != '') { - $sql.=",'".$this->db->escape($this->array_options[$key])."'"; + $sql.=",'".$this->db->escape($new_array_options[$key])."'"; } else { From f963afa50528f30c1c0bc58cf1e902bbdf0b5624 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 15:21:17 +0200 Subject: [PATCH 0281/1137] Fix warning --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 920ddefb964..d3b76345ccb 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1128,13 +1128,13 @@ class ExtraFields $form = new Form($db); $value_arr=explode(',',$value); - $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, $param['options'], $value_arr, '', 0, '', 0, '100%'); + $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, (empty($param['options'])?null:$param['options']), $value_arr, '', 0, '', 0, '100%'); } elseif ($type == 'radio') { $out=''; - foreach ($param['options'] as $keyopt=>$val ) + foreach ($param['options'] as $keyopt => $val) { $out.=' Date: Sun, 3 Sep 2017 15:21:17 +0200 Subject: [PATCH 0282/1137] Fix warning --- htdocs/core/class/extrafields.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a01f97431ef..e2e036c3700 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1062,13 +1062,13 @@ class ExtraFields $form = new Form($db); $value_arr=explode(',',$value); - $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, $param['options'], $value_arr, '', 0, '', 0, '100%'); + $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, (empty($param['options'])?null:$param['options']), $value_arr, '', 0, '', 0, '100%'); } elseif ($type == 'radio') { $out=''; - foreach ($param['options'] as $keyopt=>$val ) + foreach ($param['options'] as $keyopt => $val) { $out.=' Date: Sun, 3 Sep 2017 15:40:36 +0200 Subject: [PATCH 0283/1137] Use return code on activateAll and closeAll --- htdocs/contrat/class/contrat.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9d6f4cce856..9a5edc845b4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -252,7 +252,7 @@ class Contrat extends CommonObject * * @param User $user Object User making action * @param int|string $date_start Date start (now if empty) - * @return void + * @return int <0 if KO, >0 if OK */ function activateAll($user, $date_start='') { @@ -287,19 +287,21 @@ class Contrat extends CommonObject if ($ok) { $this->db->commit(); + return 0; } else { dol_print_error($this->db,'Error in activateAll function'); $this->db->rollback(); + return -1; } } /** * Close all lines of a contract * - * @param User $user Object User making action - * @return void + * @param User $user Object User making action + * @return int <0 if KO, >0 if OK */ function closeAll($user) { @@ -335,11 +337,13 @@ class Contrat extends CommonObject if ($ok) { $this->db->commit(); + return 1; } else { dol_print_error($this->db,'Error in closeAll function'); $this->db->rollback(); + return -1; } } From 084ea049d8443c68c3d435dd2309dc39f0646e7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 16:07:21 +0200 Subject: [PATCH 0284/1137] Minor bugs --- ChangeLog | 5 +++++ htdocs/compta/facture/class/facture.class.php | 8 ++++---- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 481f86bcb31..144f39a574b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ English Dolibarr ChangeLog ***** ChangeLog for 7.0.0 compared to 6.0.* ***** +WARNING: + +Following changes may create regression for some external modules, but were necessary to make Dolibarr better: +* The methode "cloture" on contact were renamed into "closeAll". + ***** ChangeLog for 6.0.0 compared to 5.0.* ***** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f864b363cc4..0aa2408a9cc 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -316,7 +316,7 @@ class Facture extends CommonInvoice $this->note_private=dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->ref)); $this->array_options=$_facrec->array_options; - + //if (! $this->remise) $this->remise = 0; if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; $this->brouillon = 1; @@ -636,7 +636,7 @@ class Facture extends CommonInvoice if (empty($tva_tx)) $tva_npr=0; $localtax1_tx=get_localtax($tva_tx,1,$soc,$mysoc,$tva_npr); $localtax2_tx=get_localtax($tva_tx,2,$soc,$mysoc,$tva_npr); - + $result_insert = $this->addline( $_facrec->lines[$i]->desc, $_facrec->lines[$i]->subprice, @@ -750,12 +750,12 @@ class Facture extends CommonInvoice // Charge facture source $facture=new Facture($this->db); - + $this->fetch_optionals(); if(!empty($this->array_options)){ $facture->array_options = $this->array_options; } - + foreach($this->lines as &$line){ $line->fetch_optionals();//fetch extrafields } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9a5edc845b4..8fa3ef38872 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -287,7 +287,7 @@ class Contrat extends CommonObject if ($ok) { $this->db->commit(); - return 0; + return 1; } else { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 22dc96a0c8b..5360350c75c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -673,7 +673,7 @@ class Societe extends CommonObject if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { $langs->load("errors"); - $error++; $this->errors[] = $langs->transcountry('ProfId'.$i, $this->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } From 75b8462c03db84cc0c8b38bf8fe6ae2ee98c88de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2017 17:47:45 +0200 Subject: [PATCH 0285/1137] Fix error output --- htdocs/societe/card.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index bc62e71dd04..cfaf6932b73 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -95,6 +95,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'ro + /* * Actions */ @@ -310,19 +311,19 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors'); $error++; - $action='create'; + $action=($action=='add'?'create':'edit'); } if (GETPOST('client') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors'); $error++; - $action='create'; + $action=($action=='add'?'create':'edit'); } if (GETPOST('fournisseur') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); $error++; - $action='create'; + $action=($action=='add'?'create':'edit'); } if ($action == 'update') @@ -653,7 +654,7 @@ if (empty($reshook)) } } else - { + { switch($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -683,7 +684,7 @@ if (empty($reshook)) if (! $error && ! count($errors)) { - if (! empty($backtopage)) + if (! empty($backtopage)) { header("Location: ".$backtopage); exit; @@ -703,7 +704,7 @@ if (empty($reshook)) } else { - $action='create'; + $action = ($action=='add'?'create':'edit'); } } @@ -756,7 +757,6 @@ if (empty($reshook)) } - /* * View */ @@ -1356,11 +1356,12 @@ else * Edition */ + //print load_fiche_titre($langs->trans("EditCompany")); if ($socid) { - $res=$object->fetch_optionals($object->id,$extralabels); + $res=$object->fetch_optionals($object->id,$extralabels); //if ($res < 0) { dol_print_error($db); exit; } $head = societe_prepare_head($object); @@ -1466,8 +1467,6 @@ else } } - dol_htmloutput_errors($error,$errors); - if($object->localtax1_assuj==0){ $sub=0; }else{$sub=1;} @@ -1475,7 +1474,6 @@ else $sub2=0; }else{$sub2=1;} - print "\n".''; print load_fiche_titre($langs->trans("NewMenu"),'','title_setup'); - - print ''; + + print ''; print ''; dol_fiche_head(); - + print ''; // Id - $parent_rowid = $_GET['menuId']; - if ($_GET['menuId']) + $parent_rowid = GETPOST('menuId', 'int'); + if (GETPOST('menuId', 'int')) { $sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int'); $res = $db->query($sql); @@ -375,40 +374,40 @@ if ($action == 'create') } else { - print ''; + print ''; } print ''; // Title - print ''; + print ''; // URL - print ''; + print ''; // Langs print ''; // Position - print ''; + print ''; // Target print ''; // Enabled - print ''; + print ''; // Perms - print ''; + print ''; print '
        '.$langs->trans('DetailMenuIdParent'); print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def'; print '
        '.$langs->trans('Title').''.$langs->trans('DetailTitre').'
        '.$langs->trans('Title').''.$langs->trans('DetailTitre').'
        '.$langs->trans('URL').''.$langs->trans('DetailUrl').'
        '.$langs->trans('URL').''.$langs->trans('DetailUrl').'
        '.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
        '.$langs->trans('Position').''.$langs->trans('DetailPosition').'
        '.$langs->trans('Position').''.$langs->trans('DetailPosition').'
        '.$langs->trans('Target').''.$langs->trans('DetailTarget').'
        '.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
        '.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
        '.$langs->trans('Rights').''.$langs->trans('DetailRight').'
        '.$langs->trans('Rights').''.$langs->trans('DetailRight').'
        '; dol_fiche_end(); - + // Boutons print '
        '; print ''; @@ -426,14 +425,14 @@ elseif ($action == 'edit') print ''; print ''; print ''; - print ''; + print ''; dol_fiche_head(); - + print ''; $menu = new Menubase($db); - $result=$menu->fetch($_GET['menuId']); + $result=$menu->fetch(GETPOST('menuId', 'int')); //var_dump($menu); // Id @@ -472,20 +471,20 @@ elseif ($action == 'edit') //print ''; // Title - print ''; + print ''; // Url print ''; // Langs - print ''; + print ''; // Position print ''; // Target print ''; @@ -502,7 +501,7 @@ elseif ($action == 'edit') print '
        '.$langs->trans('Level').''.$menu->level.''.$langs->trans('DetailLevel').'
        '.$langs->trans('Title').''.$langs->trans('DetailTitre').'
        '.$langs->trans('Title').''.$langs->trans('DetailTitre').'
        '.$langs->trans('URL').''.$langs->trans('DetailUrl').'
        '.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
        '.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
        '.$langs->trans('Position').''.$langs->trans('DetailPosition').'
        '.$langs->trans('Target').''.$langs->trans('DetailTarget').'
        '; dol_fiche_end(); - + // Bouton print '
        '; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d79c3def247..ee683f5747d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3251,7 +3251,12 @@ function dol_print_error($db='',$error='',$errors=null) } if (empty($dolibarr_main_prod)) print $out; - else define("MAIN_CORE_ERROR", 1); + else + { + print $langs->trans("DolibarrHasDetectedError").'. '; + print $langs->trans("YouCanSetOptionDolibarrMainProdToZero"); + define("MAIN_CORE_ERROR", 1); + } //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.'; dol_syslog("Error ".$syslog, LOG_ERR); } diff --git a/htdocs/document.php b/htdocs/document.php index 206ea69688a..d35021005e6 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -110,7 +110,7 @@ if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; -$original_file = $check_access['original_file']; // original_file is now a full path name +$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name // Basic protection (against external users only) if ($user->societe_id > 0) @@ -137,36 +137,35 @@ if ($user->societe_id > 0) } // Security: -// Limite acces si droits non corrects +// Limit access if permissions are wrong if (! $accessallowed) { accessforbidden(); } // Security: -// On interdit les remontees de repertoire ainsi que les pipe dans -// les noms de fichiers. -if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file)) +// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers. +if (preg_match('/\.\./',$fullpath_original_file) || preg_match('/[<>|]/',$fullpath_original_file)) { - dol_syslog("Refused to deliver file ".$original_file); - $file=basename($original_file); // Do no show plain path of original_file in shown error message - dol_print_error(0,$langs->trans("ErrorFileNameInvalid",$file)); + dol_syslog("Refused to deliver file ".$fullpath_original_file); + print "ErrorFileNameInvalid: ".$original_file; exit; } clearstatcache(); -$filename = basename($original_file); +$filename = basename($fullpath_original_file); // Output file on browser -dol_syslog("document.php download $original_file $filename content-type=$type"); -$original_file_osencoded=dol_osencode($original_file); // New file name encoded in OS encoding charset +dol_syslog("document.php download $fullpath_original_file filename=$filename content-type=$type"); +$fullpath_original_file_osencoded=dol_osencode($fullpath_original_file); // New file name encoded in OS encoding charset // This test if file exists should be useless. We keep it to find bug more easily -if (! file_exists($original_file_osencoded)) +if (! file_exists($fullpath_original_file_osencoded)) { - dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$original_file)); + dol_syslog("ErrorFileDoesNotExists: ".$fullpath_original_file); + print "ErrorFileDoesNotExists: ".$original_file; exit; } @@ -177,7 +176,7 @@ if ($encoding) header('Content-Encoding: '.$encoding); // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, atachment=need user action to open) if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"'); else header('Content-Disposition: inline; filename="'.$filename.'"'); -header('Content-Length: ' . dol_filesize($original_file)); +header('Content-Length: ' . dol_filesize($fullpath_original_file)); // Ajout directives pour resoudre bug IE header('Cache-Control: Public, must-revalidate'); header('Pragma: public'); @@ -185,6 +184,6 @@ header('Pragma: public'); //ob_clean(); //flush(); -readfile($original_file_osencoded); +readfile($fullpath_original_file_osencoded); if (is_object($db)) $db->close(); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d5cbd14c11d..a314f59b6b5 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -103,7 +103,8 @@ RequestLastAccessInError=Latest database access request error ReturnCodeLastAccessInError=Return code for latest database access request error InformationLastAccessInError=Information for latest database access request error DolibarrHasDetectedError=Dolibarr has detected a technical error -InformationToHelpDiagnose=This information can be useful for diagnostic purposes +YouCanSetOptionDolibarrMainProdToZero=You can read log file or set option $dolibarr_main_prod to '0' in your config file to get more information. +InformationToHelpDiagnose=This information can be useful for diagnostic purposes (you can set option $dolibarr_main_prod to '1' to remove such notices) MoreInformation=More information TechnicalInformation=Technical information TechnicalID=Technical ID diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8d34517686b..cd5cb0ba296 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -77,38 +77,39 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP */ function test_sql_and_script_inject($val, $type) { - $sql_inj = 0; + $inj = 0; // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) if ($type != 2) { - $sql_inj += preg_match('/delete\s+from/i', $val); - $sql_inj += preg_match('/create\s+table/i', $val); - $sql_inj += preg_match('/update.+set.+=/i', $val); - $sql_inj += preg_match('/insert\s+into/i', $val); - $sql_inj += preg_match('/select.+from/i', $val); - $sql_inj += preg_match('/union.+select/i', $val); - $sql_inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); - $sql_inj += preg_match('/(\.\.%2f)+/i', $val); + $inj += preg_match('/delete\s+from/i', $val); + $inj += preg_match('/create\s+table/i', $val); + $inj += preg_match('/update.+set.+=/i', $val); + $inj += preg_match('/insert\s+into/i', $val); + $inj += preg_match('/select.+from/i', $val); + $inj += preg_match('/union.+select/i', $val); + $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); + $inj += preg_match('/(\.\.%2f)+/i', $val); } // For XSS Injection done by adding javascript with script // This is all cases a browser consider text is javascript: // When it found ' - $sql_inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like - $sql_inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like + $inj += preg_match('/'; + $result=test_sql_and_script_inject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject ccc'); + + $test=''; + $result=test_sql_and_script_inject($test, 1); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject ddd'); + + $test='">'; + $result=test_sql_and_script_inject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject eee'); + + $test=' + '; + $result=test_sql_and_script_inject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject eee'); + + $test=""; // Is locked by some brwoser like chrome because the default directive no-referrer-when-downgrade is sent when requesting the SRC and then refused because of browser protection on img src load without referrer. + $test=""; // Same + + $test=''; + $result=test_sql_and_script_inject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject fff1'); + $test=''; + $result=test_sql_and_script_inject($test, 0); + $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject fff2'); + + // This case seems to be filtered by browsers now. + $test=''; + //$result=test_sql_and_script_inject($test, 0); + //$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject ggg'); + + $test='';*/ - } - else - { - print '

        '.$langs->trans("PreviewOfSiteNotYetAvailable", $website).'


        '; - print '
        '; - } + } + else + { + print '

        '.$langs->trans("PreviewOfSiteNotYetAvailable", $website).'


        '; + print '
        '; + } } From d1ad6e02638916b47e6a2559fb69f46807cda78e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 13:16:39 +0200 Subject: [PATCH 0985/1137] Update card.php --- htdocs/contrat/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index fc88c5697b4..c412ad11e32 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -442,7 +442,7 @@ if (empty($reshook)) $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); - if (!empty($date_end) && $date_start > $date_end) + if (!empty($date_start) && !empty($date_end) && $date_start > $date_end) { setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); $error++; @@ -646,7 +646,7 @@ if (empty($reshook)) else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha')) { - if (!empty($date_end_update) && $date_start_update > $date_end_update) + if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) { setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); $action = 'editline'; From 1b399dc8dd304308b00a867c717a1e5767108318 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 13:28:04 +0200 Subject: [PATCH 0986/1137] Update api_invoices.class.php --- .../facture/class/api_invoices.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index c0e3b6bbfcc..4531a0587cc 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -310,9 +310,9 @@ class Invoices extends DolibarrApi * Deletes a line of a given invoice * * @param int $id Id of invoice - * @param int $rowid Id of the line to delete + * @param int $lineid Id of the line to delete * - * @url DELETE {id}/deleteline + * @url DELETE {id}/deleteline/{lineid} * * @return array * @throws 304 @@ -320,13 +320,17 @@ class Invoices extends DolibarrApi * @throws 401 * @throws 404 */ - function deleteLine($id, $rowid) { + function deleteLine($id, $lineid) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } - if(empty($rowid)) { - throw new RestException(400, 'RowID is mandatory'); + if(empty($lineid)) { + throw new RestException(400, 'Line ID is mandatory'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } $result = $this->invoice->fetch($id); @@ -334,17 +338,13 @@ class Invoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - - $result = $this->invoice->deleteline($rowid); + $result = $this->invoice->deleteline($lineid); if( $result < 0) { throw new RestException(304); } $result = $this->invoice->fetch($id); - if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } $this->invoice->getLinesArray(); $result = array(); foreach ($this->invoice->lines as $line) { From af1d2bfffdec4d176c710b802ed2f392a7c3a97c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 14:11:01 +0200 Subject: [PATCH 0987/1137] Standardize code --- .../comm/propal/class/api_proposals.class.php | 9 +- .../class/api_deprecated_commande.class.php | 2 +- htdocs/commande/class/api_orders.class.php | 9 +- .../facture/class/api_invoices.class.php | 26 ++-- .../class/api_expensereports.class.php | 140 +++++++++--------- 5 files changed, 96 insertions(+), 90 deletions(-) diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 7dda7031914..325fad1a326 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -370,8 +370,10 @@ class Proposals extends DolibarrApi * @url DELETE {id}/lines/{lineid} * * @return int + * @throws 401 + * @throws 404 */ - function delLine($id, $lineid) { + function deleteLine($id, $lineid) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } @@ -384,9 +386,10 @@ class Proposals extends DolibarrApi if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $request_data = (object) $request_data; + + $request_data = (object) $request_data; $updateRes = $this->propal->deleteline($lineid); - if ($updateRes == 1) { + if ($updateRes > 0) { return $this->get($id); } return false; diff --git a/htdocs/commande/class/api_deprecated_commande.class.php b/htdocs/commande/class/api_deprecated_commande.class.php index 11d3fe7260a..d41fd9cee1d 100644 --- a/htdocs/commande/class/api_deprecated_commande.class.php +++ b/htdocs/commande/class/api_deprecated_commande.class.php @@ -389,7 +389,7 @@ class CommandeApi extends DolibarrApi * * @return int */ - function delLine($id, $lineid) { + function deleteLine($id, $lineid) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index d4b4502d4ed..6ffca33a4ce 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -353,14 +353,16 @@ class Orders extends DolibarrApi * Delete a line to given order * * - * @param int $id Id of commande to update + * @param int $id Id of order to update * @param int $lineid Id of line to delete * * @url DELETE {id}/lines/{lineid} * * @return int + * @throws 401 + * @throws 404 */ - function delLine($id, $lineid) { + function deleteLine($id, $lineid) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } @@ -373,7 +375,8 @@ class Orders extends DolibarrApi if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $request_data = (object) $request_data; + + $request_data = (object) $request_data; $updateRes = $this->commande->deleteline(DolibarrApiAccess::$user,$lineid); if ($updateRes > 0) { return $this->get($id); diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 4531a0587cc..d8a5a231593 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -312,13 +312,13 @@ class Invoices extends DolibarrApi * @param int $id Id of invoice * @param int $lineid Id of the line to delete * - * @url DELETE {id}/deleteline/{lineid} + * @url DELETE {id}/lines/{lineid} * * @return array - * @throws 304 * @throws 400 * @throws 401 * @throws 404 + * @throws 405 */ function deleteLine($id, $lineid) { @@ -340,7 +340,7 @@ class Invoices extends DolibarrApi $result = $this->invoice->deleteline($lineid); if( $result < 0) { - throw new RestException(304); + throw new RestException(405, $this->invoice->error); } $result = $this->invoice->fetch($id); @@ -355,11 +355,11 @@ class Invoices extends DolibarrApi - + /** * Add a line to a given invoice - * - * Exemple of POST query : { "desc": "Desc", "subprice": "1.00000000", "qty": "1", "tva_tx": "20.000", "localtax1_tx": "0.000", "localtax2_tx": "0.000", "fk_product": "1", "remise_percent": "0", "date_start": "", "date_end": "", "fk_code_ventilation": 0, "info_bits": "0", "fk_remise_except": null, "product_type": "1", "rang": "-1", "special_code": "0", "fk_parent_line": null, "fk_fournprice": null, "pa_ht": "0.00000000", "label": "", "array_options": [], "situation_percent": "100", "fk_prev_id": null, "fk_unit": null } + * + * Exemple of POST query : { "desc": "Desc", "subprice": "1.00000000", "qty": "1", "tva_tx": "20.000", "localtax1_tx": "0.000", "localtax2_tx": "0.000", "fk_product": "1", "remise_percent": "0", "date_start": "", "date_end": "", "fk_code_ventilation": 0, "info_bits": "0", "fk_remise_except": null, "product_type": "1", "rang": "-1", "special_code": "0", "fk_parent_line": null, "fk_fournprice": null, "pa_ht": "0.00000000", "label": "", "array_options": [], "situation_percent": "100", "fk_prev_id": null, "fk_unit": null } * * @param int $id Id of invoice * @param array $request_data Invoiceline data @@ -381,14 +381,14 @@ class Invoices extends DolibarrApi if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - - $request_data = (object) $request_data; - + + $request_data = (object) $request_data; + // Reset fk_parent_line for no child products and special product if (($request_data->product_type != 9 && empty($request_data->fk_parent_line)) || $request_data->product_type == 9) { $request_data->fk_parent_line = 0; - } - + } + $updateRes = $this->invoice->addline( $request_data->desc, $request_data->subprice, @@ -436,13 +436,13 @@ class Invoices extends DolibarrApi * @url POST {id}/settodraft * * @return array - * + * * @throws 200 * @throws 304 * @throws 401 * @throws 404 * @throws 500 - * + * */ function settodraft($id, $idwarehouse=-1) { diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 58783ba69b3..d1f123b791f 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur - * + * * 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 3 of the License, or @@ -23,14 +23,14 @@ /** * API class for Expense Reports * - * @access protected + * @access protected * @class DolibarrApiAccess {@requires user,external} */ class ExpenseReports extends DolibarrApi { /** - * @var array $FIELDS Mandatory fields, checked when create and update object + * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( 'socid' @@ -41,7 +41,7 @@ class ExpenseReports extends DolibarrApi */ public $expensereport; - + /** * Constructor */ @@ -56,36 +56,36 @@ class ExpenseReports extends DolibarrApi * Get properties of a Expense Report object * * Return an array with Expense Report informations - * + * * @param int $id ID of Expense Report * @return array|mixed Data without useless information * * @throws RestException */ function get($id) - { + { if(! DolibarrApiAccess::$user->rights->expensereport->lire) { throw new RestException(401); } - + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'Expense report not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $this->expensereport->fetchObjectLinked(); return $this->_cleanObjectDatas($this->expensereport); } /** * List Expense Reports - * + * * Get a list of Expense Reports - * + * * @param string $sortfield Sort field * @param string $sortorder Sort order * @param int $limit Limit for list @@ -96,19 +96,19 @@ class ExpenseReports extends DolibarrApi */ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $user_ids = 0, $sqlfilters = '') { global $db, $conf; - + $obj_ret = array(); // case of external user, $societe param is ignored and replaced by user's socid //$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $societe; - + $sql = "SELECT t.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as t"; $sql.= ' WHERE t.entity IN ('.getEntity('expensereport').')'; if ($user_ids) $sql.=" AND t.fk_user_author IN (".$user_ids.")"; - + // Add sql filters - if ($sqlfilters) + if ($sqlfilters) { if (! DolibarrApi::_checkFilters($sqlfilters)) { @@ -117,7 +117,7 @@ class ExpenseReports extends DolibarrApi $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql.= $db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) @@ -130,7 +130,7 @@ class ExpenseReports extends DolibarrApi } $result = $db->query($sql); - + if ($result) { $num = $db->num_rows($result); @@ -181,7 +181,7 @@ class ExpenseReports extends DolibarrApi if ($this->expensereport->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, "Error creating expensereport", array_merge(array($this->expensereport->error), $this->expensereport->errors)); } - + return $this->expensereport->id; } @@ -189,22 +189,22 @@ class ExpenseReports extends DolibarrApi * Get lines of an Expense Report * * @param int $id Id of Expense Report - * + * * @url GET {id}/lines - * - * @return int + * + * @return int */ -/* +/* function getLines($id) { if(! DolibarrApiAccess::$user->rights->expensereport->lire) { throw new RestException(401); } - + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'expensereport not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -216,28 +216,28 @@ class ExpenseReports extends DolibarrApi return $result; } */ - + /** * Add a line to given Expense Report * * @param int $id Id of Expense Report to update - * @param array $request_data Expense Report data - * + * @param array $request_data Expense Report data + * * @url POST {id}/lines - * - * @return int + * + * @return int */ -/* +/* function postLine($id, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } - + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'expensereport not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -277,29 +277,29 @@ class ExpenseReports extends DolibarrApi return false; } */ - + /** * Update a line to given Expense Report * * @param int $id Id of Expense Report to update * @param int $lineid Id of line to update - * @param array $request_data Expense Report data - * + * @param array $request_data Expense Report data + * * @url PUT {id}/lines/{lineid} - * - * @return object + * + * @return object */ /* function putLine($id, $lineid, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } - + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'expensereport not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -342,22 +342,22 @@ class ExpenseReports extends DolibarrApi * * @param int $id Id of Expense Report to update * @param int $lineid Id of line to delete - * + * * @url DELETE {id}/lines/{lineid} - * - * @return int + * + * @return int */ /* - function delLine($id, $lineid) { + function deleteLine($id, $lineid) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } - + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'expensereport not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -369,26 +369,26 @@ class ExpenseReports extends DolibarrApi return false; } */ - + /** * Update Expense Report general fields (won't touch lines of expensereport) * * @param int $id Id of Expense Report to update - * @param array $request_data Datas - * - * @return int + * @param array $request_data Datas + * + * @return int */ /* function put($id, $request_data = NULL) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } - + $result = $this->expensereport->fetch($id); if( ! $result ) { throw new RestException(404, 'expensereport not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -396,19 +396,19 @@ class ExpenseReports extends DolibarrApi if ($field == 'id') continue; $this->expensereport->$field = $value; } - + if($this->expensereport->update(DolibarrApiAccess::$user)) return $this->get($id); - + return false; } */ - + /** * Delete Expense Report * * @param int $id Expense Report ID - * + * * @return array */ function delete($id) @@ -420,31 +420,31 @@ class ExpenseReports extends DolibarrApi if( ! $result ) { throw new RestException(404, 'Expense Report not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + if( ! $this->expensereport->delete(DolibarrApiAccess::$user)) { throw new RestException(500, 'Error when delete Expense Report : '.$this->expensereport->error); } - + return array( 'success' => array( 'code' => 200, 'message' => 'Expense Report deleted' ) ); - + } - + /** * Validate an Expense Report - * + * * @param int $id Expense Report ID - * + * * @url POST {id}/validate - * + * * @return array * FIXME An error 403 is returned if the request has an empty body. * Error message: "Forbidden: Content type `text/plain` is not supported." @@ -463,15 +463,15 @@ class ExpenseReports extends DolibarrApi if( ! $result ) { throw new RestException(404, 'expensereport not found'); } - + if( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + if( ! $this->expensereport->valid(DolibarrApiAccess::$user, $idwarehouse)) { throw new RestException(500, 'Error when validate expensereport'); } - + return array( 'success' => array( 'code' => 200, @@ -479,12 +479,12 @@ class ExpenseReports extends DolibarrApi ) ); }*/ - + /** * Validate fields before create or update object - * + * * @param array $data Array with data to verify - * @return array + * @return array * @throws RestException */ function _validate($data) @@ -494,7 +494,7 @@ class ExpenseReports extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $expensereport[$field] = $data[$field]; - + } return $expensereport; } From 6271c909042ffe6ad95eb561204974b0e04a589c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 14:15:47 +0200 Subject: [PATCH 0988/1137] Update list.php --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 32cc341ef3a..4d4021adc3a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -210,7 +210,7 @@ $sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_ $sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; -$sql.= " MIN(CASE WHEN cd.statut=4 THEN cd.date_fin_validite END) as first_date_fin_validite,"; +$sql.= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as first_date_fin_validite,"; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,'; From 5d24aa48309d548a937114ee88f81a99df90c0f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 14:54:31 +0200 Subject: [PATCH 0989/1137] Fix sql --- htdocs/contrat/list.php | 48 ++++++++++++++++++------------- htdocs/langs/en_US/companies.lang | 1 + htdocs/langs/en_US/contracts.lang | 3 +- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index dccf44399e0..0869c3d28ed 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -46,10 +46,6 @@ $show_files=GETPOST('show_files','int'); $confirm=GETPOST('confirm','alpha'); $toselect = GETPOST('toselect', 'array'); -$dfmonth=GETPOST('dfmonth')?GETPOST('dfmonth'):date("n"); -$dfyear=GETPOST('dfyear'); -$filter_op2df=GETPOST('filter_op2df'); - $search_name=GETPOST('search_name'); $search_email=GETPOST('search_email'); $search_town=GETPOST('search_town','alpha'); @@ -66,6 +62,9 @@ $socid=GETPOST('socid'); $search_user=GETPOST('search_user','int'); $search_sale=GETPOST('search_sale','int'); $search_product_category=GETPOST('search_product_category','int'); +$search_dfmonth=GETPOST('search_dfmonth','int'); +$search_dfyear=GETPOST('search_dfyear','int'); +$search_op2df=GETPOST('search_op2df'); $day=GETPOST("day","int"); $year=GETPOST("year","int"); $month=GETPOST("month","int"); @@ -130,7 +129,7 @@ $arrayfields=array( 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1), 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'first_date_fin_validite'=>array('label'=>"1er ".$langs->trans("DateEndPlannedShort"), 'checked'=>1, 'position'=>900), + 'lower_planned_end_date'=>array('label'=>$langs->trans("LowerDateEndPlannedShort"), 'checked'=>1, 'position'=>900), 'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), ); // Extra fields @@ -162,9 +161,9 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $day=''; $month=''; $year=''; - $dfmonth=''; - $dfyear=''; - $filter_op2df=''; + $search_dfmonth=''; + $search_dfyear=''; + $search_op2df=''; $search_name=""; $search_email=""; $search_town=''; @@ -213,7 +212,7 @@ $sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_ $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; -$sql.= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as first_date_fin_validite,"; +$sql.= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as lower_planned_end_date,"; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,'; @@ -287,10 +286,16 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; +if ($search_dfyear > 0) +{ +// $sql.= " AND MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") ".$search_op2df."= '".$db->idate(($search_op2df == "<" ? dol_get_last_day($search_dfyear,$search_dfmonth,false) : dol_get_first_day($search_dfyear,$search_dfmonth,false)))."'"; +} + $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,"; $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql.= " typent.code,"; $sql.= " state.code_departement, state.nom"; +//$sql.= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").")"; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); // Add where from hooks @@ -298,9 +303,9 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -if ($dfyear > 0) +if ($search_dfyear > 0) { - $sql.= " HAVING first_date_fin_validite ".$filter_op2df."= '".$db->idate(($filter_op2df == "<" ? dol_get_last_day($dfyear,$dfmonth,false) : dol_get_first_day($dfyear,$dfmonth,false)))."'"; + $sql.= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") ".$search_op2df."= '".$db->idate(($search_op2df == "<" ? dol_get_last_day($search_dfyear,$search_dfmonth,false) : dol_get_first_day($search_dfyear,$search_dfmonth,false)))."'"; } $sql.= $db->order($sortfield,$sortorder); @@ -345,6 +350,9 @@ if ($resql) if ($search_email != '') $param.='&search_email='.urlencode($search_email); if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer); if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier); + if ($search_op2df != '') $param.='&search_op2df='.urlencode($search_op2df); + if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear); + if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth); if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale); if ($show_files) $param.='&show_files=' .urlencode($show_files); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); @@ -552,16 +560,16 @@ if ($resql) print ''; print ''; } - // 1er Date de fin - if (! empty($arrayfields['first_date_fin_validite']['checked'])) + // First end date + if (! empty($arrayfields['lower_planned_end_date']['checked'])) { print ''; $arrayofoperators=array('<'=>'<','>'=>'>'); - print $form->selectarray('filter_op2df',$arrayofoperators,$filter_op2df,0); + print $form->selectarray('search_op2df',$arrayofoperators,$search_op2df,0); print '
        '; - print $formother->select_month($dfmonth,'dfmonth'); + print $formother->select_month($search_dfmonth, 'search_dfmonth', 1); print ' '; - $formother->select_year($dfyear,'dfyear',1, 20, 5); + $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5); print ''; } // Status @@ -608,7 +616,7 @@ if ($resql) print $hookmanager->resPrint; if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['first_date_fin_validite']['checked'])) print_liste_field_titre($arrayfields['first_date_fin_validite']['label'],$_SERVER["PHP_SELF"],"first_date_fin_validite","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['status']['checked'])) { print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"'); @@ -797,11 +805,11 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - // Date 1er date fin - if (! empty($arrayfields['first_date_fin_validite']['checked'])) + // Date lower end date + if (! empty($arrayfields['lower_planned_end_date']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->first_date_fin_validite), 'day'); + print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day'); print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index a7e7c67ae9c..778ac05fdfb 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -29,6 +29,7 @@ AliasNameShort=Alias name Companies=Companies CountryIsInEEC=Country is inside European Economic Community ThirdPartyName=Third party name +ThirdPartyEmail=Third party email ThirdParty=Third party ThirdParties=Third parties ThirdPartyProspects=Prospects diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 63d3c403e50..e0642b27c02 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -88,7 +88,8 @@ ContactNameAndSignature=For %s, name and signature: OnlyLinesWithTypeServiceAreUsed=Only lines with type "Service" will be cloned. CloneContract=Clone contract ConfirmCloneContract=Are you sure you want to clone the contract %s? - +LowerDateEndPlannedShort=Lower planned end date of active services +SendContractRef=Contract information __REF__ ##### Types de contacts ##### TypeContact_contrat_internal_SALESREPSIGN=Sales representative signing contract TypeContact_contrat_internal_SALESREPFOLL=Sales representative following-up contract From c771ce524f0a85f97489d69ea2324e1a021a189c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 18:25:04 +0200 Subject: [PATCH 0990/1137] Fix lose filter --- htdocs/contrat/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 0869c3d28ed..dfc00f95e11 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -354,6 +354,8 @@ if ($resql) if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear); if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth); if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale); + if ($search_user != '') $param.='&search_user=' .urlencode($search_user); + if ($search_product_category != '') $param.='&search_product_category=' .urlencode($search_product_category); if ($show_files) $param.='&show_files=' .urlencode($show_files); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields From 6401c8a58e72d5de3b9a189090510dd34f9354e4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 7 Oct 2017 20:05:02 +0200 Subject: [PATCH 0991/1137] NEW add doActions hook in admin ihm --- htdocs/admin/ihm.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 9d140d5a370..256dd08f9a8 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -1,8 +1,8 @@ +/* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2016 Juanjo Menent * * 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 @@ -47,14 +47,21 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','aZ09'); - if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$contextpage=array('adminihm','globaladmin'); +$hookmanager->initHooks($contextpage); + /* * Action */ +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (GETPOST('cancel','alpha')) { $action=''; From f89676126eb9beb0bbc72a81d0d78758626aab95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 20:11:35 +0200 Subject: [PATCH 0992/1137] Update translation tools --- dev/translation/txpush.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/translation/txpush.sh b/dev/translation/txpush.sh index 05ec107b6ff..f64b60f9d3b 100755 --- a/dev/translation/txpush.sh +++ b/dev/translation/txpush.sh @@ -15,7 +15,7 @@ then echo "This push local files to transifex for project $project." echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer." echo " Using -f will overwrite translation but not memory." - echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r dolibarr.file] [-f] [--no-interactive]" + echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r ".$project.".file] [-f] [--no-interactive]" exit fi From e40bffb0d54e85eef649f97a1034493cf2369f11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 20:21:47 +0200 Subject: [PATCH 0993/1137] Fix bug reported by scrutinizer --- .../adherents/class/adherent_type.class.php | 4 ++-- htdocs/api/class/api_documents.class.php | 4 ++-- htdocs/compta/bank/class/account.class.php | 7 ++----- htdocs/fichinter/class/fichinter.class.php | 2 ++ .../class/fournisseur.commande.class.php | 20 +++++++++---------- htdocs/product/class/product.class.php | 7 ++----- 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 5537730e678..f5f6a161ec5 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -55,9 +55,9 @@ class AdherentType extends CommonObject * @since 5.0 */ public $subscription; - /** @var string Public note */ + /** @var string Public note */ public $note; - /** @var bool Can vote*/ + /** @var integer Can vote */ public $vote; /** @var string Email sent during validation */ public $mail_valid; diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 9ac5b643476..52ed728a769 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -68,7 +68,7 @@ class Documents extends DolibarrApi */ public function index($module_part, $original_file='', $regeneratedoc=0) { - global $conf; + global $conf, $langs; if (empty($module_part)) { throw new RestException(400, 'bad value for parameter modulepart'); @@ -108,7 +108,7 @@ class Documents extends DolibarrApi if( ! $result ) { throw new RestException(404, 'Invoice not found'); } - $result = $this->invoice->generateDocument($this->invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + $result = $this->invoice->generateDocument($this->invoice->modelpdf, $langs, $hidedetails, $hidedesc, $hideref); if( $result <= 0 ) { throw new RestException(500, 'Error generating document'); } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 0167b725dfd..23818d4aa9d 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1306,11 +1306,8 @@ class Account extends CommonObject } $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; - if (empty($mode)) - { - $url = DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id; - } - else if ($mode == 'transactions') + $url = DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id; + if ($mode == 'transactions') { $url = DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$this->id; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index f9b6bddf80c..68096eea8e9 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1562,6 +1562,8 @@ class FichinterLigne extends CommonObjectLine { global $langs,$conf; + $error=0; + if ($this->statut == 0) { dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 760caf8f385..0b8d45b18ad 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1981,10 +1981,16 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->receptionner) { + // Define the new status if ($type == 'par') $statut = self::STATUS_RECEIVED_PARTIALLY; - if ($type == 'tot') $statut = self::STATUS_RECEIVED_COMPLETELY; - if ($type == 'nev') $statut = self::STATUS_CANCELED_AFTER_ORDER; - if ($type == 'can') $statut = self::STATUS_CANCELED_AFTER_ORDER; + elseif ($type == 'tot') $statut = self::STATUS_RECEIVED_COMPLETELY; + elseif ($type == 'nev') $statut = self::STATUS_CANCELED_AFTER_ORDER; + elseif ($type == 'can') $statut = self::STATUS_CANCELED_AFTER_ORDER; + else { + $error++; + dol_syslog(get_class($this)."::Livraison Error -2", LOG_ERR); + return -2; + } // Some checks to accept the record if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) @@ -2018,14 +2024,6 @@ class CommandeFournisseur extends CommonOrder // TODO LDR01 Add a control test to accept only if ALL predefined products are received (same qty). - // $statut is the new statut after reception - if (! $error && ! ($statut == self::STATUS_RECEIVED_PARTIALLY || $statut == self::STATUS_RECEIVED_COMPLETELY || $statut == self::STATUS_CANCELED_AFTER_ORDER)) - { - $error++; - dol_syslog(get_class($this)."::Livraison Error -2", LOG_ERR); - $result = -2; - } - if (! $error) { $this->db->begin(); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d2c52ec4255..17bbc1c8009 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3596,14 +3596,11 @@ class Product extends CommonObject case 2: return $this->LibStatut($status,3,2).' '.$this->LibStatut($status,1,2); case 3: - if ($status == 0 ) + if ($status == 0) { return img_picto($langs->trans('ProductStatusNotOnBatch'),'statut5'); } - else - { - return img_picto($langs->trans('ProductStatusOnBatch'),'statut4'); - } + return img_picto($langs->trans('ProductStatusOnBatch'),'statut4'); case 4: return $this->LibStatut($status,3,2).' '.$this->LibStatut($status,0,2); case 5: From df2f73bdc3294be25c85f8ea04bbbc2aa207f4ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 20:36:32 +0200 Subject: [PATCH 0994/1137] Fix quick search on product/services --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 71bbee0a016..df3a04d3233 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -66,7 +66,7 @@ $search_tobatch = GETPOST("search_tobatch",'int'); $search_accountancy_code_sell = GETPOST("search_accountancy_code_sell",'alpha'); $search_accountancy_code_buy = GETPOST("search_accountancy_code_buy",'alpha'); $optioncss = GETPOST('optioncss','alpha'); -$type=(int) GETPOST("type","int"); +$type=GETPOST("type","int"); //Show/hide child products. Hidden by default if (!$_POST) { From 8aa924fa081fad173d3b9de4d2c96133113245a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 21:03:46 +0200 Subject: [PATCH 0995/1137] NEW The bank account is visible on payment of taxes --- htdocs/compta/facture/card.php | 8 +++-- htdocs/compta/sociales/card.php | 59 +++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3918983894e..d2617d55429 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -38,6 +38,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture-rec.class.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; @@ -3815,18 +3816,21 @@ else if ($id > 0 || ! empty($ref)) if ($num > 0) { while ($i < $num) { $objp = $db->fetch_object($result); - print ''; + $paymentstatic->id = $objp->rowid; $paymentstatic->datepaye = $db->jdate($objp->dp); $paymentstatic->ref = $objp->ref; $paymentstatic->num_paiement = $objp->num_paiement; $paymentstatic->payment_code = $objp->payment_code; + + print ''; print $paymentstatic->getNomUrl(1); print ''; print '' . dol_print_date($db->jdate($objp->dp), 'day') . ''; $label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label; print '' . $label . ' ' . $objp->num_paiement . ''; - if (! empty($conf->banque->enabled)) { + if (! empty($conf->banque->enabled)) + { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 1634ec4bf5f..13a2d29aff9 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -25,6 +25,7 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; @@ -33,6 +34,9 @@ if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } +if (! empty($conf->accounting->enabled)) { + require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +} $langs->load("compta"); $langs->load("bills"); @@ -281,6 +285,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char $form = new Form($db); $formsocialcontrib = new FormSocialContrib($db); +$bankaccountstatic = new Account($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $title = $langs->trans("SocialContribution") . ' - ' . $langs->trans("Card"); @@ -293,8 +298,6 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewSocialContribution")); - $var=false; - print ''; print ''; print ''; @@ -569,12 +572,20 @@ if ($id > 0) print '
        '; print '
        '; + $nbcols = 3; + if (! empty($conf->banque->enabled)) { + $nbcols ++; + } + /* * Payments */ $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; - $sql.= "c.code as type_code,c.libelle as paiement_type"; + $sql.= " c.code as type_code,c.libelle as paiement_type,"; + $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; $sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; + $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; + $sql.= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql.= ", ".MAIN_DB_PREFIX."c_paiement as c "; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE p.fk_charge = ".$id; @@ -597,21 +608,43 @@ if ($id > 0) print ''.$langs->trans("RefPayment").''; print ''.$langs->trans("Date").''; print ''.$langs->trans("Type").''; + if (! empty($conf->banque->enabled)) { + print '' . $langs->trans('BankAccount') . ''; + } print ''.$langs->trans("Amount").''; print ''; - $var=true; if ($num > 0) { while ($i < $num) { $objp = $db->fetch_object($resql); - print ""; + print ''; print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; $labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type; print "".$labeltype.' '.$objp->num_paiement."\n"; + if (! empty($conf->banque->enabled)) + { + $bankaccountstatic->id = $objp->baid; + $bankaccountstatic->ref = $objp->baref; + $bankaccountstatic->label = $objp->baref; + $bankaccountstatic->number = $objp->banumber; + + if (! empty($conf->accounting->enabled)) { + $bankaccountstatic->account_number = $objp->account_number; + + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($objp->fk_accountancy_journal); + $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + } + + print ''; + if ($bankaccountstatic->id) + print $bankaccountstatic->getNomUrl(1, 'transactions'); + print ''; + } print ''.price($objp->amount)."\n"; print ""; $totalpaye += $objp->amount; @@ -624,17 +657,15 @@ if ($id > 0) print ''.$langs->trans("None").''; } - //if ($object->status == ChargeSociales::STATUS_DRAFT) - //{ - print "".$langs->trans("AlreadyPaid")." :".price($totalpaye)."\n"; - print "".$langs->trans("AmountExpected")." :".price($object->amount)."\n"; + print ''.$langs->trans("AlreadyPaid")." :".price($totalpaye)."\n"; + print ''.$langs->trans("AmountExpected")." :".price($object->amount)."\n"; - $resteapayer = $object->amount - $totalpaye; - $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + $resteapayer = $object->amount - $totalpaye; + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + + print ''.$langs->trans("RemainderToPay")." :"; + print ''.price($resteapayer)."\n"; - print "".$langs->trans("RemainderToPay")." :"; - print ''.price($resteapayer)."\n"; - //} print ""; $db->free($resql); } From ad0fa3c33a83bae3ee24d2f60c37f5141ed89267 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 21:13:54 +0200 Subject: [PATCH 0996/1137] Look and feel v6 --- htdocs/compta/payment_sc/card.php | 72 +++++++++++-------- .../class/paymentsocialcontribution.class.php | 63 ++++++++++++++++ 2 files changed, 105 insertions(+), 30 deletions(-) diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 45762ed95bb..da1b0a35bdf 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -44,10 +44,10 @@ if ($user->societe_id) $socid=$user->societe_id; // TODO ajouter regle pour restreindre acces paiement //$result = restrictedArea($user, 'facture', $id,''); -$paiement = new PaymentSocialContribution($db); -if ($id > 0) +$object = new PaymentSocialContribution($db); +if ($id > 0) { - $result=$paiement->fetch($id); + $result=$object->fetch($id); if (! $result) dol_print_error($db,'Failed to get payment id '.$id); } @@ -61,7 +61,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char { $db->begin(); - $result = $paiement->delete($user); + $result = $object->delete($user); if ($result > 0) { $db->commit(); @@ -70,7 +70,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char } else { - setEventMessages($paiement->error, $paiement->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } @@ -80,8 +80,8 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char { $db->begin(); - $result=$paiement->valide(); - + $result=$object->valide(); + if ($result > 0) { $db->commit(); @@ -103,12 +103,12 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char } } - header('Location: card.php?id='.$paiement->id); + header('Location: card.php?id='.$object->id); exit; } else { - setEventMessages($paiement->error, $paiement->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } @@ -137,15 +137,15 @@ $h++; */ -dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, 'payment'); +dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); /* * Deletion confirmation of payment */ if ($action == 'delete') { - print $form->formconfirm('card.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - + print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); + } /* @@ -154,41 +154,50 @@ if ($action == 'delete') if ($action == 'valide') { $facid = $_GET['facid']; - print $form->formconfirm('card.php?id='.$paiement->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - + print $form->formconfirm('card.php?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); + } +//$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = ''; + +dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', ''); + + +print '
        '; +print '
        '; + print ''; // Ref -print ''; +/*print ''; print ''; +print $form->showrefnav($object,'id','',1,'rowid','id'); +print '';*/ // Date -print ''; +print ''; // Mode -print ''; +print ''; // Numero -print ''; +print ''; // Montant -print ''; +print ''; // Note -print ''; +print ''; // Bank account if (! empty($conf->banque->enabled)) { - if ($paiement->bank_account) + if ($object->bank_account) { $bankline=new AccountLine($db); - $bankline->fetch($paiement->bank_line); + $bankline->fetch($object->bank_line); print ''; print ''; @@ -201,6 +210,10 @@ if (! empty($conf->banque->enabled)) print '
        '.$langs->trans('Ref').'
        '.$langs->trans('Ref').''; -print $form->showrefnav($paiement,'id','',1,'rowid','id'); -print '
        '.$langs->trans('Date').''.dol_print_date($paiement->datep,'day').'
        '.$langs->trans('Date').''.dol_print_date($object->datep,'day').'
        '.$langs->trans('Mode').''.$langs->trans("PaymentType".$paiement->type_code).'
        '.$langs->trans('Mode').''.$langs->trans("PaymentType".$object->type_code).'
        '.$langs->trans('Numero').''.$paiement->num_paiement.'
        '.$langs->trans('Numero').''.$object->num_paiement.'
        '.$langs->trans('Amount').''.price($paiement->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
        '.$langs->trans('Amount').''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
        '.$langs->trans('Note').''.nl2br($paiement->note).'
        '.$langs->trans('Note').''.nl2br($object->note).'
        '.$langs->trans('BankTransactionLine').'
        '; +print '
        '; + +dol_fiche_end(); + /* * List of social contributions payed @@ -211,7 +224,7 @@ $sql = 'SELECT f.rowid as scid, f.libelle, f.paye, f.amount as sc_amount, pf.amo $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementcharge as pf,'.MAIN_DB_PREFIX.'chargesociales as f, '.MAIN_DB_PREFIX.'c_chargesociales as pc'; $sql.= ' WHERE pf.fk_charge = f.rowid AND f.fk_type = pc.id'; $sql.= ' AND f.entity = '.$conf->entity; -$sql.= ' AND pf.rowid = '.$paiement->id; +$sql.= ' AND pf.rowid = '.$object->id; dol_syslog("compta/payment_sc/card.php", LOG_DEBUG); $resql=$db->query($sql); @@ -239,7 +252,7 @@ if ($resql) { $objp = $db->fetch_object($resql); - + print ''; // Ref print ''; @@ -268,7 +281,7 @@ if ($resql) $i++; } } - + print "\n"; $db->free($resql); @@ -278,7 +291,6 @@ else dol_print_error($db); } -dol_fiche_end(); /* @@ -289,7 +301,7 @@ print '
        '; /* if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { - if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '') + if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '') { if ($user->rights->facture->paiement) { @@ -299,7 +311,7 @@ if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) } */ -if ($_GET['action'] == '') +if ($action == '') { if ($user->rights->tax->charges->supprimer) { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 6c7cda1f07e..0036c61fef9 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -33,6 +33,7 @@ class PaymentSocialContribution extends CommonObject { public $element='paiementcharge'; //!< Id that identify managed objects public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored + public $picto = 'payment'; var $fk_charge; var $datec=''; @@ -613,6 +614,68 @@ class PaymentSocialContribution extends CommonObject } } + + /** + * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle du statut + */ + function LibStatut($status,$mode=0) + { + global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage + + $langs->load('compta'); + /*if ($mode == 0) + { + if ($status == 0) return $langs->trans('ToValidate'); + if ($status == 1) return $langs->trans('Validated'); + } + if ($mode == 1) + { + if ($status == 0) return $langs->trans('ToValidate'); + if ($status == 1) return $langs->trans('Validated'); + } + if ($mode == 2) + { + if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); + if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); + } + if ($mode == 3) + { + if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1'); + if ($status == 1) return img_picto($langs->trans('Validated'),'statut4'); + } + if ($mode == 4) + { + if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate'); + if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); + } + if ($mode == 5) + { + if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); + if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); + } + if ($mode == 6) + { + if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1'); + if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); + }*/ + return ''; + } + /** * Return clicable name (with picto eventually) * From 4c2336340090bbc4f1ab8641b17ffc5fc4779222 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Oct 2017 21:27:18 +0200 Subject: [PATCH 0997/1137] Fix creation of tax payment --- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/paiement_charge.php | 29 +++++++++++++--------- htdocs/compta/payment_sc/card.php | 3 +-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 23818d4aa9d..8ff51305e08 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -414,7 +414,7 @@ class Account extends CommonObject { $sql = "SELECT code FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " WHERE id=".$oper; - $sql.= " AND entity = " . getEntity('c_paiement') . ")"; + $sql.= " AND entity IN (" . getEntity('c_paiement') . ")"; $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index bd262eaa675..398f70ad36a 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -60,18 +60,21 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes if (! $_POST["paiementtype"] > 0) { - $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")), null, 'errors'); $error++; + $action = 'create'; } if ($datepaye == '') { - $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")), null, 'errors'); $error++; + $action = 'create'; } if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0) { - $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; + $action = 'create'; } if (! $error) @@ -91,7 +94,8 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes if (count($amounts) <= 0) { $error++; - $errmsg='ErrorNoPaymentDefined'; + setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors'); + $action='create'; } if (! $error) @@ -112,18 +116,20 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes $paymentid = $paiement->create($user, (GETPOST('closepaidcontrib')=='on'?1:0)); if ($paymentid < 0) { - $errmsg=$paiement->error; - $error++; + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action='create'; } } if (! $error) { - $result=$paiement->addPaymentToBank($user,'payment_sc','(SocialContributionPayment)',$_POST['accountid'],'',''); - if (! $result > 0) + $result=$paiement->addPaymentToBank($user,'payment_sc','(SocialContributionPayment)', GETPOST('accountid','int'),'',''); + if (! ($result > 0)) { - $errmsg=$paiement->error; - $error++; + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action='create'; } } @@ -141,7 +147,6 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes } } - $_GET["action"]='create'; } @@ -266,7 +271,7 @@ if ($action == 'create') { $objp = $charge; - + print ''; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index da1b0a35bdf..ea9bc5af42a 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -159,8 +159,7 @@ if ($action == 'valide') } -//$linkback = '' . $langs->trans("BackToList") . ''; -$linkback = ''; +$linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', ''); From 8513ddb9b4081279e720e1b8e872952973c93ebb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 8 Oct 2017 10:08:49 +0200 Subject: [PATCH 0998/1137] Fix : missing new target type in advance target selection --- htdocs/core/modules/mailings/advthirdparties.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 497d3c54f54..9252ae5ec3a 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -116,7 +116,7 @@ class mailing_advthirdparties extends MailingTargets } } - if (($type_of_target==1) || ($type_of_target==2)) { + if (($type_of_target==1) || ($type_of_target==2) || ($type_of_target==4)) { // Select the third parties from category if (count($socid)>0 || count($contactid)>0) { From ce7ce8280105e305a4f4a2734ea2483521309a17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Oct 2017 14:51:10 +0200 Subject: [PATCH 0999/1137] Enhance email template editor --- htdocs/admin/mails_templates.php | 217 +++++++++--------- .../install/mysql/migration/6.0.0-7.0.0.sql | 2 + .../mysql/tables/llx_c_email_templates.sql | 3 +- htdocs/langs/en_US/admin.lang | 2 + htdocs/theme/eldy/style.css.php | 12 +- 5 files changed, 122 insertions(+), 114 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 755440a47fd..dda893c5350 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -53,7 +53,6 @@ $id=GETPOST('id','int'); $rowid=GETPOST('rowid','alpha'); $search_label=GETPOST('search_label','alpha'); $search_type_template=GETPOST('search_type_template','alpha'); -$search_topic=GETPOST('search_topic','alpha'); $search_lang=GETPOST('search_lang','alpha'); $search_fk_user=GETPOST('search_fk_user','intcomma'); $search_topic=GETPOST('search_topic','alpha'); @@ -94,26 +93,20 @@ $tabsqlsort[25]="label ASC, lang ASC, position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,content"; +$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines'; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines'; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,content"; +$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines'; $tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays -// Nom du rowid si le champ n'est pas de type autoincrement -// Example: "" if id field is "rowid" and has autoincrement on -// "nameoffield" if id field is not "rowid" or has not autoincrement on -$tabrowid=array(); -$tabrowid[25]= ""; - // Condition to show dictionary in setup page $tabcond=array(); $tabcond[25]= true; @@ -153,7 +146,7 @@ else $tabhelp=array(); -$tabhelp[25] = array('topic'=>$helpsubstit,'content'=>$helpsubstit,'content_lines'=>$helpsubstitforlines,'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList")); +$tabhelp[25] = array('topic'=>$helpsubstit,'joinfiles'=>$langs->trans('AttachMainDocByDefault'), 'content'=>$helpsubstit,'content_lines'=>$helpsubstitforlines,'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList")); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -229,10 +222,12 @@ if (empty($reshook)) $ok=1; foreach ($listfield as $f => $value) { + // Not mandatory fields + if ($value == 'joinfiles') continue; if ($value == 'content') continue; if ($value == 'content_lines') continue; - if ($value == 'content') $value='content-'.$rowid; - if ($value == 'content_lines') $value='content_lines-'.$rowid; + + if ($value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position') { @@ -256,34 +251,14 @@ if (empty($reshook)) // Si verif ok et action add, on ajoute la ligne if ($ok && GETPOST('actionadd')) { - if ($tabrowid[$id]) - { - // Recupere id libre pour insertion - $newid=0; - $sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id]; - $result = $db->query($sql); - if ($result) - { - $obj = $db->fetch_object($result); - $newid=($obj->newid + 1); - - } else { - dol_print_error($db); - } - } - // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) - $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; $sql.=",active)"; $sql.= " VALUES("; // List of values - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) - $sql.= $newid.","; $i=0; foreach ($listfieldinsert as $f => $value) { @@ -322,17 +297,11 @@ if (empty($reshook)) // Si verif ok et action modify, on modifie la ligne if ($ok && GETPOST('actionmodify')) { - if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } - else { $rowidcol="rowid"; } + $rowidcol="rowid"; // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) - { - $sql.= $tabrowid[$id]."="; - $sql.= "'".$db->escape($rowid)."', "; - } $i = 0; foreach ($listfieldmodify as $field) { @@ -340,8 +309,10 @@ if (empty($reshook)) if ($field == 'lang') $keycode='langcode'; if ($field == 'fk_user' && ! ($_POST['fk_user'] > 0)) $_POST['fk_user']=''; + if ($field == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; + if ($field == 'joinfiles') $_POST['joinfiles']=$_POST['joinfiles-'.$rowid]; if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid]; - if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid]; + if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid]; if ($field == 'entity') $_POST[$keycode] = $conf->entity; if ($i) $sql.=","; $sql.= $field."="; @@ -354,7 +325,11 @@ if (empty($reshook)) dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); - if (! $resql) + if ($resql) + { + setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); + } + else { setEventMessages($db->error(), null, 'errors'); } @@ -363,8 +338,7 @@ if (empty($reshook)) if ($action == 'confirm_delete' && $confirm == 'yes') // delete { - if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } - else { $rowidcol="rowid"; } + $rowidcol="rowid"; $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'"; @@ -386,15 +360,9 @@ if (empty($reshook)) // activate if ($action == $acts[0]) { - if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } - else { $rowidcol="rowid"; } + $rowidcol="rowid"; - if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'"; - } - elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$code."'"; - } + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'"; $result = $db->query($sql); if (!$result) @@ -406,15 +374,9 @@ if (empty($reshook)) // disable if ($action == $acts[1]) { - if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } - else { $rowidcol="rowid"; } + $rowidcol="rowid"; - if ($rowid) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'"; - } - elseif ($code) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$code."'"; - } + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'"; $result = $db->query($sql); if (!$result) @@ -475,7 +437,7 @@ if ($action == 'delete') //var_dump($elementList); -$sql="SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, content_lines, content, active"; +$sql="SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, joinfiles, content_lines, content, active"; $sql.=" FROM ".MAIN_DB_PREFIX."c_email_templates"; $sql.=" WHERE entity IN (".getEntity('email_template').")"; if (! $user->admin) @@ -541,11 +503,14 @@ foreach ($fieldlist as $field => $value) if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='content') { $valuetoshow=''; } - if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; } if ($fieldlist[$field]=='private') { $align='center'; } if ($fieldlist[$field]=='position') { $align='center'; } + if ($fieldlist[$field]=='topic') { $valuetoshow=''; } + if ($fieldlist[$field]=='joinfiles') { $valuetoshow=''; } + if ($fieldlist[$field]=='content') { $valuetoshow=''; } + if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; } + if ($valuetoshow != '') { print ''; @@ -560,14 +525,11 @@ foreach ($fieldlist as $field => $value) } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; } -print ''; +print ''; print ''; print ''; print ''; -// Line to enter new values (input fields) -print ""; - $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. if (GETPOST('actionadd')) @@ -587,6 +549,10 @@ $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $error = $hookmanager->error; $errors = $hookmanager->errors; + +// Line to enter new values (input fields) +print ""; + if (empty($reshook)) { if ($action == 'edit') { @@ -596,32 +562,51 @@ if (empty($reshook)) } } -print ''; +print ''; print ''; print ""; -$fieldsforcontent = array('content'); +$fieldsforcontent = array('topic', 'joinfiles', 'content'); if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content','content_lines'); } foreach ($fieldsforcontent as $tmpfieldlist) { - print ''; + print ''; + // Label + if ($tmpfieldlist == 'topic') + { + print '' . $form->textwithpicto($langs->trans("Topic"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . ' '; + } + if ($tmpfieldlist == 'joinfiles') + { + print '' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . ' '; + } if ($tmpfieldlist == 'content') - print '' . $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '
        '; + print '' . $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . ' '; if ($tmpfieldlist == 'content_lines') print '' . $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '
        '; - - if ($context != 'hide') { - // print ''; - $okforextended = true; - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) - $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%'); - print $doleditor->Create(1); - } else - print ' '; + // Input field + if ($tmpfieldlist == 'topic') { + print ''; + } + else if ($tmpfieldlist == 'joinfiles') { + print ''; + } + else + { + if ($context != 'hide') { + // print ''; + $okforextended = true; + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) + $okforextended = false; + $doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%'); + print $doleditor->Create(1); + } + else + print ' '; + } print ''; - if ($tmpfieldlist == 'content') { - print ''; + if ($tmpfieldlist == 'topic') { + print ''; if ($action != 'edit') { print ''; } @@ -704,7 +689,6 @@ if ($resql) elseif (! in_array($value, array('content', 'content_lines'))) print ''; } if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print ''; - print ''; // Action column print ''; $searchpicto=$form->showFilterButtons(); @@ -736,11 +720,13 @@ if ($resql) if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } - if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;} - if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; } if ($fieldlist[$field]=='private') { $align='center'; } if ($fieldlist[$field]=='position') { $align='center'; } + if ($fieldlist[$field]=='joinfiles') { $valuetoshow=$langs->trans("FilesAttachedToEmail"); $align='center'; } + if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;} + if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; } + // Affiche nom du champ if ($showfield) { @@ -755,7 +741,6 @@ if ($resql) print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder); print getTitleFieldOfList(''); - print getTitleFieldOfList(''); print ''; if ($num) @@ -777,7 +762,8 @@ if ($resql) // Show fields if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -785,10 +771,10 @@ if ($resql) print ''; print ''; - $fieldsforcontent = array('content'); + $fieldsforcontent = array('topic', 'joinfiles', 'content'); if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { - $fieldsforcontent = array('content', 'content_lines'); + $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); } foreach ($fieldsforcontent as $tmpfieldlist) { @@ -799,17 +785,29 @@ if ($resql) $class = 'tddict'; // Show value for field if ($showfield) { - + // Show line for topic, joinfiles and content print ''; - print ''; // To create an artificial CR for the current tr we are on - $okforextended = true; - if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); - print $doleditor->Create(1); + print ''; + if ($tmpfieldlist == 'topic') + { + print '' . $form->textwithpicto($langs->trans("Topic"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . ' '; + print ''; + } + if ($tmpfieldlist == 'joinfiles') + { + print '' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . ' '; + print ''; + } + if ($tmpfieldlist == 'content') + { + $okforextended = true; + if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; + $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); + print $doleditor->Create(1); + } print ''; print ''; print ''; - print ''; } } } @@ -856,6 +854,10 @@ if ($resql) { $align="center"; } + if ($value == 'joinfiles') + { + $align="center"; + } $class='tddict'; // Show value for field @@ -880,24 +882,21 @@ if ($resql) if ($param) $url .= '&'.$param; $url.='&'; - // Active + // Status / Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; print ""; - // Modify link - if ($canbemodified) print ''.img_edit().''; - else print ''; - - // Delete link + // Modify link / Delete link + print ''; + if ($canbemodified) print ''.img_edit().''; if ($iserasable) { - print ''; - print ''.img_delete().''; + print '   '.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin - print ''; } - else print ''; + print ''; + /* $fieldsforcontent = array('content'); @@ -1042,7 +1041,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } print ''; } - elseif (in_array($fieldlist[$field], array('content','content_lines'))) continue; + elseif ($context == 'add' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; + elseif ($context == 'edit' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; + elseif ($context == 'hide' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; else { $size=''; $class=''; $classtd=''; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index df3cba9cffd..223a8aeeeb4 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -79,6 +79,8 @@ UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL; UPDATE llx_c_email_templates SET lang = '' WHERE lang IS NULL; ALTER TABLE llx_c_email_templates ADD COLUMN enabled varchar(255) DEFAULT '1'; +ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles varchar(255) DEFAULT '1'; +ALTER TABLE llx_c_email_templates MODIFY COLUMN content mediumtext; INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,

        \n\n__(ThisIsContentOfYourCard)__
        \n__(ID)__ : __ID__
        \n__(Civiliyty)__ : __MEMBER_CIVILITY__
        \n__(Firstname)__ : __MEMBER_FIRSTNAME__
        \n__(Lastname)__ : __MEMBER_LASTNAME__
        \n__(Fullname)__ : __MEMBER_FULLNAME__
        \n__(Company)__ : __MEMBER_COMPANY__
        \n__(Address)__ : __MEMBER_ADDRESS__
        \n__(Zip)__ : __MEMBER_ZIP__
        \n__(Town)__ : __MEMBER_TOWN__
        \n__(Country)__ : __MEMBER_COUNTRY__
        \n__(Email)__ : __MEMBER_EMAIL__
        \n__(Birthday)__ : __MEMBER_BIRTH__
        \n__(Photo)__ : __MEMBER_PHOTO__
        \n__(Login)__ : __MEMBER_LOGIN__
        \n__(Password)__ : __MEMBER_PASSWORD__
        \n__(Phone)__ : __MEMBER_PHONE__
        \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
        \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

        \n__(Sincerely)__
        __USER_SIGNATURE__',null); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,

        \n\n__(FindYourSEPAMandate)__ :
        \n__MYCOMPANY_NAME__
        \n__MYCOMPANY_FULLADDRESS__

        \n__(Sincerely)__
        \n__USER_SIGNATURE__',null); diff --git a/htdocs/install/mysql/tables/llx_c_email_templates.sql b/htdocs/install/mysql/tables/llx_c_email_templates.sql index 69cbc186ebd..adcda4c69f8 100644 --- a/htdocs/install/mysql/tables/llx_c_email_templates.sql +++ b/htdocs/install/mysql/tables/llx_c_email_templates.sql @@ -33,6 +33,7 @@ create table llx_c_email_templates enabled varchar(255) DEFAULT '1', -- Condition to have this module visible active tinyint DEFAULT 1 NOT NULL, topic text, -- Predefined topic - content text, -- Predefined text + joinfiles text, -- Files to attach + content mediumtext, -- Predefined text content_lines text -- Predefined lines )ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a531186beff..41ffeae3f67 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -462,6 +462,8 @@ Field=Field ProductDocumentTemplates=Document templates to generate product document FreeLegalTextOnExpenseReports=Free legal text on expense reports WatermarkOnDraftExpenseReports=Watermark on draft expense reports +AttachMainDocByDefault=Set this to 1 if you want to attach main document to email by default (if applicable) +FilesAttachedToEmail=Attach file # Modules Module0Name=Users & groups Module0Desc=Users / Employees and Groups management diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8df7d34cc16..b0ccd0ab097 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -452,13 +452,15 @@ fieldset { border: 1px solid #AAAAAA !important; } hr { border: 0; border-top: 1px solid #ccc; } .button, .buttonDelete, input[name="sbmtConnexion"] { + margin-bottom: 0; + margin-top: 0; + margin-left: 5px; + margin-right: 5px; font-family: ; border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; padding: 3px 14px; - margin-bottom: 0; - margin-top: 0; text-align: center; cursor: pointer; text-decoration: none !important; @@ -481,9 +483,9 @@ hr { border: 0; border-top: 1px solid #ccc; } border-radius: 2px; } .button:focus, .buttonDelete:focus { - -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); - -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); - box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + -moz-box-shadow: 0px 0px 5px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + -webkit-box-shadow: 0px 0px 5px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); + box-shadow: 0px 0px 5px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } .button:hover, .buttonDelete:hover { /* warning: having a larger shadow has side effect when button is completely on left of a table */ From 33624e10017ee8969576c00dbd4bf0718c5e00f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Oct 2017 16:34:42 +0200 Subject: [PATCH 1000/1137] NEW Attaching doc automatically in email is now a parameter of template. --- htdocs/admin/mails_templates.php | 5 +- htdocs/core/actions_sendmails.inc.php | 4 +- htdocs/core/class/html.formmail.class.php | 44 +++++--- htdocs/core/lib/functions.lib.php | 26 +++-- htdocs/core/tpl/card_presend.tpl.php | 9 +- htdocs/expedition/card.php | 12 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/other.lang | 12 +- htdocs/product/inventory/card.php | 128 ++-------------------- htdocs/user/card.php | 17 ++- 10 files changed, 101 insertions(+), 157 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index dda893c5350..20aa084760e 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -170,6 +170,7 @@ if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$la if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); if ($conf->adherent->enabled) $elementList['member']=$langs->trans('MailToMember'); if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); +$elementList['user']=$langs->trans('MailToUser'); $elementList['all'] =$langs->trans('VisibleEverywhere'); $elementList['none']=$langs->trans('VisibleNowhere'); @@ -227,7 +228,7 @@ if (empty($reshook)) if ($value == 'content') continue; if ($value == 'content_lines') continue; - if ($value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; + if (GETPOST('actionmodify') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position') { @@ -857,6 +858,8 @@ if ($resql) if ($value == 'joinfiles') { $align="center"; + if ($valuetoshow) $valuetoshow=1; + else $valuetoshow=''; } $class='tddict'; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 4439f0034ce..7b1db834d22 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -113,14 +113,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $result=$object->fetch($id); $sendtosocid=0; // Thirdparty on object - if (method_exists($object,"fetch_thirdparty") && ! in_array($object->element, array('societe','member'))) + if (method_exists($object,"fetch_thirdparty") && ! in_array($object->element, array('societe','member','user'))) { $result=$object->fetch_thirdparty(); if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok $thirdparty=$object->thirdparty; $sendtosocid=$thirdparty->id; } - else if ($object->element == 'member') + else if ($object->element == 'member' || $object->element == 'user') { $thirdparty=$object; if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0621e1d21f4..788fa723cdb 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -271,16 +271,6 @@ class FormMail extends Form $disablebademails=1; - // Define list of attached files - $listofpaths=array(); - $listofnames=array(); - $listofmimes=array(); - $keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined - - if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]); - if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]); - if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]); - // Define output language $outputlangs = $langs; $newlang = ''; @@ -307,6 +297,30 @@ class FormMail extends Form //var_dump($model_id); //var_dump($arraydefaultmessage); + + // Define list of attached files + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + $keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined + + if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1')) + { + $this->clear_attached_files(); + if (! empty($arraydefaultmessage['joinfiles']) && is_array($this->param['fileinit'])) + { + foreach($this->param['fileinit'] as $file) + { + $this->add_attached_files($file, basename($file), dol_mimetype($file)); + } + } + } + + if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]); + if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]); + if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]); + + $out.= "\n".'
        '."\n"; if ($this->withform == 1) { @@ -369,7 +383,7 @@ class FormMail extends Form elseif (! empty($this->param['models']) && in_array($this->param['models'], array( 'propal_send','order_send','facture_send', 'shipping_send','fichinter_send','supplier_proposal_send','order_supplier_send', - 'invoice_supplier_send','thirdparty','contract','all' + 'invoice_supplier_send','thirdparty','contract','user','all' ))) { // If list of template is empty @@ -922,7 +936,7 @@ class FormMail extends Form { $ret=array(); - $sql = "SELECT label, topic, content, content_lines, lang"; + $sql = "SELECT label, topic, joinfiles, content, content_lines, lang"; $sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates'; $sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')"; $sql.= " AND entity IN (".getEntity('c_email_templates', 0).")"; @@ -942,10 +956,11 @@ class FormMail extends Form if ($obj) { $ret['label']=$obj->label; + $ret['lang']=$obj->lang; $ret['topic']=$obj->topic; + $ret['joinfiles']=$obj->joinfiles; $ret['content']=$obj->content; $ret['content_lines']=$obj->content_lines; - $ret['lang']=$obj->lang; } else // If there is no template at all { @@ -963,10 +978,11 @@ class FormMail extends Form elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); } $ret['label']='default'; + $ret['lang']=$outputlangs->defaultlang; $ret['topic']=''; + $ret['joinfiles']=1; $ret['content']=$defaultmessage; $ret['content_lines']=''; - $ret['lang']=$outputlangs->defaultlang; } $db->free($resql); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c364875044a..41716d5d78a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5296,6 +5296,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = 'Security key for payment on an order'; $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = 'Security key for payment on an invoice'; $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'Security key for payment on a a service'; + + $substitutionarray['__SHIPPINGTRACKNUM__']='Shipping tacking number'; + $substitutionarray['__SHIPPINGTRACKNUMURL__']='Shipping tracking url'; + } else { @@ -5340,15 +5344,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__PROJECT_NAME__'] = (is_object($object->projet)?$object->projet->title:''); } - // Create dynamic tags for __EXTRAFIELD_FIELD__ - if ($object->table_element && $object->id > 0) + if (is_object($object) && $object->element == 'shipping') { - $extrafieldstmp = new ExtraFields($db); - $extralabels = $extrafieldstmp->fetch_name_optionals_label($object->table_element, true); - $object->fetch_optionals($object->id, $extralabels); - foreach ($extrafieldstmp->attribute_label as $key => $label) { - $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key]; - } + $substitutionarray['__SHIPPINGTRACKNUM__']=$object->tracking_number; + $substitutionarray['__SHIPPINGTRACKNUMURL__']=$object->tracking_url; } if (is_object($object) && $object->element == 'contrat' && is_array($object->lines)) @@ -5366,6 +5365,17 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard'); } + // Create dynamic tags for __EXTRAFIELD_FIELD__ + if ($object->table_element && $object->id > 0) + { + $extrafieldstmp = new ExtraFields($db); + $extralabels = $extrafieldstmp->fetch_name_optionals_label($object->table_element, true); + $object->fetch_optionals($object->id, $extralabels); + foreach ($extrafieldstmp->attribute_label as $key => $label) { + $substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key]; + } + } + $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'TODO'; } } diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index aa9353201cf..6e653372148 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -129,7 +129,7 @@ if ($action == 'presend') $liste[$key] = $value; } } - elseif ($object->element == 'member') + elseif ($object->element == 'user' || $object->element == 'member') { $liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">"; } @@ -169,12 +169,15 @@ if ($action == 'presend') $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['id'] = $object->id; $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; + $formmail->param['fileinit'] = array($file); // Init list of files - if (GETPOST("mode") == 'init') { + /*if (GETPOST('mode','alpha') == 'init') + { $formmail->clear_attached_files(); + $formmail->add_attached_files($file, basename($file), dol_mimetype($file)); - } + }*/ // Show form print $formmail->get_form(); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 1500affbcda..9fa609d9d76 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2151,6 +2151,16 @@ else if ($id || $ref) if (GETPOST('modelselected')) { $action = 'presend'; } + + // Presend form + $modelmail='shipping_send'; + $defaulttopic='SendShippingRef'; + $diroutput = $conf->expedition->dir_output. '/sending'; + $trackid = 'shi'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + + /* if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); @@ -2278,7 +2288,7 @@ else if ($id || $ref) print $formmail->get_form(); dol_fiche_end(); - } + }*/ } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 41ffeae3f67..1e7dc926ff9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1712,6 +1712,7 @@ MailToSendSupplierInvoice=To send supplier invoice MailToSendContract=To send a contract MailToThirdparty=To send email from third party page MailToMember=To send email from member page +MailToUser=To send email from user page ByDefaultInList=Show by default on list view YouUseLastStableVersion=You use the latest stable version TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index a8d6bacdf31..bbc8f34a92e 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -79,14 +79,14 @@ NbOfActiveNotifications=Number of notifications (nb of recipient emails) PredefinedMailTest=This is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__ PredefinedMailTestHtml=This is a test mail (the word test must be in bold).
        The two lines are separated by a carriage return.

        __SIGNATURE__ PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nYou will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nYou will find here the commercial proposal __PREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendSupplierProposal=__CONTACTCIVNAME__\n\nYou will find here the price request __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nYou will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nYou will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nYou will find here the order __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nYou will find here our order __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=__CONTACTCIVNAME__\n\nYou will find here the shipping __SHIPPINGREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=__CONTACTCIVNAME__\n\nYou will find here the intervention __FICHINTERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__\n\nYou will find here the shipping __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__\n\nYou will find here the intervention __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentThirdparty=\n\n__SIGNATURE__ PredefinedMailContentUser=\n\n__SIGNATURE__ DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index dae399a9907..ad46fd037ad 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -440,7 +440,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Documents $comref = dol_sanitizeFileName($object->ref); $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->inventory->dir_output . '/' . $comref; + $filedir = $conf->product->dir_output . '/inventory/' . $comref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->inventory->creer; $delallowed = $user->rights->inventory->supprimer; @@ -463,126 +463,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } + //Select mail models is same action as presend /* - * Action presend - */ - /* - if ($action == 'presend') - { - $object->fetch_projet(); + if (GETPOST('modelselected')) $action = 'presend'; - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); - $file = $fileparams['fullname']; + // Presend form + $modelmail='inventory'; + $defaulttopic='InformationMessage'; + $diroutput = $conf->product->dir_output.'/inventory'; + $trackid = 'stockinv'.$object->id; - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->thirdparty->default_lang; - - if (!empty($newlang)) - { - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang($newlang); - $outputlangs->load('commercial'); - } - - // Build document if it not exists - if (! $file || ! is_readable($file)) { - $result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) { - dol_print_error($db, $object->error, $object->errors); - exit(); - } - $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); - $file = $fileparams['fullname']; - } - - print '
        '; - print '
        '; - print '
        '; - print load_fiche_titre($langs->trans('SendOrderByMail')); - - dol_fiche_head(''); - - // Cree l'objet formulaire mail - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); - - if($formmail->fromtype === 'user'){ - $formmail->fromid = $user->id; - - } - $formmail->trackid='ord'.$object->id; - if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set - { - include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'ord'.$object->id); - } - $formmail->withfrom = 1; - $liste = array(); - foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) - $liste [$key] = $value; - $formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste; - $formmail->withtocc = $liste; - $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; - if (empty($object->ref_client)) { - $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__'); - } else if (! empty($object->ref_client)) { - $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)'); - } - $formmail->withfile = 2; - $formmail->withbody = 1; - $formmail->withdeliveryreceipt = 1; - $formmail->withcancel = 1; - // Tableau des substitutions - $formmail->setSubstitFromObject($object, $outputlangs); - $formmail->substit ['__ORDERREF__'] = $object->ref; - - $custcontact = ''; - $contactarr = array(); - $contactarr = $object->liste_contact(- 1, 'external'); - - if (is_array($contactarr) && count($contactarr) > 0) - { - foreach ($contactarr as $contact) - { - if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label - $contactstatic = new Contact($db); - $contactstatic->fetch($contact ['id']); - $custcontact = $contactstatic->getFullName($langs, 1); - } - } - - if (! empty($custcontact)) { - $formmail->substit['__CONTACTCIVNAME__'] = $custcontact; - } - } - - // Tableau des parametres complementaires - $formmail->param['action'] = 'send'; - $formmail->param['models'] = 'order_send'; - $formmail->param['models_id']=GETPOST('modelmailselected','int'); - $formmail->param['orderid'] = $object->id; - $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; - - // Init list of files - if (GETPOST("mode") == 'init') { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file, basename($file), dol_mimetype($file)); - } - - // Show form - print $formmail->get_form(); - - dol_fiche_end(); - }*/ + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + */ } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a2560d7d6c3..24b011dbd66 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1723,9 +1723,17 @@ else //Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } + if (GETPOST('modelselected')) $action = 'presend'; + + // Presend form + $modelmail='user'; + $defaulttopic='Information'; + $diroutput = $conf->user->dir_output; + $trackid = 'user'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + + /* if ($action == 'presend') { // Show email form @@ -1798,6 +1806,7 @@ else dol_fiche_end(); } + */ if (GETPOST('action','aZ09') != 'presend' && GETPOST('action','aZ09') != 'send') { @@ -2538,7 +2547,7 @@ else print ''; } - if ($action != 'edit') + if ($action != 'edit' && $action != 'presend') { print '
        '; /* From 257fe68f1388ac31d30d96364c3ddbaded21e769 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Oct 2017 19:46:24 +0200 Subject: [PATCH 1001/1137] Prepare 6.0.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 394686cc5e4..624808dd0d9 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 67c33840cff0438dec4996ef2efa4bff3997a99e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Oct 2017 20:47:36 +0200 Subject: [PATCH 1002/1137] Code comment --- htdocs/core/class/html.form.class.php | 1 + htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dd8a0b967de..93c24990af0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3529,6 +3529,7 @@ class Form * @param string $question Question * @param string $action Action * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) + * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', ... * @param string $selectedchoice "" or "no" or "yes" * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 41716d5d78a..552b030e88f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1232,7 +1232,7 @@ function dol_get_fiche_end($notab=0) * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref * @param string $morehtmlstatus More html code to show under navigation arrows - * @param int $onlybanner Put this to 1, if the card will contains only a banner (add css 'arearefnobottom' on div) + * @param int $onlybanner Put this to 1, if the card will contains only a banner (this add css 'arearefnobottom' on div) * @param string $morehtmlright More html code to show before navigation arrows * @return void */ From 5f2c5a6c53c83ceca823494dd639d252f240fb5c Mon Sep 17 00:00:00 2001 From: Nicolas Leichtle Date: Sun, 8 Oct 2017 23:26:35 +0200 Subject: [PATCH 1003/1137] New Extend REST POST function "/documents" to support projects and tasks --- htdocs/api/class/api_documents.class.php | 57 ++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 52ed728a769..6339ce4a91a 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -23,6 +23,8 @@ use Luracast\Restler\Format\UploadFormat; require_once DOL_DOCUMENT_ROOT.'/main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; /** * API class for receive files @@ -148,7 +150,7 @@ class Documents extends DolibarrApi * Test sample 2: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "mysubdir1/mysubdir2", "filecontent": "content text", "fileencoding": "", "overwriteifexists": "0" }. * * @param string $filename Name of file to create ('FA1705-0123') - * @param string $modulepart Name of module or area concerned by file upload ('facture', ...) + * @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...) * @param string $ref Reference of object (This will define subdir automatically and store submited file into it) * @param string $subdir Subdirectory (Only if ref not provided) * @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided) @@ -166,7 +168,10 @@ class Documents extends DolibarrApi var_dump($filecontent); exit;*/ - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + if(empty($modulepart)) + { + throw new RestException(400, 'Modulepart not provided.'); + } if (!DolibarrApiAccess::$user->rights->ecm->upload) { throw new RestException(401); @@ -186,8 +191,52 @@ class Documents extends DolibarrApi if ($modulepart == 'facture' || $modulepart == 'invoice') { $modulepart='facture'; - $object=new Facture($db); + $object = new Facture($this->db); + } + elseif ($modulepart == 'project') + { + $object = new Project($this->db); + } + elseif ($modulepart == 'task' || $modulepart == 'project_task') + { + $modulepart = 'project_task'; + $object = new Task($this->db); + + $task_result = $object->fetch('', $ref); + + // Fetching the tasks project is required because its out_dir might be a subdirectory of the project + if($task_result > 0) + { + $project_result = $object->fetch_projet(); + + if($project_result >= 0) + { + $tmpreldir = dol_sanitizeFileName($object->project->ref).'/'; + } + } + else + { + throw new RestException(500, 'Error while fetching Task '.$ref); + } + } + // TODO Implement additional moduleparts + else + { + throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); + } + + if(is_object($object)) + { $result = $object->fetch('', $ref); + + if($result == 0) + { + throw new RestException(500, "Object with ref '".$ref.'" was not found.'); + } + elseif ($result < 0) + { + throw new RestException(500, 'Error while fetching object.'); + } } if (! ($object->id > 0)) @@ -195,7 +244,7 @@ class Documents extends DolibarrApi throw new RestException(500, 'The object '.$modulepart." with ref '".$ref."' was not found."); } - $tmp = dol_check_secure_access_document($modulepart, $tmpreldir.$object->ref, $entity, DolibarrApiAccess::$user, $ref, 'write'); + $tmp = dol_check_secure_access_document($modulepart, $tmpreldir.dol_sanitizeFileName($object->ref), $entity, DolibarrApiAccess::$user, $ref, 'write'); $upload_dir = $tmp['original_file']; if (empty($upload_dir) || $upload_dir == '/') From d77dfb91999defa8d0763d439843d4e6a0bb423d Mon Sep 17 00:00:00 2001 From: KHELIFA Date: Mon, 9 Oct 2017 09:26:25 +0200 Subject: [PATCH 1004/1137] Fix return chariot --- htdocs/core/lib/pdf.lib.php | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 38dc9c33465..99181d2c294 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -414,13 +414,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS)) { // Phone - if ($sourcecompany->phone) $stringaddress .= "\n".$outputlangs->transnoentities("PhoneShort").": ".$outputlangs->convToOutputCharset($sourcecompany->phone); + if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("PhoneShort").": ".$outputlangs->convToOutputCharset($sourcecompany->phone); // Fax if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? ($sourcecompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax); // EMail - if ($sourcecompany->email) $stringaddress .= "\n".$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email); + if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email); // Web - if ($sourcecompany->url) $stringaddress .= "\n".$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url); + if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url); } } @@ -431,16 +431,16 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1)); if (!empty($targetcontact->address)) { - $stringaddress .= "\n".$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact)); }else { - $stringaddress .= "\n".$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); } // Country if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { - $stringaddress.="\n".$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code)); + $stringaddress.= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code)); } else if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { - $stringaddress.="\n".$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); + $stringaddress.= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); } if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/',$mode)) @@ -448,7 +448,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Phone if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/',$mode)) { - if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= "\n".$outputlangs->transnoentities("Phone").": "; + if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": "; if (! empty($targetcontact->phone_pro)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); if (! empty($targetcontact->phone_pro) && ! empty($targetcontact->phone_mobile)) $stringaddress .= " / "; if (! empty($targetcontact->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); @@ -456,17 +456,17 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Fax if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/',$mode)) { - if ($targetcontact->fax) $stringaddress .= "\n".$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); + if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); } // EMail if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/',$mode)) { - if ($targetcontact->email) $stringaddress .= "\n".$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); + if ($targetcontact->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); } // Web if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/',$mode)) { - if ($targetcontact->url) $stringaddress .= "\n".$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + if ($targetcontact->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); } } } @@ -474,14 +474,14 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany)); // Country - if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.="\n".$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); + if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code)); if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/',$mode)) { // Phone if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/',$mode)) { - if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= "\n".$outputlangs->transnoentities("Phone").": "; + if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": "; if (! empty($targetcompany->phone)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); if (! empty($targetcompany->phone) && ! empty($targetcompany->phone_mobile)) $stringaddress .= " / "; if (! empty($targetcompany->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile); @@ -489,17 +489,17 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Fax if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/',$mode)) { - if ($targetcompany->fax) $stringaddress .= "\n".$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); + if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); } // EMail if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/',$mode)) { - if ($targetcompany->email) $stringaddress .= "\n".$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); + if ($targetcompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); } // Web if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/',$mode)) { - if ($targetcompany->url) $stringaddress .= "\n".$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + if ($targetcompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); } } } @@ -507,7 +507,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Intra VAT if (empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS)) { - if ($targetcompany->tva_intra) $stringaddress.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra); + if ($targetcompany->tva_intra) $stringaddress.=($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra); } // Professionnal Ids @@ -515,37 +515,37 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target { $tmp=$outputlangs->transcountrynoentities("ProfId1",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; - $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof1); + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof1); } if (! empty($conf->global->MAIN_PROFID2_IN_ADDRESS) && ! empty($targetcompany->idprof2)) { $tmp=$outputlangs->transcountrynoentities("ProfId2",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; - $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof2); + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof2); } if (! empty($conf->global->MAIN_PROFID3_IN_ADDRESS) && ! empty($targetcompany->idprof3)) { $tmp=$outputlangs->transcountrynoentities("ProfId3",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; - $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof3); + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof3); } if (! empty($conf->global->MAIN_PROFID4_IN_ADDRESS) && ! empty($targetcompany->idprof4)) { $tmp=$outputlangs->transcountrynoentities("ProfId4",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; - $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof4); + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof4); } if (! empty($conf->global->MAIN_PROFID5_IN_ADDRESS) && ! empty($targetcompany->idprof5)) { $tmp=$outputlangs->transcountrynoentities("ProfId5",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; - $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof5); + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof5); } if (! empty($conf->global->MAIN_PROFID6_IN_ADDRESS) && ! empty($targetcompany->idprof6)) { $tmp=$outputlangs->transcountrynoentities("ProfId6",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; - $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof6); + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof6); } // Public note @@ -553,11 +553,11 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target { if ($mode == 'source' && ! empty($sourcecompany->note_public)) { - $stringaddress.="\n".dol_string_nohtmltag($sourcecompany->note_public); + $stringaddress.=($stringaddress ? "\n" : '' ).dol_string_nohtmltag($sourcecompany->note_public); } if (($mode == 'target' || preg_match('/targetwithdetails/',$mode)) && ! empty($targetcompany->note_public)) { - $stringaddress.="\n".dol_string_nohtmltag($targetcompany->note_public); + $stringaddress.=($stringaddress ? "\n" : '' ).dol_string_nohtmltag($targetcompany->note_public); } } } From 3e0ccd6312fa657cd50da8eb166456d9ccd50d7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 10:43:19 +0200 Subject: [PATCH 1005/1137] FIX #7585 --- htdocs/core/class/commonobject.class.php | 7 ++++--- htdocs/core/lib/functions.lib.php | 10 ++++++++++ htdocs/societe/card.php | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a09ae3722d4..3631a6509ee 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4604,7 +4604,7 @@ abstract class CommonObject */ function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='') { - global $_POST, $conf, $langs; + global $_POST, $conf, $langs, $action; $out = ''; @@ -4633,9 +4633,10 @@ abstract class CommonObject $value=$this->array_options["options_".$key]; break; case "edit": - // GETPOST("options_" . $key) can be 'abc' or array(0=>'abc') $getposttemp = GETPOST('options_'.$key, 'none'); // GETPOST can get value from GET, POST or setup of default values. - if (isset($getposttemp)) { + // GETPOST("options_" . $key) can be 'abc' or array(0=>'abc') + if (is_array($getposttemp) || $getposttemp != '' || GETPOSTISSET('options_'.$key)) + { if (is_array($getposttemp)) { // $getposttemp is an array but following code expects a comma separated string $value = implode(",", $getposttemp); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 552b030e88f..dcba7e20739 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -240,6 +240,16 @@ function dol_shutdown() dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth)?' (Warn: db disconnection forced, transaction depth was '.$depth.')':''), (($disconnectdone && $depth)?LOG_WARNING:LOG_INFO)); } +/** + * Return true if we are in a context of submitting a parameter + * + * @param string $paramname Name or parameter to test + * @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty) + */ +function GETPOSTISSET($paramname) +{ + return (isset($_POST['name']) || isset($_GET['name'])); +} /** * Return value of a param into GET or POST supervariable. diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1d447a9ad0f..b08a8b7db1b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -992,7 +992,7 @@ else print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; if ($modCodeClient->code_auto || $modCodeFournisseur->code_auto) print ''; @@ -1402,7 +1402,7 @@ else $object->oldcopy = clone $object; - if (GETPOST('name')) + if (GETPOSTISSET('name')) { // We overwrite with values if posted $object->name = GETPOST('name', 'alpha'); From 1fd712d7122544e9551208f70da7ac08687ddb0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 10:59:39 +0200 Subject: [PATCH 1006/1137] Fix help --- scripts/invoices/rebuild_merge_pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 6727dc5cab7..30782d3b913 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -289,7 +289,7 @@ function usage() print "To exclude deposit invoices, use filter=nodeposit\n"; print "To exclude some thirdparties, use filter=excludethirdparties id1,id2...\n"; print "To limit to some thirdparties, use filter=onlythirdparties id1,id2...\n"; - print "To regenerate existing PDF, use regenerate=crabe\n"; + print "To regenerate existing PDF, use regenerate=templatename\n"; print "To generate invoices in a language, use lang=xx_XX\n"; print "To set prefix of generated file name, use prefix=myfileprefix\n"; print "\n"; From 64d9b625ffc74ea6f133c9f47bf1780199d014ee Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 11:03:16 +0200 Subject: [PATCH 1007/1137] Fix: wrong POST GET name --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dcba7e20739..5c6e41a7127 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -248,7 +248,7 @@ function dol_shutdown() */ function GETPOSTISSET($paramname) { - return (isset($_POST['name']) || isset($_GET['name'])); + return (isset($_POST[$paramname]) || isset($_GET[$paramname])); } /** From 3d3f6d14b5d21647ffa12b634db6b437ed54793a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 11:26:49 +0200 Subject: [PATCH 1008/1137] Fix: uniformize fields size and maxlength compared to db size --- htdocs/adherents/card.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5ab8ff1cc99..6e5389e346a 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -843,7 +843,7 @@ else // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; + print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; } // Password @@ -852,7 +852,7 @@ else require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password=getRandomPassword(false); print ''.$langs->trans("Password").''; - print ''; + print ''; print ''; } @@ -875,7 +875,7 @@ else print "\n"; // Company - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Company").''; // Civility print ''.$langs->trans("UserTitle").''; @@ -883,15 +883,15 @@ else print ''; // Lastname - print ''.$langs->trans("Lastname").''; + print ''.$langs->trans("Lastname").''; print ''; // Firstname - print ''.$langs->trans("Firstname").''; + print ''.$langs->trans("Firstname").''; print ''; // EMail - print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').''; + print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').''; // Address print ''.$langs->trans("Address").''; @@ -1081,13 +1081,13 @@ else // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; + print ''.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">'; } // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Password").'pass).'">'; + print ''.$langs->trans("Password").'pass).'">'; } // Morphy $morphys["phy"] = $langs->trans("Physical"); @@ -1110,7 +1110,7 @@ else print ""; // Company - print ''.$langs->trans("Company").'societe).'">'; + print ''.$langs->trans("Company").'societe).'">'; // Civility print ''.$langs->trans("UserTitle").''; @@ -1119,11 +1119,11 @@ else print ''; // Lastname - print ''.$langs->trans("Lastname").'lastname).'">'; + print ''.$langs->trans("Lastname").'lastname).'">'; print ''; // Firstname - print ''.$langs->trans("Firstname").'firstname).'">'; + print ''.$langs->trans("Firstname").'firstname).'">'; print ''; // Photo @@ -1142,7 +1142,7 @@ else print ''; // EMail - print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">'; + print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">'; // Address print ''.$langs->trans("Address").''; From 4a30448ff47543ae6efcc7f990cc47663b9a3a6b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 11:34:28 +0200 Subject: [PATCH 1009/1137] Fix: use fullname instead id is more explicit --- .../interface_20_all_Logevents.class.php | 10 +++--- ...terface_50_modAgenda_ActionsAuto.class.php | 32 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 466712260c6..c2f15bd336d 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2009 Regis Houssin - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2005-2009 Laurent Destailleur + * Copyright (C) 2009-2017 Regis Houssin + * Copyright (C) 2014 Marcos García * * 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 @@ -63,7 +63,7 @@ class InterfaceLogevents extends DolibarrTriggers if ($action == 'USER_LOGIN') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - + $langs->load("users"); // Initialisation donnees (date,duree,texte,desc) $text="(UserLogged,".$object->login.")"; @@ -177,7 +177,7 @@ class InterfaceLogevents extends DolibarrTriggers // Add more information into desc from the context property if (! empty($desc) && ! empty($object->context['audit'])) $desc.=' - '.$object->context['audit']; - + // Add entry in event table include_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index ec1fa9465b5..3c34d0a3ee0 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2009-2011 Regis Houssin - * Copyright (C) 2011-2014 Juanjo Menent - * Copyright (C) 2013 Cedric GROSS - * Copyright (C) 2014 Marcos García - * Copyright (C) 2015 Bahfir Abbes +/* Copyright (C) 2005-2017 Laurent Destailleur + * Copyright (C) 2009-2017 Regis Houssin + * Copyright (C) 2011-2014 Juanjo Menent + * Copyright (C) 2013 Cedric GROSS + * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 Bahfir Abbes * * 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 @@ -635,8 +635,8 @@ class InterfaceActionsAuto extends DolibarrTriggers $langs->load("other"); $langs->load("members"); - if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",($object->newref?$object->newref:$object->ref)); - $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",($object->newref?$object->newref:$object->ref)); + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->getFullName($langs)); + $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->getFullName($langs)); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; @@ -648,8 +648,8 @@ class InterfaceActionsAuto extends DolibarrTriggers $langs->load("other"); $langs->load("members"); - if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref); - $object->actionmsg=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref); + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberModifiedInDolibarr",$object->getFullName($langs)); + $object->actionmsg=$langs->transnoentities("MemberModifiedInDolibarr",$object->getFullName($langs)); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; @@ -661,8 +661,8 @@ class InterfaceActionsAuto extends DolibarrTriggers $langs->load("other"); $langs->load("members"); - if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); - $object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->getFullName($langs)); + $object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->getFullName($langs)); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; @@ -676,8 +676,8 @@ class InterfaceActionsAuto extends DolibarrTriggers $langs->load("other"); $langs->load("members"); - if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); - $object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->getFullName($langs)); + $object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->getFullName($langs)); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; @@ -689,8 +689,8 @@ class InterfaceActionsAuto extends DolibarrTriggers $langs->load("other"); $langs->load("members"); - if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); - $object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->getFullName($langs)); + $object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->getFullName($langs)); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; From f2d9288db534d450e4966a83ab75baa358138426 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 12:38:44 +0200 Subject: [PATCH 1010/1137] NEW add company alias name when create company from member --- htdocs/adherents/card.php | 19 +++++++++++++------ htdocs/adherents/subscription.php | 24 +++++++++++++++--------- htdocs/core/class/html.form.class.php | 6 ++++-- htdocs/societe/class/societe.class.php | 8 ++++++-- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 6e5389e346a..c95b62e1dc0 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -223,7 +223,7 @@ if (empty($reshook)) { // User creation $company = new Societe($db); - $result=$company->create_from_member($object,GETPOST('companyname')); + $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha')); if ($result < 0) { @@ -1319,18 +1319,25 @@ else // Confirm create third party if ($action == 'create_thirdparty') { - $name = $object->getFullName($langs); - if (! empty($name)) + $companyalias=''; + $fullname = $object->getFullName($langs); + + if ($object->morphy == 'mor') { - if ($object->societe) $name.=' ('.$object->societe.')'; + $companyname=$object->societe; + if (! empty($fullname)) $companyalias=$fullname; } else { - $name=$object->societe; + $companyname=$fullname; + if (! empty($object->societe)) $companyalias=$object->societe; } // Create a form array - $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); + $formquestion=array( + array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"'), + array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"') + ); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 4b8f3b50648..405fe689816 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1,8 +1,8 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012-2017 Regis Houssin * Copyright (C) 2015-2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -109,7 +109,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights { // Creation user $company = new Societe($db); - $result=$company->create_from_member($object,$_POST["companyname"]); + $result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha')); if ($result < 0) { @@ -960,19 +960,25 @@ if ($rowid > 0) // Confirm create third party if ($action == 'create_thirdparty') { - $name = $object->getFullName($langs); - if (! empty($name)) + $companyalias=''; + $fullname = $object->getFullName($langs); + + if ($object->morphy == 'mor') { - if ($object->morphy == 'mor' && ! empty($object->societe)) $name=$object->societe.' ('.$name.')'; - else if ($object->societe) $name.=' ('.$object->societe.')'; + $companyname=$object->societe; + if (! empty($fullname)) $companyalias=$fullname; } else { - $name=$object->societe; + $companyname=$fullname; + if (! empty($object->societe)) $companyalias=$object->societe; } // Create a form array - $formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); + $formquestion=array( + array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"'), + array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"') + ); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93c24990af0..d4c8ce6f288 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3572,14 +3572,16 @@ class Form if (is_array($input) && ! empty($input)) { $size=(! empty($input['size'])?' size="'.$input['size'].'"':''); + $moreattr=(! empty($input['moreattr'])?' '.$input['moreattr']:''); + $css=(! empty($input['css'])?' '.$input['css']:''); if ($input['type'] == 'text') { - $more.=''.$input['label'].''."\n"; + $more.=''.$input['label'].''."\n"; } else if ($input['type'] == 'password') { - $more.=''.$input['label'].''."\n"; + $more.=''.$input['label'].''."\n"; } else if ($input['type'] == 'select') { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1c8c515545a..bf449f30976 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2981,19 +2981,23 @@ class Societe extends CommonObject * Create a third party into database from a member object * * @param Adherent $member Object member - * @param string $socname Name of third party to force + * @param string $socname Name of third party to force + * @param string $socalias Alias name of third party to force * @return int <0 if KO, id of created account if OK */ - function create_from_member(Adherent $member,$socname='') + function create_from_member(Adherent $member, $socname='', $socalias='') { global $user,$langs; $name = $socname?$socname:$member->societe; if (empty($name)) $name=$member->getFullName($langs); + $alias = $socalias?$socalias:''; + // Positionne parametres $this->nom=$name; // TODO deprecated $this->name=$name; + $this->name_alias=$alias; $this->address=$member->address; $this->zip=$member->zip; $this->town=$member->town; From 6402d5a2e42c1b0743952b40fc40280fdecf049b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 13:30:08 +0200 Subject: [PATCH 1011/1137] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- htdocs/projet/admin/project.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1e7dc926ff9..cb0cb9fcdaa 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1627,7 +1627,7 @@ ProjectsSetup=Project module setup ProjectsModelModule=Project reports document model TasksNumberingModules=Tasks numbering module TaskModelModule=Tasks reports document model -UseSearchToSelectProject=Use autocompletion fields to choose project (instead of using a list box) +UseSearchToSelectProject=Wait you press a key before loading content of project combo list (This may increase performance if you have a large number of project, but it is less convenient) ##### ECM (GED) ##### ##### Fiscal Year ##### AccountingPeriods=Accounting periods diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 53444a7580c..b9778b73a42 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -912,10 +912,10 @@ print ''; print ''; print ''.$langs->trans("AllowToSelectProjectFromOtherCompany").''; -print ''; +print ' '; +print ''; echo ajax_constantonoff('PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY'); print ''; -print ' '; print ''; /* Kept as hidden feature because this will be "probaly be supported by standard event feature in a future From 8f24a86352def847d5524c2549e1290cf7a324a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 14:16:22 +0200 Subject: [PATCH 1012/1137] NEW If max nb of generation is reached, date for next gen is striked --- .../facture/class/facture-rec.class.php | 24 +++++++++++++++++++ htdocs/compta/facture/fiche-rec.php | 2 +- .../compta/facture/invoicetemplate_list.php | 4 +++- htdocs/core/class/html.form.class.php | 10 ++++++-- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 0a9fa2872eb..dd42c8d3fb7 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -823,6 +823,30 @@ class FactureRec extends CommonInvoice return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency); } + /** + * Return if maximum number of generation is reached + * + * @return boolean False by default, True if maximum number of generation is reached + */ + function isMaxNbGenReached() + { + $ret = false; + if ($this->nb_gen_max > 0 && ($this->nb_gen_done >= $this->nb_gen_max)) $ret = true; + return $ret; + } + + /** + * Format string to output with by striking the string if max number of generation was reached + * + * @param string $ret Default value to output + * @return boolean False by default, True if maximum number of generation is reached + */ + function strikeIfMaxNbGenReached($ret) + { + // Special case to strike the date + return ($this->isMaxNbGenReached()?'':'').$ret.($this->isMaxNbGenReached()?'':''); + } + /** * Create all recurrents invoices (for all entities if multicompany is used). * A result may also be provided into this->output. diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 60156e0d047..dd37828fae6 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1430,7 +1430,7 @@ else print ''; if ($action == 'date_when' || $object->frequency > 0) { - print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); + print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); } print ''; print ''; diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index f39fc7a3185..201a2806188 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -520,6 +520,8 @@ if ($resql) $invoicerectmp->frequency=$objp->frequency; $invoicerectmp->suspend=$objp->suspend; $invoicerectmp->unit_frequency=$objp->unit_frequency; + $invoicerectmp->nb_gen_max=$objp->nb_gen_max; + $invoicerectmp->nb_gen_done=$objp->nb_gen_done; print ''; @@ -603,7 +605,7 @@ if ($resql) if (! empty($arrayfields['f.date_when']['checked'])) { print ''; - print ($objp->frequency ? dol_print_date($db->jdate($objp->date_when),'day') : ''.$langs->trans('NA').''); + print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').''); print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93c24990af0..6f968db22d3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -128,7 +128,7 @@ class Form } /** - * Output val field for an editable field + * Output value of a field for an editable field * * @param string $text Text of label (not used in this function) * @param string $htmlname Name of select field @@ -141,9 +141,10 @@ class Form * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @param string $moreparam More param to add on a href URL * @param int $notabletag Do no output table tags + * @param string $formatfunc Call a specific function to output field * @return string HTML edit field */ - function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=0) + function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=0, $formatfunc='') { global $conf,$langs,$db; @@ -257,6 +258,11 @@ class Form $ret.=$tmpcontent; } else $ret.=$value; + + if ($formatfunc && method_exists($object, $formatfunc)) + { + $ret=$object->$formatfunc($ret); + } } } return $ret; From 084dc7798dfe3f7dccd1e882b1d7f370bbb28b0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 14:51:42 +0200 Subject: [PATCH 1013/1137] Standardize use of function getCommonSubstitutionArray --- htdocs/comm/mailing/card.php | 2 +- htdocs/compta/facture/class/facture.class.php | 29 ++++---- htdocs/compta/facture/fiche-rec.php | 69 ++++++++----------- htdocs/core/lib/functions.lib.php | 25 ++++--- scripts/emailings/mailing-send.php | 2 +- 5 files changed, 61 insertions(+), 66 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 9f67db88bbb..539f8bede92 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -203,7 +203,7 @@ if (empty($reshook)) $targetobject = null; // Not defined with mass emailing $parameters=array('mode'=>'emailing'); - $substitutionarray=getCommonSubstitutionArray($langs, 2, array('object','objectamount'), $targetobject); // Note: On mass emailing, this is null because be don't know object + $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount'), $targetobject); // Note: On mass emailing, this is null because be don't know object // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) $substitutionarray['__ID__'] = $obj->source_id; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fcf41e090cc..6452c689215 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -351,22 +351,19 @@ class Facture extends CommonInvoice } // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) - $substitutionarray=array( - '__TOTAL_HT__' => price($this->total_ht, 0, $outputlangs, 0, 0, -1, $conf->currency_code), - '__TOTAL_TTC__' => price($this->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency_code), - '__INVOICE_PREVIOUS_MONTH__' => dol_print_date(dol_time_plus_duree($this->date, -1, 'm'), '%m'), - '__INVOICE_MONTH__' => dol_print_date($this->date, '%m'), - '__INVOICE_NEXT_MONTH__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'm'), '%m'), - '__INVOICE_PREVIOUS_MONTH_TEXT__' => dol_print_date(dol_time_plus_duree($this->date, -1, 'm'), '%B'), - '__INVOICE_MONTH_TEXT__' => dol_print_date($this->date, '%B'), - '__INVOICE_NEXT_MONTH_TEXT__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'm'), '%B'), - '__INVOICE_PREVIOUS_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y'), - '__INVOICE_YEAR__' => dol_print_date($this->date, '%Y'), - '__INVOICE_NEXT_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'), - // Only for tempalte invoice - '__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => dol_print_date($originaldatewhen, 'dayhour'), - '__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => dol_print_date(dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency), 'dayhour') - ); + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $this); + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'm'), '%m'); + $substitutionarray['__INVOICE_MONTH__'] = dol_print_date($this->date, '%m'); + $substitutionarray['__INVOICE_NEXT_MONTH__'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'm'), '%m'); + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'm'), '%B'); + $substitutionarray['__INVOICE_MONTH_TEXT__'] = dol_print_date($this->date, '%B'); + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'm'), '%B'); + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y'); + $substitutionarray['__INVOICE_YEAR__'] = dol_print_date($this->date, '%Y'); + $substitutionarray['__INVOICE_NEXT_YEAR__'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'); + // Only for tempalte invoice + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = dol_print_date($originaldatewhen, 'dayhour'); + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = dol_print_date(dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency), 'dayhour'); //var_dump($substitutionarray);exit; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index dd37828fae6..17cc14eba84 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -969,26 +969,20 @@ if ($action == 'create') $note_private=GETPOST('note_private','none')?GETPOST('note_private','none'):$object->note_private; // Help of substitution key - $substitutionarray=array( - //'__TOTAL_HT__' => $langs->trans("AmountHT").' ('.$langs->trans("Example").': '.price($object->total_ht).')', - //'__TOTAL_TTC__' => $langs->trans("AmountTTC").' ('.$langs->trans("Example").': '.price($object->total_ttc).')', - '__AMOUNT_EXCL_TAX__' => $langs->trans("AmountHT").' ('.$langs->trans("Example").': '.price($object->total_ht).')', - '__AMOUNT_VAT__' => $langs->trans("AmountVAT").' ('.$langs->trans("Example").': '.price($object->total_tva).')', - '__AMOUNT__' => $langs->trans("AmountTTC").' ('.$langs->trans("Example").': '.price($object->total_ttc).')', - '__INVOICE_PREVIOUS_MONTH__' => $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'),'%m').')', - '__INVOICE_MONTH__' => $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%m').')', - '__INVOICE_NEXT_MONTH__' => $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'),'%m').')', - '__INVOICE_PREVIOUS_MONTH_TEXT__' => $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'),'%B').')', - '__INVOICE_MONTH_TEXT__' => $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%B').')', - '__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')', - '__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'),'%Y').')', - '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')', - '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')', - // Only on template invoices - '__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')', - '__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')', - ); - $substitutionarray['__(TransKey)__']=$langs->trans("TransKey"); + $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); + + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'),'%m').')'; + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%m').')'; + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'),'%m').')'; + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'),'%B').')'; + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%B').')'; + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')'; + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'),'%Y').')'; + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')'; + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')'; + // Only on template invoices + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')'; + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')'; $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
        '; foreach($substitutionarray as $key => $val) @@ -1294,26 +1288,21 @@ else // Help of substitution key $dateexample=dol_now(); if (! empty($object->frequency) && ! empty($object->date_when)) $dateexample=$object->date_when; - $substitutionarray=array( - //'__TOTAL_HT__' => $langs->trans("AmountHT").' ('.$langs->trans("Example").': '.price($object->total_ht).')', - //'__TOTAL_TTC__' => $langs->trans("AmountTTC").' ('.$langs->trans("Example").': '.price($object->total_ttc).')', - '__AMOUNT_EXCL_TAX__' => $langs->trans("AmountHT").' ('.$langs->trans("Example").': '.price($object->total_ht).')', - '__AMOUNT_VAT__' => $langs->trans("AmountVAT").' ('.$langs->trans("Example").': '.price($object->total_tva).')', - '__AMOUNT__' => $langs->trans("AmountTTC").' ('.$langs->trans("Example").': '.price($object->total_ttc).')', - '__INVOICE_PREVIOUS_MONTH__' => $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%m').')', - '__INVOICE_MONTH__' => $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%m').')', - '__INVOICE_NEXT_MONTH__' => $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'),'%m').')', - '__INVOICE_PREVIOUS_MONTH_TEXT__' => $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%B').')', - '__INVOICE_MONTH_TEXT__' => $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%B').')', - '__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')', - '__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'),'%Y').')', - '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')', - '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')', - // Only on template invoices - '__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')', - '__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')', - ); - $substitutionarray['__(TransKey)__']=$langs->trans("TransKey"); + + $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); + + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%m').')'; + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%m').')'; + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'),'%m').')'; + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%B').')'; + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%B').')'; + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')'; + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'),'%Y').')'; + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')'; + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')'; + // Only on template invoices + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')'; + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')'; $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
        '; foreach($substitutionarray as $key => $val) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dcba7e20739..1d173d103fb 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5287,13 +5287,15 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__'; $substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__'; - $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; - $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; - $substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__'; - + if (is_object($object) && $object->element == 'shipping') + { + $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; + $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; + $substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__'; + } $substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__'; $substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__'; - $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_REF__'; + $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start'; @@ -5307,9 +5309,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = 'Security key for payment on an invoice'; $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'Security key for payment on a a service'; - $substitutionarray['__SHIPPINGTRACKNUM__']='Shipping tacking number'; - $substitutionarray['__SHIPPINGTRACKNUMURL__']='Shipping tracking url'; - + if (is_object($object) && $object->element == 'shipping') + { + $substitutionarray['__SHIPPINGTRACKNUM__']='Shipping tacking number'; + $substitutionarray['__SHIPPINGTRACKNUMURL__']='Shipping tracking url'; + } } else { @@ -5396,6 +5400,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__AMOUNT__'] = is_object($object)?$object->total_ttc:''; $substitutionarray['__AMOUNT_EXCL_TAX__'] = is_object($object)?$object->total_ht:''; $substitutionarray['__AMOUNT_VAT__'] = is_object($object)?($object->total_vat?$object->total_vat:$object->total_tva):''; + /* TODO Add key for multicurrency + $substitutionarray['__AMOUNT_FORMATED__'] = is_object($object)?price($object->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency_code):''; + $substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object)?price($object->total_ht, 0, $outputlangs, 0, 0, -1, $conf->currency_code):''; + $substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object)?($object->total_vat?price($object->total_vat, 0, $outputlangs, 0, 0, -1, $conf->currency_code):price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency_code)):''; + */ // For backward compatibility if ($onlykey != 2) { diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index a6cf54ab40d..836f435890b 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -165,7 +165,7 @@ if ($resql) $object = null; // Not defined with mass emailing $parameters=array('mode'=>'emailing'); - $substitutionarray=getCommonSubstitutionArray($langs, 2, array('object','objectamount'), $object); // Note: On mass emailing, this is null because we don't know object + $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount'), $object); // Note: On mass emailing, this is null because we don't know object // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) $substitutionarray['__ID__'] = $obj->source_id; From 16b766182c40dbb55fa62acedd591041f2688d86 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 15:35:08 +0200 Subject: [PATCH 1014/1137] NEW view company name if different of fullname in dol_banner --- htdocs/core/class/html.form.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d4c8ce6f288..3a571a7d75b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3581,7 +3581,7 @@ class Form } else if ($input['type'] == 'password') { - $more.=''.$input['label'].''."\n"; + $more.=''.$input['label'].''."\n"; } else if ($input['type'] == 'select') { @@ -6017,7 +6017,16 @@ class Form { $ret.=dol_htmlentities($object->name); } - else if (in_array($object->element, array('contact', 'user', 'usergroup', 'member'))) + else if ($object->element == 'member') + { + $fullname=$object->getFullName($langs); + if ($object->morphy == 'mor') { + $ret.= dol_htmlentities($object->societe) . (($object->societe != $fullname)?' ('.dol_htmlentities($fullname).')':''); + } else { + $ret.= dol_htmlentities($fullname) . (($object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':''); + } + } + else if (in_array($object->element, array('contact', 'user', 'usergroup'))) { $ret.=dol_htmlentities($object->getFullName($langs)); } From 86c301f197866bbae6b1f0cf33b8957ed2522e96 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 15:49:10 +0200 Subject: [PATCH 1015/1137] Fix: uniformize parameters --- htdocs/adherents/card.php | 4 ++-- htdocs/adherents/subscription.php | 4 ++-- htdocs/core/class/html.form.class.php | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index c95b62e1dc0..3d203334648 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1335,8 +1335,8 @@ else // Create a form array $formquestion=array( - array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"'), - array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"') + array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'), + array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"') ); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 405fe689816..9fa30981a9f 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -976,8 +976,8 @@ if ($rowid > 0) // Create a form array $formquestion=array( - array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"'), - array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'css' => 'minwidth300', 'moreattr' => 'maxlength="128"') + array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'), + array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"') ); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3a571a7d75b..e7902fe3289 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3573,28 +3573,28 @@ class Form { $size=(! empty($input['size'])?' size="'.$input['size'].'"':''); $moreattr=(! empty($input['moreattr'])?' '.$input['moreattr']:''); - $css=(! empty($input['css'])?' '.$input['css']:''); + $morecss=(! empty($input['morecss'])?' '.$input['morecss']:''); if ($input['type'] == 'text') { - $more.=''.$input['label'].''."\n"; + $more.=''.$input['label'].''."\n"; } else if ($input['type'] == 'password') { - $more.=''.$input['label'].''."\n"; + $more.=''.$input['label'].''."\n"; } else if ($input['type'] == 'select') { $more.=''; if (! empty($input['label'])) $more.=$input['label'].''; - $more.=$this->selectarray($input['name'],$input['values'],$input['default'],1); + $more.=$this->selectarray($input['name'],$input['values'],$input['default'],1,0,0,$moreattr,0,0,0,'',$morecss); $more.=''."\n"; } else if ($input['type'] == 'checkbox') { $more.=''; $more.=''.$input['label'].' '; - $more.=''; else $more.=' '; - $more.=' Date: Mon, 9 Oct 2017 16:13:53 +0200 Subject: [PATCH 1016/1137] NEW A module can change order of element in the quick search combo --- htdocs/core/ajax/selectsearchbox.php | 62 ++++++++++--------- .../template/class/actions_mymodule.class.php | 4 +- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 2d92bc8f938..f04e2e95b18 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -56,85 +56,85 @@ $arrayresult=array(); // Define $searchform if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { - $arrayresult['searchintothirdparty']=array('img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintothirdparty']=array('position'=>10, 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) { - $arrayresult['searchintocontact']=array('img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintocontact']=array('position'=>15, 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); +} + +if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) +{ + $arrayresult['searchintomember']=array('position'=>20, 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { - $arrayresult['searchintoproduct']=array('img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoproduct']=array('position'=>30, 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintoprojects']=array('img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); + $arrayresult['searchintoprojects']=array('position'=>40, 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintotasks']=array('img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue)); -} - -if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) -{ - $arrayresult['searchintomember']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); -} - -if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) -{ - $arrayresult['searchintouser']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintotasks']=array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue)); } if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) { - $arrayresult['searchintopropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintopropal']=array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire) { - $arrayresult['searchintoorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue)); -} -if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) -{ - $arrayresult['searchintoinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoorder']=array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { - $arrayresult['searchintoshipment']=array('img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoshipment']=array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue)); +} +if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) +{ + $arrayresult['searchintoinvoice']=array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) { - $arrayresult['searchintosupplierpropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintosupplierpropal']=array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire) { - $arrayresult['searchintosupplierorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue)); + $arrayresult['searchintosupplierorder']=array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue)); } if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire) { - $arrayresult['searchintosupplierinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintosupplierinvoice']=array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) { - $arrayresult['searchintocontract']=array('img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintocontract']=array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire) { - $arrayresult['searchintointervention']=array('img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintointervention']=array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue)); } + // HR +if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) +{ + $arrayresult['searchintouser']=array('position'=>200, 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); +} if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) { - $arrayresult['searchintoexpensereport']=array('img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoexpensereport']=array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) { - $arrayresult['searchintoleaves']=array('img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoleaves']=array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } @@ -147,7 +147,7 @@ if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLO */ // Execute hook addSearchEntry -$parameters=array('search_boxvalue'=>$search_boxvalue); +$parameters=array('search_boxvalue'=>$search_boxvalue, 'arrayresult'=>$arrayresult); $reshook=$hookmanager->executeHooks('addSearchEntry',$parameters); if (empty($reshook)) { @@ -155,6 +155,8 @@ if (empty($reshook)) } else $arrayresult=$hookmanager->resArray; +// Sort on position +$arrayresult = dol_sort_array($arrayresult, 'position'); // Print output if called by ajax or do nothing (var $arrayresult will be used) if called by an include if (! isset($usedbyinclude) || empty($usedbyinclude)) diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php index 7b353113c00..b0265a28e3f 100644 --- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php @@ -81,8 +81,8 @@ class ActionsMyModule /* print_r($parameters); print_r($object); echo "action: " . $action; */ if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2' { - - + // Do what you want here... + // You can for example call global vars like $fieldstosearchall to overwrite them, or update database depending on $action and $_POST values. } if (! $error) { From e2206d9bf2082475fdf675d379fc2dac4af0488a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 16:33:22 +0200 Subject: [PATCH 1017/1137] Fix: uniformize substitution tags --- htdocs/adherents/admin/adherent.php | 12 +-- htdocs/adherents/admin/adherent_emails.php | 12 +-- htdocs/adherents/cartes/carte.php | 40 ++++----- .../modules/member/doc/pdf_standard.class.php | 90 +++++++++---------- htdocs/core/modules/modAdherent.class.php | 14 +-- 5 files changed, 84 insertions(+), 84 deletions(-) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 93b90c01c92..ada5dd82060 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -240,9 +240,9 @@ $constantes=array( print load_fiche_titre($langs->trans("MembersCards"),'',''); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
        '; -$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; -$helptext.='%YEAR%, %MONTH%, %DAY%'; +$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; +$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; +$helptext.='__YEAR__, __MONTH__, __DAY__'; form_constantes($constantes, 0, $helptext); @@ -257,9 +257,9 @@ $constantes=array('ADHERENT_ETIQUETTE_TYPE','ADHERENT_ETIQUETTE_TEXT'); print load_fiche_titre($langs->trans("MembersTickets"),'',''); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
        '; -$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; -$helptext.='%YEAR%, %MONTH%, %DAY%'; +$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; +$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; +$helptext.='__YEAR__, __MONTH__, __DAY__'; form_constantes($constantes, 0, $helptext); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index a4c2f937146..ac4d88b1bba 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -171,14 +171,14 @@ $constantes=array( ); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
        '; -$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; -$helptext.='%YEAR%, %MONTH%, %DAY%'; +$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; +$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; +$helptext.='__YEAR__, __MONTH__, __DAY__'; $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
        '; -$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; -//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported +$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; +$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; +//$helptext.='__YEAR__, __MONTH__, __DAY__'; // Not supported form_constantes($constantes, 0, $helptext); diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 63fd59f01e9..487dfa7f225 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -116,25 +116,25 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // List of values to scan for a replacement $substitutionarray = array ( - '%ID%'=>$objp->rowid, - '%LOGIN%'=>$objp->login, - '%FIRSTNAME%'=>$objp->firstname, - '%LASTNAME%'=>$objp->lastname, - '%FULLNAME%'=>$adherentstatic->getFullName($langs), - '%COMPANY%'=>$objp->company, - '%ADDRESS%'=>$objp->address, - '%ZIP%'=>$objp->zip, - '%TOWN%'=>$objp->town, - '%COUNTRY%'=>$objp->country, - '%COUNTRY_CODE%'=>$objp->country_code, - '%EMAIL%'=>$objp->email, - '%BIRTH%'=>dol_print_date($objp->birth,'day'), - '%TYPE%'=>$objp->type, - '%YEAR%'=>$year, - '%MONTH%'=>$month, - '%DAY%'=>$day, - '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, - '%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/" + '__ID__'=>$objp->rowid, + '__LOGIN__'=>$objp->login, + '__FIRSTNAME__'=>$objp->firstname, + '__LASTNAME__'=>$objp->lastname, + '__FULLNAME__'=>$adherentstatic->getFullName($langs), + '__COMPANY__'=>$objp->company, + '__ADDRESS__'=>$objp->address, + '__ZIP__'=>$objp->zip, + '__TOWN__'=>$objp->town, + '__COUNTRY__'=>$objp->country, + '__COUNTRY_CODE__'=>$objp->country_code, + '__EMAIL__'=>$objp->email, + '__BIRTH__'=>dol_print_date($objp->birth,'day'), + '__TYPE__'=>$objp->type, + '__YEAR__'=>$year, + '__MONTH__'=>$month, + '__DAY__'=>$day, + '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, + '__SERVER__'=>"http://".$_SERVER["SERVER_NAME"]."/" ); complete_substitutions_array($substitutionarray, $langs, $adherentstatic); @@ -179,7 +179,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // For labels if ($mode == 'label') { - if (empty($conf->global->ADHERENT_ETIQUETTE_TEXT)) $conf->global->ADHERENT_ETIQUETTE_TEXT="%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%"; + if (empty($conf->global->ADHERENT_ETIQUETTE_TEXT)) $conf->global->ADHERENT_ETIQUETTE_TEXT="__FULLNAME__\n__ADDRESS__\n__ZIP__ __TOWN__\n__COUNTRY__"; $textleft=make_substitutions($conf->global->ADHERENT_ETIQUETTE_TEXT, $substitutionarray); $textheader=''; $textfooter=''; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 6fd8ecfee70..4d08be83a43 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -48,8 +48,8 @@ class pdf_standard extends CommonStickerGenerator /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) - * - %LOGO% is replace with company logo - * - %PHOTO% is replace with photo provided as parameter + * - __LOGO__ is replace with company logo + * - __PHOTO__ is replace with photo provided as parameter * * @param PDF $pdf PDF * @param string $textleft Text left @@ -58,7 +58,7 @@ class pdf_standard extends CommonStickerGenerator * @param Translate $outputlangs Output langs * @param string $textright Text right * @param int $idmember Id member - * @param string $photo Photo (full path to image file used as replacement for key %PHOTOS% into left, right, header or footer text) + * @param string $photo Photo (full path to image file used as replacement for key __PHOTOS__ into left, right, header or footer text) * @return void */ function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$idmember=0,$photo='') @@ -95,7 +95,7 @@ class pdf_standard extends CommonStickerGenerator $member=new Adherent($db); $member->id = $idmember; $member->ref = $idmember; - + // Define photo $dir=$conf->adherent->dir_output; if (! empty($photo)) @@ -161,8 +161,8 @@ class pdf_standard extends CommonStickerGenerator if ($textright=='') // Only a left part { // Output left area - if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); - else if ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + if ($textleft == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + else if ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); else { $pdf->SetXY($_PosX+$xleft, $_PosY+$ytop); @@ -171,17 +171,17 @@ class pdf_standard extends CommonStickerGenerator } else if ($textleft!='' && $textright!='') // { - if ($textleft == '%LOGO%' || $textleft == '%PHOTO%') + if ($textleft == '__LOGO__' || $textleft == '__PHOTO__') { - if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); - else if ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + if ($textleft == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + else if ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); $pdf->SetXY($_PosX+$xleft+$widthtouse+1, $_PosY+$ytop); $pdf->MultiCell($this->_Width-$xleft-$xleft-$widthtouse-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright),0,'R'); } - else if ($textright == '%LOGO%' || $textright == '%PHOTO%') + else if ($textright == '__LOGO__' || $textright == '__PHOTO__') { - if ($textright == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); - else if ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + if ($textright == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + else if ($textright == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); $pdf->SetXY($_PosX+$xleft, $_PosY+$ytop); $pdf->MultiCell($this->_Width-$widthtouse-$xleft-$xleft-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L'); } @@ -196,8 +196,8 @@ class pdf_standard extends CommonStickerGenerator else // Only a right part { // Output right area - if ($textright == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); - else if ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + if ($textright == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); + else if ($textright == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse); else { $pdf->SetXY($_PosX+$xleft, $_PosY+$ytop); @@ -247,34 +247,34 @@ class pdf_standard extends CommonStickerGenerator function write_file($object, $outputlangs, $srctemplatepath, $mode='member', $nooutput=0) { global $user,$conf,$langs,$mysoc,$_Avery_Labels; - + $this->code=$srctemplatepath; - + if (is_object($object)) { if ($object->country == '-') $object->country=''; // List of values to scan for a replacement $substitutionarray = array ( - '%ID%'=>$object->rowid, - '%LOGIN%'=>$object->login, - '%FIRSTNAME%'=>$object->firstname, - '%LASTNAME%'=>$object->lastname, - '%FULLNAME%'=>$object->getFullName($langs), - '%COMPANY%'=>$object->company, - '%ADDRESS%'=>$object->address, - '%ZIP%'=>$object->zip, - '%TOWN%'=>$object->town, - '%COUNTRY%'=>$object->country, - '%COUNTRY_CODE%'=>$object->country_code, - '%EMAIL%'=>$object->email, - '%BIRTH%'=>dol_print_date($object->birth,'day'), - '%TYPE%'=>$object->type, - '%YEAR%'=>$year, - '%MONTH%'=>$month, - '%DAY%'=>$day, - '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, - '%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/" + '__ID__'=>$object->rowid, + '__LOGIN__'=>$object->login, + '__FIRSTNAME__'=>$object->firstname, + '__LASTNAME__'=>$object->lastname, + '__FULLNAME__'=>$object->getFullName($langs), + '__COMPANY__'=>$object->company, + '__ADDRESS__'=>$object->address, + '__ZIP__'=>$object->zip, + '__TOWN__'=>$object->town, + '__COUNTRY__'=>$object->country, + '__COUNTRY_CODE__'=>$object->country_code, + '__EMAIL__'=>$object->email, + '__BIRTH__'=>dol_print_date($object->birth,'day'), + '__TYPE__'=>$object->type, + '__YEAR__'=>$year, + '__MONTH__'=>$month, + '__DAY__'=>$day, + '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, + '__SERVER__'=>"http://".$_SERVER["SERVER_NAME"]."/" ); complete_substitutions_array($substitutionarray, $langs); @@ -283,10 +283,10 @@ class pdf_standard extends CommonStickerGenerator $textheader=make_substitutions($conf->global->ADHERENT_CARD_HEADER_TEXT, $substitutionarray); $textfooter=make_substitutions($conf->global->ADHERENT_CARD_FOOTER_TEXT, $substitutionarray); $textright=make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray); - + $nb = $_Avery_Labels[$this->code]['NX'] * $_Avery_Labels[$this->code]['NY']; if ($nb <= 0) $nb=1; // Protection to avoid empty page - + for($j=0;$j<$nb;$j++) { $arrayofmembers[]=array( @@ -298,7 +298,7 @@ class pdf_standard extends CommonStickerGenerator 'photo'=>$object->photo ); } - + $arrayofrecords = $arrayofmembers; } else @@ -348,7 +348,7 @@ class pdf_standard extends CommonStickerGenerator $dir = $outputdir."/".get_exdir(0, 0, 0, 0, $object, 'member'); $file = $dir.'/'.$filename; } - else + else { $outputdir = $conf->adherent->dir_temp; $dir = $outputdir; @@ -419,28 +419,28 @@ class pdf_standard extends CommonStickerGenerator $this->result = array('fullpath'=>$file); - + // Output to http stream if (empty($nooutput)) { clearstatcache(); - + $attachment=true; if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false; $type=dol_mimetype($filename); - + //if ($encoding) header('Content-Encoding: '.$encoding); if ($type) header('Content-Type: '.$type); if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"'); else header('Content-Disposition: inline; filename="'.$filename.'"'); - + // Ajout directives pour resoudre bug IE header('Cache-Control: Public, must-revalidate'); header('Pragma: public'); - + readfile($file); } - + return 1; } diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index ade0e2c7e75..aa098146dc7 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -93,7 +93,7 @@ class modAdherent extends DolibarrModules $this->const[$r][0] = "ADHERENT_MAIL_VALID"; $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n"; + $this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n__INFOS__\r\n\r\n"; $this->const[$r][3] = "Mail de validation"; $this->const[$r][4] = 0; $r++; @@ -121,7 +121,7 @@ class modAdherent extends DolibarrModules $this->const[$r][0] = "ADHERENT_MAIL_COTIS"; $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Bonjour %FIRSTNAME%,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée"; + $this->const[$r][2] = "Bonjour __FIRSTNAME__,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée"; $this->const[$r][3] = "Mail de validation de cotisation"; $this->const[$r][4] = 0; $r++; @@ -135,21 +135,21 @@ class modAdherent extends DolibarrModules $this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "%YEAR%"; + $this->const[$r][2] = "__YEAR__"; $this->const[$r][3] = "Texte imprimé sur le haut de la carte adhérent"; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "ADHERENT_CARD_FOOTER_TEXT"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "%COMPANY%"; + $this->const[$r][2] = "__COMPANY__"; $this->const[$r][3] = "Texte imprimé sur le bas de la carte adhérent"; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "ADHERENT_CARD_TEXT"; $this->const[$r][1] = "texte"; - $this->const[$r][2] = "%FULLNAME%\r\nID: %ID%\r\n%EMAIL%\r\n%ADDRESS%\r\n%ZIP% %TOWN%\r\n%COUNTRY%"; + $this->const[$r][2] = "__FULLNAME__\r\nID: __ID__\r\n__EMAIL__\r\n__ADDRESS__\r\n__ZIP__ __TOWN__\r\n__COUNTRY__"; $this->const[$r][3] = "Text to print on member cards"; $this->const[$r][4] = 0; $r++; @@ -184,7 +184,7 @@ class modAdherent extends DolibarrModules $this->const[$r][0] = "ADHERENT_ETIQUETTE_TEXT"; $this->const[$r][1] = "texte"; - $this->const[$r][2] = "%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%"; + $this->const[$r][2] = "__FULLNAME__\n__ADDRESS__\n__ZIP__ __TOWN__\n__COUNTRY%"; $this->const[$r][3] = "Text to print on member address sheets"; $this->const[$r][4] = 0; $r++; @@ -324,7 +324,7 @@ class modAdherent extends DolibarrModules // End add extra fields $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r]=array('a.civility'=>'code@'.MAIN_DB_PREFIX.'c_civility','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $this->import_examplevalues_array[$r]=array('a.civility'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note_public'=>"This is a public comment on member",'a.note_private'=>"This is private comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d')); + $this->import_examplevalues_array[$r]=array('a.civility'=>"MR",'a.lastname'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note_public'=>"This is a public comment on member",'a.note_private'=>"This is private comment on member",'a.datec'=>dol_print_date($now,'%Y-%m__%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d')); } From 4e34c13e49b770748955f4541b5723a10a7de8ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 16:49:17 +0200 Subject: [PATCH 1018/1137] Debug --- htdocs/modulebuilder/template/myobject_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 5677ab3baf2..b6c2f86e13f 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -369,7 +369,7 @@ if (! empty($moreforfilter)) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields -$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); +$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
        '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''."\n"; @@ -633,7 +633,7 @@ print ''."\n"; print ''."\n"; -if ($nbtotalofrecords === '' || $nbtotalofrecords) +if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { From 625e440653b71b0b18821408fafd61e6cf064953 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 16:50:20 +0200 Subject: [PATCH 1019/1137] Fix: wrong test --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e7902fe3289..3066c7c9518 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6021,9 +6021,9 @@ class Form { $fullname=$object->getFullName($langs); if ($object->morphy == 'mor') { - $ret.= dol_htmlentities($object->societe) . (($object->societe != $fullname)?' ('.dol_htmlentities($fullname).')':''); + $ret.= dol_htmlentities($object->societe) . ((! empty($fullname) && $object->societe != $fullname)?' ('.dol_htmlentities($fullname).')':''); } else { - $ret.= dol_htmlentities($fullname) . (($object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':''); + $ret.= dol_htmlentities($fullname) . ((! empty($object->societe) && $object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':''); } } else if (in_array($object->element, array('contact', 'user', 'usergroup'))) From 2bd66290a34e1cb24e0ea3fb15e79d8e24baa85c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 16:58:17 +0200 Subject: [PATCH 1020/1137] Fix: for avoid scroll bar --- htdocs/adherents/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 3d203334648..0fa17e39167 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1354,8 +1354,8 @@ else $texttosend=$object->makeSubstitution($adht->getMailOnValid()); $tmp=$langs->trans("SendAnEMailToMember"); - $tmp.='
        ('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; - $tmp.=$langs->trans("MailRecipient").': '.$object->email.')'; + $tmp.='
        '.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; + $tmp.='
        '.$langs->trans("MailRecipient").': '.$object->email.''; $helpcontent=''; $helpcontent.=''.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.'
        '."\n"; $helpcontent.=''.$langs->trans("MailRecipient").': '.$object->email.'
        '."\n"; From 19de053054ce0912023ec44349fb160fc2c1519c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 17:43:57 +0200 Subject: [PATCH 1021/1137] Fix itf8 mix collation --- htdocs/install/mysql/migration/5.0.0-6.0.0.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index a2534728683..634045d3e4e 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -26,6 +26,12 @@ +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) COLLATE utf8_unicode_ci; + + ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; From 15911a9b649a6cbc79b71ba8e4c716c60f163bd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 17:45:08 +0200 Subject: [PATCH 1022/1137] Fix illegal mix collation --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 4 ++++ htdocs/install/mysql/migration/repair.sql | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 223a8aeeeb4..bc9fad269a9 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -338,6 +338,10 @@ DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPENSEREPORT_JOURNAL') -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index ee4c549ccd3..7bc403fd3b3 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -31,6 +31,10 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; From dcf497f3327aafc00b390e3fb0b355e37835052f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Oct 2017 17:55:14 +0200 Subject: [PATCH 1023/1137] Fix: add $confirm value inside doAction hook parameters --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0fa17e39167..95cfd729fe5 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -121,7 +121,7 @@ $hookmanager->initHooks(array('membercard','globalcard')); * Actions */ -$parameters=array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas); +$parameters=array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas, 'confirm'=>$confirm); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 4de1ade605f3722dd7b7e2e87e6ffe4b63b20f11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 18:15:10 +0200 Subject: [PATCH 1024/1137] Fix mix collation --- .../install/mysql/migration/6.0.0-7.0.0.sql | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index bc9fad269a9..3ecf4b405c8 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -25,6 +25,28 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_c_type_fees MODIFY accountancy_code VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_c_type_fees MODIFY accountancy_code VARCHAR(32) COLLATE utf8_unicode_ci; + + -- Missing in 5.0 ALTER TABLE llx_user MODIFY login varchar(50) NOT NULL; @@ -334,27 +356,6 @@ DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_DEVISE')__; DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPORT_PIECE')__; DELETE FROM llx_const WHERE name = __ENCRYPT('ACCOUNTING_EXPENSEREPORT_JOURNAL')__; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) COLLATE utf8_unicode_ci; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_c_type_fees MODIFY accountancy_code VARCHAR(32) CHARACTER SET utf8; --- VMYSQLUTF8UNICODECI ALTER TABLE llx_c_type_fees MODIFY accountancy_code VARCHAR(32) COLLATE utf8_unicode_ci; - ALTER TABLE llx_c_paiement DROP PRIMARY KEY; ALTER TABLE llx_c_paiement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER id; ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; From 9427655dd09bdacc2f38e9c9d4886b78a474eaf4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 18:18:34 +0200 Subject: [PATCH 1025/1137] Option PROJECT_LINES_PERxxx_SHOW_THIRDPARTY is the default --- htdocs/core/lib/project.lib.php | 30 ++++++++++++------------------ htdocs/projet/activity/perday.php | 10 +++------- htdocs/projet/activity/perweek.php | 10 +++------- 3 files changed, 18 insertions(+), 32 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index e6c49492769..05bbcf26098 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -663,15 +663,12 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); print ""; - if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) - { - // Thirdparty - print '
        '; - } + // Thirdparty + print ''; // Ref print '"; - if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) - { - // Thirdparty - print ''; - } + // Thirdparty + print ''; // Ref print ''."\n"; print ''."\n"; print ''."\n"; @@ -343,7 +345,7 @@ foreach($configfileparameters as $key => $value) { $newkey = preg_replace('/^\?/','',$key); - if (preg_match('/^\?/',$key) && empty(${$newkey})) + if (preg_match('/^\?/',$key) && empty(${$newkey})) { if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled)) continue; // We discard parameters starting with ? diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a47f6d9735d..046fb1e6967 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1723,6 +1723,7 @@ MultiPriceRuleDesc=When option "Several level of prices per product/service" is ModelModulesProduct=Templates for product documents ToGenerateCodeDefineAutomaticRuleFirst=To be able to generate automatically codes, you must first define a manager to auto define barcode number. SeeSubstitutionVars=See * note for list of possible substitution variables +SeeChangeLog=See ChangeLog file (english only) AllPublishers=All publishers UnknownPublishers=Unknown publishers AddRemoveTabs=Add or remove tabs From 2a76cc6f5434a6839c84d0835dbec57ef43fa9c3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 10 Oct 2017 06:34:16 +0200 Subject: [PATCH 1031/1137] Fix : missing class AccountingJournal in subscription member page when accountancy not activated --- htdocs/adherents/subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 8002b33b1f6..9bb4565d6c9 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; $langs->load("companies"); $langs->load("bills"); From 00db16e0deab03cb0fcf85458db42d6f7d1acfe4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 08:49:00 +0200 Subject: [PATCH 1032/1137] Fix: force jquery cal if MAIN_POPUP_CALENDAR=eldy (showDP commented) --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93c24990af0..7c4948789b1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4742,7 +4742,9 @@ class Form // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' $usecalendar='combo'; - if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) $usecalendar=empty($conf->global->MAIN_POPUP_CALENDAR)?'jquery':$conf->global->MAIN_POPUP_CALENDAR; + if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) { + $usecalendar = ((empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == 'eldy')?'jquery':$conf->global->MAIN_POPUP_CALENDAR); + } //if (! empty($conf->browser->phone)) $usecalendar='combo'; if ($d) From f51c0db7059862c78ecd5fb8d9e4941f9e19c732 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 09:16:14 +0200 Subject: [PATCH 1033/1137] NEW add translation and possibility to change month and year --- htdocs/core/class/html.form.class.php | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7c4948789b1..4af8364a751 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4790,7 +4790,54 @@ class Form $retstring.="'."\n"; - // Add datepicker default options - /*if (! defined('DISABLE_DATE_PICKER')) + // Add datepicker default options (needed by jquery datepicker!) + if (! defined('DISABLE_DATE_PICKER')) { print ''."\n"; - }*/ + } // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) From 4530f94fa67b93675619a4903771a21c097c37ac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 10:07:52 +0200 Subject: [PATCH 1037/1137] Fix: restore parameters, needed for save in place --- htdocs/core/js/datepicker.js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php index a763533f9b3..3de57f0543f 100644 --- a/htdocs/core/js/datepicker.js.php +++ b/htdocs/core/js/datepicker.js.php @@ -119,7 +119,9 @@ $(document).ready(function() { $.datepicker.setDefaults({ autoSize: true, changeMonth: true, - changeYear: true + changeYear: true, + altField: '#timestamp', + altFormat: '@' // Gives a timestamp dateformat }); }); From 572a64bdbf67021cf4e12105cbf9ba9e509cf455 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 10 Oct 2017 10:19:04 +0200 Subject: [PATCH 1038/1137] display mobile picto runs with #6617 --- htdocs/core/lib/functions.lib.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1d173d103fb..cbad1ab7e62 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2194,9 +2194,21 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")); } $rep=''; + $picto = ''; + if($withpicto){ + if($withpicto=='fax'){ + $picto = 'phoning_fax'; + }elseif($withpicto=='phone'){ + $picto = 'phoning'; + }elseif($withpicto=='mobile'){ + $picto = 'phoning_mobile'; + }else{ + $picto = ''; + } + } if ($adddivfloat) $rep.='
        '; else $rep.=''; - $rep.=($withpicto?img_picto($titlealt, 'object_'.($withpicto=='fax'?'phoning_fax':'phoning').'.png').' ':'').$newphone; + $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone; if ($adddivfloat) $rep.='
        '; else $rep.=''; return $rep; @@ -6776,4 +6788,4 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield=' if ($id > 0) return $id; return ''; } -} \ No newline at end of file +} From ce6d6dcfbc7bc31604ad5c52717fc5e81fcd5d96 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 10:37:57 +0200 Subject: [PATCH 1039/1137] NEW add image object_phoning_mobile.png --- htdocs/theme/eldy/img/object_phoning_mobile.png | Bin 0 -> 435 bytes htdocs/theme/md/img/object_phoning_mobile.png | Bin 0 -> 435 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 htdocs/theme/eldy/img/object_phoning_mobile.png create mode 100644 htdocs/theme/md/img/object_phoning_mobile.png diff --git a/htdocs/theme/eldy/img/object_phoning_mobile.png b/htdocs/theme/eldy/img/object_phoning_mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..c94fd72ae14fdf3d710071304d1bcdf8e8e51c36 GIT binary patch literal 435 zcmV;k0ZjghP)DJU3+O^@f!8|0tDT3y z=U_0P+wJ1QZntB(TmrlRU(NfED2j9oVHgT{Kan140;bpNIXl&a%bp)5;`F;23zmi2mlQ9R}H{F{+FEdWGOM3N-5S}jJS5tGRTfFwzXOPDg-(AdoTUwuSL{OrGZ$ zW0=q9WLXA4p65)b)3dJiDOfoEbX8SIV!z*WI2-_|stRlEsrK7tVaVU7@az(R<2sjD dh$W46{sB@}vq%b)znTC5002ovPDHLkV1ig?w`c$W literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/object_phoning_mobile.png b/htdocs/theme/md/img/object_phoning_mobile.png new file mode 100644 index 0000000000000000000000000000000000000000..c94fd72ae14fdf3d710071304d1bcdf8e8e51c36 GIT binary patch literal 435 zcmV;k0ZjghP)DJU3+O^@f!8|0tDT3y z=U_0P+wJ1QZntB(TmrlRU(NfED2j9oVHgT{Kan140;bpNIXl&a%bp)5;`F;23zmi2mlQ9R}H{F{+FEdWGOM3N-5S}jJS5tGRTfFwzXOPDg-(AdoTUwuSL{OrGZ$ zW0=q9WLXA4p65)b)3dJiDOfoEbX8SIV!z*WI2-_|stRlEsrK7tVaVU7@az(R<2sjD dh$W46{sB@}vq%b)znTC5002ovPDHLkV1ig?w`c$W literal 0 HcmV?d00001 From 0abc16b27fc926a0dfb60ed59bb13742445fd96d Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 10 Oct 2017 14:55:42 +0200 Subject: [PATCH 1040/1137] Add class Add oddeven class to tr tag --- htdocs/admin/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 06f7af5b8d6..ce5d4ec55eb 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -623,7 +623,7 @@ if ($mode == 'common') $imginfo="info_black"; } - print '
        '."\n"; + print ''."\n"; // Picto + Name of module print ' '; From 6d5c2bf7b2fe29383d76107d0d19f3c32f7df818 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 07:56:10 +0200 Subject: [PATCH 1043/1137] Fix: check if module bank activated Conflicts: htdocs/adherents/subscription.php --- htdocs/adherents/class/subscription.class.php | 9 ++--- htdocs/adherents/subscription.php | 30 +++++++------- htdocs/adherents/subscription/card.php | 33 ++++++++-------- htdocs/adherents/subscription/list.php | 39 ++++++++++--------- 4 files changed, 59 insertions(+), 52 deletions(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 733524e53c0..bdb43dd41d3 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -33,7 +33,7 @@ class Subscription extends CommonObject public $element='subscription'; public $table_element='subscription'; public $picto='payment'; - + var $datec; // Date creation var $datem; // Date modification var $dateh; // Subscription start date (date subscription) @@ -193,12 +193,11 @@ class Subscription extends CommonObject */ function delete($user) { - $accountline=new AccountLine($this->db); - // It subscription is linked to a bank transaction, we get it if ($this->fk_bank > 0) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $accountline=new AccountLine($this->db); $result=$accountline->fetch($this->fk_bank); } @@ -288,7 +287,7 @@ class Subscription extends CommonObject { return ''; } - + /** * Renvoi le libelle d'un statut donne * @@ -301,7 +300,7 @@ class Subscription extends CommonObject $langs->load("members"); return ''; } - + /** * Load information of the subscription object * diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 7c0a0cfe407..2bdbe821105 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1,8 +1,8 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012-2017 Regis Houssin * Copyright (C) 2015-2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -32,7 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // TODO a lot of dependency on the bank module, but no test if this module is not activated! +if (! empty($conf->banque->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +} +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } @@ -823,7 +826,6 @@ if ($rowid > 0) if ($result) { $subscriptionstatic=new Subscription($db); - $accountstatic=new Account($db); $num = $db->num_rows($result); $i = 0; @@ -853,15 +855,17 @@ if ($rowid > 0) print '\n"; print '\n"; print ''; - if (! empty($conf->banque->enabled)) - { - print ''; - } + print ''; + } } print '
        '; - $thirdpartystatic->id=$lines[$i]->socid; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project', 10); - print ''; + $thirdpartystatic->id=$lines[$i]->socid; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + print $thirdpartystatic->getNomUrl(1, 'project', 10); + print ''; @@ -897,15 +894,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); print "'; - $thirdpartystatic->id=$lines[$i]->thirdparty_id; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project'); - print ''; + $thirdpartystatic->id=$lines[$i]->thirdparty_id; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + print $thirdpartystatic->getNomUrl(1, 'project'); + print ''; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 4947e71f8c8..ba703f6128c 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -444,7 +444,7 @@ print ''; print ''; -if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) print ''; +print ''; print ''; print ''; print ''; @@ -463,10 +463,7 @@ print "\n"; print ''; print ''; -if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) -{ - print ''; -} +print ''; print ''; print ''; print ''; @@ -498,8 +495,7 @@ if (count($tasksarray) > 0) $j=0; projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse, $isavailable); - $colspan = 8; - if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++; + $colspan = 9; print ''; + print ''; } print "
        '.$langs->trans("ProjectRef").''.$langs->trans("ThirdParty").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("PlannedWorkload").'
        '; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 873ebfdb442..a12d53cf60a 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -440,7 +440,7 @@ print ''; print ''; -if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ''; +print ''; print ''; print ''; print ''; @@ -460,10 +460,7 @@ print "\n"; print ''; print ''; -if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) -{ - print ''; -} +print ''; print ''; print ''; print ''; @@ -511,8 +508,7 @@ if (count($tasksarray) > 0) $level=0; projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable); - $colspan=7; - if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++; + $colspan=8; print ''; + print ''; } print "
        '.$langs->trans("ProjectRef").''.$langs->trans("ThirdParty").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("PlannedWorkload").'
        '; From dce71d6e7db2fe3b06783d27e2668e332e0274f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 18:51:33 +0200 Subject: [PATCH 1026/1137] Fix loose filter --- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/perweek.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 64ced5f3a5a..b767c35e329 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -493,7 +493,7 @@ if (count($tasksarray) > 0) } else { - print '
        '.$langs->trans("NoTasks").'
        '.$langs->trans("NoTasks").'
        "; print ''; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index f7a1397f475..438d71cbdba 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -283,8 +283,17 @@ if ($action == 'addtime' && $user->rights->projet->lire) { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $param=''; + $param.=($mode?'&mode='.$mode:''); + $param.=($projectid?'id='.$projectid:'').($search_usertoprocessid?'&search_usertoprocessid='.$search_usertoprocessid:'').($day?'&day='.$day:'').($month?'&month='.$month:'').($year?'&year='.$year:''); + $param.=($search_project_ref?'&search_project_ref='.$search_project_ref:''); + $param.=($search_usertoprocessid > 0?'&search_usertoprocessid='.$search_usertoprocessid:''); + $param.=($search_thirdparty?'&search_thirdparty='.$search_thirdparty:''); + $param.=($search_task_ref?'&search_task_ref='.$search_task_ref:''); + $param.=($search_task_label?'&search_task_label='.$search_task_label:''); + // Redirect to avoid submit twice on back - header('Location: '.$_SERVER["PHP_SELF"].'?'.($projectid?'id='.$projectid:'').($search_usertoprocessid?'&search_usertoprocessid='.$search_usertoprocessid:'').($mode?'&mode='.$mode:'').($day?'&day='.$day:'').($month?'&month='.$month:'').($year?'&year='.$year:'')); + header('Location: '.$_SERVER["PHP_SELF"].'?'.$param); exit; } } @@ -511,7 +520,7 @@ if (count($tasksarray) > 0) } else { - print '
        '.$langs->trans("NoTasks").'
        '.$langs->trans("NoTasks").'
        "; print ''; From 666e62b440116f5de1df05bae6cf11ea88ce72be Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Mon, 9 Oct 2017 17:54:15 +0100 Subject: [PATCH 1027/1137] Fixed issue with inexistent constant in commande STATUS_ACCEPTED --- htdocs/commande/card.php | 4 ++-- htdocs/commande/list.php | 2 +- htdocs/commande/stats/index.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8d500f55e69..312ccebfb69 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2479,7 +2479,7 @@ if ($action == 'create' && $user->rights->commande->creer) } // Create contract - if ($conf->contrat->enabled && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_ACCEPTED || $object->statut == Commande::STATUS_CLOSED)) { + if ($conf->contrat->enabled && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); if ($user->rights->contrat->creer) { @@ -2512,7 +2512,7 @@ if ($action == 'create' && $user->rights->commande->creer) } // Set to shipped - if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_ACCEPTED) && $user->rights->commande->cloturer) { + if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $user->rights->commande->cloturer) { print ''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c5cc5f9b715..72f2ac61213 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -917,7 +917,7 @@ if ($resql) $liststatus=array( Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"), Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), - Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"), + Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"), Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"), Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 6a8b57e3707..b1baf7332a1 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -280,7 +280,7 @@ if ($mode == 'customer') $liststatus=array( Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraft"), Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), - Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSent"), + Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSent"), Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled") ); From dd69f762129222c4c95e493eeb4fc0e5b7efebda Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 19:21:25 +0200 Subject: [PATCH 1028/1137] Move translation key --- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/products.lang | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 7383cdea931..91d642bef7e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -27,6 +27,7 @@ DatabaseConnection=Database connection NoTemplateDefined=No template available for this email type AvailableVariables=Available substitution variables NoTranslation=No translation +Translation=Translation NoRecordFound=No record found NoRecordDeleted=No record deleted NotEnoughDataYet=Not enough data diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index b324154e9d0..55138235335 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -100,7 +100,6 @@ ParentProductsNumber=Number of parent packaging product ParentProducts=Parent products IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product -Translation=Translation KeywordFilter=Keyword filter CategoryFilter=Category filter ProductToAddSearch=Search product to add From 3b6f6c40274fa51fb85cad0920d6197d294792de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 19:51:42 +0200 Subject: [PATCH 1029/1137] Translation --- htdocs/langs/en_US/admin.lang | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cb0cb9fcdaa..a47f6d9735d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1753,7 +1753,11 @@ TypeCdr=Use "None" if the date of payment term is date of invoice plus a delta i BaseCurrency=Reference currency of the company (go into setup of company to change this) WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016). WarningNoteModulePOSForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016) because module Non Reversible Logs is automatically activated. -WarningInstallationMayBecomeNotCompliantWithLaw=You try to install the module %s that is an external module. Activating an external module means you trust the publisher of the module and you are sure that this module does not alterate negatively the behavior of your application and is compliant with laws of your country (%s). If the module bring a non legal feature, you become responsible for the use of a non legal software. +WarningInstallationMayBecomeNotCompliantWithLaw=You try to install the module %s that is an external module. Activating an external module means you trust the publisher of the module and you are sure that this module does not alterate negatively the behavior of your application and is compliant with laws of your country (%s). If the module bring a non legal feature, you become responsible for the use of a non legal software. +MAIN_PDF_MARGIN_LEFT=Left margin on PDF +MAIN_PDF_MARGIN_RIGHT=Right margin on PDF +MAIN_PDF_MARGIN_TOP=Top margin on PDF +MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). From 0b7aa204643fc9cd59475f7720a7c965efcb4f54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Oct 2017 22:52:26 +0200 Subject: [PATCH 1030/1137] Add link to ChangeLog --- htdocs/admin/system/dolibarr.php | 12 +++++++----- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 36260c0a228..5daaca5e29e 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -54,7 +54,7 @@ if ($action == 'getlastversion') $sfurl = simplexml_load_string($result['content']); } - + /* * View */ @@ -107,19 +107,21 @@ if (function_exists('curl_init')) } // Show version - print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
        '; + print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .''; } else { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
        '; + print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").''; } } else { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").'
        '; + print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").''; } } +print '     -     '; +print ''.$langs->trans("SeeChangeLog").''; print '
        '.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
        '.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
        '; From d404d8be9f8675ad769635b17771685c88e065e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Oct 2017 18:54:30 +0200 Subject: [PATCH 1041/1137] Debug to make MAIN_ODT_AS_PDF workign with unoconv --- htdocs/includes/odtphp/odf.php | 89 ++++++++++++++++++++++++---------- scripts/odt2pdf/odt2pdf.sh | 31 ++++++++++-- 2 files changed, 89 insertions(+), 31 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 01633634705..19fd3390937 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -36,14 +36,14 @@ class Odf protected $images = array(); protected $vars = array(); protected $segments = array(); - + public $creator; public $title; public $subject; public $userdefined=array(); - + const PIXEL_TO_CM = 0.026458333; - + /** * Class constructor * @@ -113,7 +113,7 @@ class Odf copy($filename, $this->tmpfile); - // Now file has been loaded, we must move the [!-- BEGIN and [!-- END tags outside the + // Now file has been loaded, we must move the [!-- BEGIN and [!-- END tags outside the // _moveRowSegments(); } @@ -124,7 +124,7 @@ class Odf * @param string $key Name of the variable within the template * @param string $value Replacement value * @param bool $encode If true, special XML characters are encoded - * @param string $charset Charset + * @param string $charset Charset * @throws OdfException * @return odf */ @@ -211,7 +211,7 @@ class Odf { preg_match_all('/[\{\<]\?(php)?\s+(?P.+)\?[\}\>]/iU',$this->contentXml, $matches); // detecting all {?php code ?} or $nbfound=count($matches['content']); - for ($i=0; $i < $nbfound; $i++) + for ($i=0; $i < $nbfound; $i++) { try { $ob_output = ''; // flush the output for each code. This var will be filled in by the eval($code) and output buffering : any print or echo or output will be redirected into this variable @@ -268,7 +268,7 @@ IMG; $this->contentXml = preg_replace('/\[!--\sBEGIN]>(row.[\S]*)\s--\]/sm', '[!-- BEGIN \\1 --]', $this->contentXml); // Replace ENDxxx into END xxx $this->contentXml = preg_replace('/\[!--\sEND]>(row.[\S]*)\s--\]/sm', '[!-- END \\1 --]', $this->contentXml); - + // Search all possible rows in the document $reg1 = "#]*>(.*)#smU"; preg_match_all($reg1, $this->contentXml, $matches); @@ -302,7 +302,7 @@ IMG; // Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER); - + //var_dump($this->vars);exit; foreach($matches as $match) // For each match, if there is no entry into this->vars, we add it { @@ -312,7 +312,7 @@ IMG; } } //var_dump($this->vars);exit; - + // Conditionals substitution // Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore foreach($this->vars as $key => $value) @@ -358,7 +358,7 @@ IMG; if ($type == 'content') $this->contentXml = str_replace(array_keys($this->vars), array_values($this->vars), $this->contentXml); if ($type == 'styles') $this->stylesXml = str_replace(array_keys($this->vars), array_values($this->vars), $this->stylesXml); if ($type == 'meta') $this->metaXml = str_replace(array_keys($this->vars), array_values($this->vars), $this->metaXml); - + } /** @@ -467,7 +467,7 @@ IMG; $this->setMetaData(); //print $this->metaXml;exit; - + if (! $this->file->addFromString('content.xml', $this->contentXml)) { throw new OdfException('Error during file export addFromString content'); } @@ -477,7 +477,7 @@ IMG; if (! $this->file->addFromString('styles.xml', $this->stylesXml)) { throw new OdfException('Error during file export addFromString styles'); } - + foreach ($this->images as $imageKey => $imageValue) { // Add the image inside the ODT document $this->file->addFile($imageKey, 'Pictures/' . $imageValue); @@ -499,12 +499,12 @@ IMG; public function setMetaData() { if (empty($this->creator)) $this->creator=''; - + $this->metaXml = preg_replace('/.*<\/dc:date>/', ''.gmdate("Y-m-d\TH:i:s").'', $this->metaXml); $this->metaXml = preg_replace('/.*<\/dc:creator>/', ''.htmlspecialchars($this->creator).'', $this->metaXml); $this->metaXml = preg_replace('/.*<\/dc:title>/', ''.htmlspecialchars($this->title).'', $this->metaXml); $this->metaXml = preg_replace('/.*<\/dc:subject>/', ''.htmlspecialchars($this->subject).'', $this->metaXml); - + if (count($this->userdefined)) { foreach($this->userdefined as $key => $val) @@ -515,7 +515,7 @@ IMG; } } } - + /** * Update Manifest file according to added image files * @@ -569,24 +569,58 @@ IMG; { global $conf; - if( $name == "" ) $name = md5(uniqid()); + if( $name == "" ) $name = "temp".md5(uniqid()); dol_syslog(get_class($this).'::exportAsAttachedPDF $name='.$name, LOG_DEBUG); $this->saveToDisk($name); $execmethod=(empty($conf->global->MAIN_EXEC_USE_POPEN)?1:2); // 1 or 2 + // Method 1 sometimes hang the server. - $name=preg_replace('/\.odt/i', '', $name); - if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) + if (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF)) { - $command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF); + // If issue with unoconv, see https://github.com/dagwieers/unoconv/issues/87 + + // MAIN_ODT_AS_PDF should be "sudo -u unoconv /usr/bin/unoconv" and userunoconv must have sudo to be root by adding file /etc/sudoers.d/unoconv with content www-data ALL=(unoconv) NOPASSWD: /usr/bin/unoconv . + + // Try this with www-data user: /usr/bin/unoconv -vvvv -f pdf /tmp/document-example.odt + // It must return: + //Verbosity set to level 4 + //Using office base path: /usr/lib/libreoffice + //Using office binary path: /usr/lib/libreoffice/program + //DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext + //DEBUG: Existing listener not found. + //DEBUG: Launching our own listener using /usr/lib/libreoffice/program/soffice.bin. + //LibreOffice listener successfully started. (pid=9287) + //Input file: /tmp/document-example.odt + //unoconv: file `/tmp/document-example.odt' does not exist. + //unoconv: RuntimeException during import phase: + //Office probably died. Unsupported URL : "type detection failed" + //DEBUG: Terminating LibreOffice instance. + //DEBUG: Waiting for LibreOffice instance to exit + + // It fails: + // - set shel of user to bash instead of nologin. + // - set permission to read/write to user on home directory /var/www so user can create the libreoffice , dconf and .cache dir and files then set permission back + + $command = $conf->global->MAIN_ODT_AS_PDF.' '.escapeshellcmd($name); + //$command = '/usr/bin/unoconv -vvv '.escapeshellcmd($name); } else { - dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING); - $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF); - } + // deprecated old method + $name=preg_replace('/\.odt/i', '', $name); + if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) + { + $command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF); + } + else + { + dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING); + $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF); + } + } //$dirname=dirname($name); //$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name.' '.$dirname; @@ -598,16 +632,19 @@ IMG; } if ($execmethod == 2) { + $outputfile = DOL_DATA_ROOT.'/odt2pdf.log'; + $ok=0; $handle = fopen($outputfile, 'w'); if ($handle) { dol_syslog(get_class($this)."Run command ".$command,LOG_DEBUG); + fwrite($handle, $command."\n"); $handlein = popen($command, 'r'); while (!feof($handlein)) { $read = fgets($handlein); - fwrite($handle,$read); + fwrite($handle, $read); $output_arr[]=$read; } pclose($handlein); @@ -616,7 +653,7 @@ IMG; if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } - if($retval == 0) + if ($retval == 0) { dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); if (headers_sent($filename, $linenum)) { @@ -686,7 +723,7 @@ IMG; /** * Empty the temporary working directory recursively - * + * * @param string $dir The temporary working directory * @return void */ @@ -709,7 +746,7 @@ IMG; /** * return the value present on odt in [valuename][/valuename] - * + * * @param string $valuename Balise in the template * @return string The value inside the balise */ diff --git a/scripts/odt2pdf/odt2pdf.sh b/scripts/odt2pdf/odt2pdf.sh index 4cf1ab54013..2a3550de29b 100755 --- a/scripts/odt2pdf/odt2pdf.sh +++ b/scripts/odt2pdf/odt2pdf.sh @@ -3,20 +3,26 @@ # @copyright GPL License 2013 - Florian HEnry - florian.henry@open-concept.pro # @copyright GPL License 2017 - Laurent Destailleur - eldy@users.sourceforge.net # -# Convert an ODT into a PDF using "jodconverter" or "pyodconverter" tool. -# Dolibarr variable MAIN_ODT_AS_PDF must be defined to value "jodconverter" to call jodconverter wrapper after ODT generation +# Convert an ODT into a PDF using "jodconverter" or "pyodconverter" or "unoconv" tool. +# Dolibarr variable MAIN_ODT_AS_PDF must be defined +# to value "unoconv" to call unoconv CLI tool after ODT generation. # or value "pyodconverter" to call DocumentConverter.py after ODT generation. +# or value "jodconverter" to call jodconverter wrapper after ODT generation # or value "/pathto/jodconverter-cli-file.jar" to call jodconverter java tool without wrapper after ODT generation. # Dolibarr variable MAIN_DOL_SCRIPTS_ROOT must be defined to path of script directories (otherwise dolibarr will try to guess). if [ "x$1" == "x" ] then - echo "Usage: odt2pdf.sh fullfilename [jodconverter|pyodconverter|pathtojodconverterjar]" + echo "Usage: odt2pdf.sh fullfilename [unoconv|jodconverter|pyodconverter|pathtojodconverterjar]" + echo "Example: odt2pdf.sh myfile unoconv" echo "Example: odt2pdf.sh myfile ~/jodconverter/jodconverter-cli-2.2.2.jar" exit fi + + + # Full patch where soffice is installed soffice="/usr/bin/soffice" @@ -26,7 +32,21 @@ home_java="/tmp" # Main program if [ -f "$1.odt" ] - then +then + + if [ "x$2" == "xunoconv" ] + then + # See issue https://github.com/dagwieers/unoconv/issues/87 + /usr/bin/unoconv -vvv "$1.odt" + retcode=$? + if [ $retcode -ne 0 ] + then + echo "Error while converting odt to pdf: $retcode" + exit 1 + fi + exit 0 + fi + nbprocess=$(pgrep -c soffice) if [ $nbprocess -ne 1 ] # If there is some soffice process running then @@ -59,8 +79,9 @@ if [ -f "$1.odt" ] echo "Error while converting odt to pdf: $retcode" exit 1 fi + sleep 1 - else +else echo "Error: Odt file $1.odt does not exist" exit 1 fi From 913a5d1df2104a18e2c9d45fe034c49a49687cfe Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 07:37:39 +0200 Subject: [PATCH 1042/1137] Fix: if module is not activated, functionality of module is deactivated! --- htdocs/adherents/subscription.php | 43 ++++++++++++++++++------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 8002b33b1f6..7c0a0cfe407 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -31,10 +31,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // TODO a lot of dependency on the bank module, but no test if this module is not activated! +if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +} +if (! empty($conf->accounting->enabled)) { + require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +} $langs->load("companies"); $langs->load("bills"); @@ -859,10 +863,13 @@ if ($rowid > 0) $accountstatic->number=$objp->number; $accountstatic->account_number=$objp->account_number; - $accountingjournal = new AccountingJournal($db); - $accountingjournal->fetch($objp->fk_accountancy_journal); + if (! empty($conf->accounting->enabled)) + { + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($objp->fk_accountancy_journal); - $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); + } $accountstatic->ref=$objp->ref; print $accountstatic->getNomUrl(1); @@ -1093,12 +1100,12 @@ if ($rowid > 0) print ')'; } if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0); - if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) - { - $prodtmp=new Product($db); - $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); - print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product - } + if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) + { + $prodtmp=new Product($db); + $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); + print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product + } print '
        '; } // Add invoice with payments @@ -1118,12 +1125,12 @@ if ($rowid > 0) print ')'; } if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0); - if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) - { - $prodtmp=new Product($db); - $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); - print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product - } + if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) + { + $prodtmp=new Product($db); + $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); + print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product + } print '
        '; } print '
        '.dol_print_date($db->jdate($objp->dateh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->subscription).''; - if ($objp->bid) - { - $accountstatic->label=$objp->label; - $accountstatic->id=$objp->baid; - $accountstatic->number=$objp->number; - $accountstatic->account_number=$objp->account_number; + if (! empty($conf->banque->enabled)) + { + print ''; + if ($objp->bid) + { + $accountstatic=new Account($db); + + $accountstatic->label=$objp->label; + $accountstatic->id=$objp->baid; + $accountstatic->number=$objp->number; + $accountstatic->account_number=$objp->account_number; if (! empty($conf->accounting->enabled)) { diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 3faa45d7d84..3c368c05c9a 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -25,7 +25,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (! empty($conf->banque->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +} $langs->load("companies"); $langs->load("bills"); @@ -231,20 +233,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') if (! empty($conf->banque->enabled)) { if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) - { - print '
        '.$langs->trans("BankTransactionLine").''; + { + print '
        '.$langs->trans("BankTransactionLine").''; if ($object->fk_bank) { - $bankline=new AccountLine($db); - $result=$bankline->fetch($object->fk_bank); + $bankline=new AccountLine($db); + $result=$bankline->fetch($object->fk_bank); print $bankline->getNomUrl(1,0,'showall'); } else { print $langs->trans("NoneF"); } - print '
        '; @@ -326,27 +328,26 @@ if ($rowid && $action != 'edit') // Amount print ''.$langs->trans("Label").''.$object->note.''; - // Bank line + // Bank line if (! empty($conf->banque->enabled)) { if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) - { - print ''.$langs->trans("BankTransactionLine").''; + { + print ''.$langs->trans("BankTransactionLine").''; if ($object->fk_bank) { - $bankline=new AccountLine($db); - $result=$bankline->fetch($object->fk_bank); - print $bankline->getNomUrl(1,0,'showall'); + $bankline=new AccountLine($db); + $result=$bankline->fetch($object->fk_bank); + print $bankline->getNomUrl(1,0,'showall'); } else { print $langs->trans("NoneF"); } - print ''; - } + print ''; + } } - print "\n"; print '
        '; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 1fee5ac545c..adbc0ea98b6 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -26,7 +26,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (! empty($conf->banque->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +} $langs->load("members"); @@ -267,7 +269,6 @@ if ($result) // Static objects $subscription=new Subscription($db); $adherent=new Adherent($db); - $accountstatic=new Account($db); $total=0; while ($i < min($num, $limit)) @@ -304,22 +305,24 @@ if ($result) print dol_trunc($obj->note,32); print ''; - // Banque - if (! empty($conf->banque->enabled)) - { - if ($obj->fk_account) - { - $accountstatic->id=$obj->fk_account; - $accountstatic->fetch($obj->fk_account); - //$accountstatic->label=$obj->label; - print ''.$accountstatic->getNomUrl(1).''; - } - else - { - print ""; - print "\n"; - } - } + // Banque + if (! empty($conf->banque->enabled)) + { + $accountstatic=new Account($db); + + if ($obj->fk_account) + { + $accountstatic->id=$obj->fk_account; + $accountstatic->fetch($obj->fk_account); + //$accountstatic->label=$obj->label; + print ''.$accountstatic->getNomUrl(1).''; + } + else + { + print ""; + print "\n"; + } + } // Date start print ''.dol_print_date($db->jdate($obj->dateadh),'day')."\n"; From f2ad2055382105d653fa5ecdb0baecc50d8dd716 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 08:07:09 +0200 Subject: [PATCH 1044/1137] Fix: wrong copy/paste ! --- htdocs/adherents/subscription.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 2bdbe821105..23876545a60 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -35,7 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (! empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } From 7e79c3a79526d59002f309f5ea4e80e004c32bf9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 11 Oct 2017 10:10:27 +0200 Subject: [PATCH 1045/1137] Fix: label not translated if special lang file used --- htdocs/core/class/extrafields.class.php | 2 +- .../core/tpl/admin_extrafields_view.tpl.php | 62 ++++++++++--------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 277ff7a3895..43af66e51e7 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -747,7 +747,7 @@ class ExtraFields $this->attribute_pos[$tab->name]=$tab->pos; $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; $this->attribute_perms[$tab->name]=$tab->perms; - $this->attribute_langfile[$tab->langs]=$tab->langs; + $this->attribute_langfile[$tab->name]=$tab->langs; $this->attribute_list[$tab->name]=$tab->list; $this->attribute_hidden[$tab->name]=$tab->ishidden; $this->attribute_entityid[$tab->name]=$tab->entity; diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 30b4299a21e..04037368fbc 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012-2017 Regis Houssin * * 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 @@ -61,39 +61,43 @@ print "\n"; if (count($extrafields->attribute_type)) { - foreach($extrafields->attribute_type as $key => $value) - { + foreach($extrafields->attribute_type as $key => $value) + { + // Load language if required + if (! empty($extrafields->attribute_langfile[$key])) { + $langs->load($extrafields->attribute_langfile[$key]); + } - print ''; - print "".$extrafields->attribute_pos[$key]."\n"; - print "".$extrafields->attribute_label[$key]."\n"; - print "".$key."\n"; - print "".$type2label[$extrafields->attribute_type[$key]]."\n"; - print ''.$extrafields->attribute_size[$key]."\n"; - print ''.yn($extrafields->attribute_unique[$key])."\n"; - print ''.dol_trunc($extrafields->attribute_computed[$key], 20)."\n"; - print ''.yn($extrafields->attribute_required[$key])."\n"; - print ''.yn($extrafields->attribute_alwayseditable[$key])."\n"; - print ''.$extrafields->attribute_list[$key]."\n"; - if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print ''.yn($extrafields->attribute_hidden[$key])."\n"; // Add hidden option on not working feature. Why hide if user can't see it. - if ($conf->multicompany->enabled) { - print ''.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).''; - } - print ''.img_edit().''; - print "  ".img_delete()."\n"; - print ""; - } + print ''; + print "".$extrafields->attribute_pos[$key]."\n"; + print "".$langs->trans($extrafields->attribute_label[$key])."\n"; + print "".$key."\n"; + print "".$type2label[$extrafields->attribute_type[$key]]."\n"; + print ''.$extrafields->attribute_size[$key]."\n"; + print ''.yn($extrafields->attribute_unique[$key])."\n"; + print ''.dol_trunc($extrafields->attribute_computed[$key], 20)."\n"; + print ''.yn($extrafields->attribute_required[$key])."\n"; + print ''.yn($extrafields->attribute_alwayseditable[$key])."\n"; + print ''.$extrafields->attribute_list[$key]."\n"; + if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print ''.yn($extrafields->attribute_hidden[$key])."\n"; // Add hidden option on not working feature. Why hide if user can't see it. + if (! empty($conf->multicompany->enabled)) { + print ''.($extrafields->attribute_entityid[$key]==0?$langs->trans("All"):$extrafields->attribute_entitylabel[$key]).''; + } + print ''.img_edit().''; + print "  ".img_delete()."\n"; + print ""; + } } else { - $colspan=9; - if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++; + $colspan=9; + if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++; - print ''; - print ''; - print $langs->trans("None"); - print ''; - print ''; + print ''; + print ''; + print $langs->trans("None"); + print ''; + print ''; } print ""; From 1b3f746ce0dd52b5d4820c62af01300d258135e0 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Wed, 11 Oct 2017 11:16:01 +0200 Subject: [PATCH 1046/1137] Fix translation error InvoiceProForma translation is available in bills.lang --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index cdff9317446..2d5a27bb3df 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1566,7 +1566,7 @@ class pdf_crabe extends ModelePDFFactures if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); - if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); + if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProForma"); if ($this->situationinvoice) $title=$outputlangs->transnoentities("InvoiceSituation"); $pdf->MultiCell($w, 3, $title, '', 'R'); From 051d49732deb4a0398f528338b3886ac0f91a0cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:36:24 +0200 Subject: [PATCH 1047/1137] Keep compatiblity of status key --- htdocs/commande/class/commande.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 824d8faeb88..1ad2d876478 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -172,6 +172,8 @@ class Commande extends CommonOrder * Shipment on process */ const STATUS_SHIPMENTONPROCESS = 2; + const STATUS_ACCEPTED = 2; // For backward compatibility. Use key STATUS_SHIPMENTONPROCESS instead. + /** * Closed (Sent, billed or not) */ From f8771c22149e95e0762128f9364a9d805ac77b8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:39:56 +0200 Subject: [PATCH 1048/1137] Update list.php --- htdocs/adherents/subscription/list.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index adbc0ea98b6..2a839106f05 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -269,6 +269,7 @@ if ($result) // Static objects $subscription=new Subscription($db); $adherent=new Adherent($db); + $accountstatic=new Account($db); $total=0; while ($i < min($num, $limit)) @@ -308,9 +309,7 @@ if ($result) // Banque if (! empty($conf->banque->enabled)) { - $accountstatic=new Account($db); - - if ($obj->fk_account) + if ($obj->fk_account > 0) { $accountstatic->id=$obj->fk_account; $accountstatic->fetch($obj->fk_account); From 7e999603fc2b48e504b478a93867282a4fb56bd7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:40:19 +0200 Subject: [PATCH 1049/1137] Update list.php --- htdocs/adherents/subscription/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 2a839106f05..e831a4449ab 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -26,9 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; -if (! empty($conf->banque->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("members"); From d59d7887bb9db0c7d05190342bd94ef2c70e8c65 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:42:39 +0200 Subject: [PATCH 1050/1137] Update subscription.php --- htdocs/adherents/subscription.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index e6caae34d6a..36f8968587a 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -32,13 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->banque->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -} -if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -} -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; $langs->load("companies"); $langs->load("bills"); @@ -841,6 +837,8 @@ if ($rowid > 0) } print "\n"; + $accountstatic=new Account($db); + while ($i < $num) { $objp = $db->fetch_object($result); @@ -857,8 +855,6 @@ if ($rowid > 0) print ''; if ($objp->bid) { - $accountstatic=new Account($db); - $accountstatic->label=$objp->label; $accountstatic->id=$objp->baid; $accountstatic->number=$objp->number; From 5aa3352e58b1a29f8ad33e572a552cbffb4ea74a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:48:38 +0200 Subject: [PATCH 1051/1137] Restore TODO for future feature --- htdocs/core/js/datepicker.js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php index 3de57f0543f..32b7ca43f5e 100644 --- a/htdocs/core/js/datepicker.js.php +++ b/htdocs/core/js/datepicker.js.php @@ -139,7 +139,9 @@ jQuery(function($){ weekHeader: 'trans("Week"); ?>', dateFormat: 'trans("FormatDateShortJQuery"); ?>', firstDay: global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, - isRTL: trans("DIRECTION")=='rtl'?'true':'false'); ?> + isRTL: trans("DIRECTION")=='rtl'?'true':'false'); ?>, + showMonthAfterYear: false, /* TODO add specific to country */ + yearSuffix: '' /* TODO add specific to country */ }; $.datepicker.setDefaults($.datepicker.regional['defaultlang ?>']); }); From 220b37133bb74a37a6d46befc7b994a7f463022a Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 10 Oct 2017 09:43:03 +0200 Subject: [PATCH 1052/1137] Wrong test https://github.com/Dolibarr/dolibarr/issues/7604#issuecomment-335387587 --- htdocs/admin/modulehelp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 143ebc627f8..f60f5922160 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -365,7 +365,7 @@ if ($mode == 'desc') if ($mode == 'feature') { $text.='
        '.$langs->trans("DependsOn").': '; - if (count($objMod->requiredby)) $text.=join(',', $objMod->depends); + if (count($objMod->depends)) $text.=join(',', $objMod->depends); else $text.=$langs->trans("None"); $text.='
        '.$langs->trans("RequiredBy").': '; if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); From 118b3cdf7918da49a92b32003349a819bf78341e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:56:22 +0200 Subject: [PATCH 1053/1137] Update admin_extrafields_view.tpl.php --- htdocs/core/tpl/admin_extrafields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 04037368fbc..4975e00279d 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -70,7 +70,7 @@ if (count($extrafields->attribute_type)) print ''; print "".$extrafields->attribute_pos[$key]."\n"; - print "".$langs->trans($extrafields->attribute_label[$key])."\n"; + print "".$extrafields->attribute_label[$key]."\n"; // We don't translate here, we want admin to know what is the key not translated value print "".$key."\n"; print "".$type2label[$extrafields->attribute_type[$key]]."\n"; print ''.$extrafields->attribute_size[$key]."\n"; From 68ec8ef313580c71fcd0e29b0545f7b8c42367f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 12:05:48 +0200 Subject: [PATCH 1054/1137] Fix lang missing --- htdocs/fourn/commande/card.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 43ce10ba2f6..03a39f2a5e3 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -54,16 +54,7 @@ if (!empty($conf->variants->enabled)) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } -$langs->load('admin'); -$langs->load('orders'); -$langs->load('sendings'); -$langs->load('companies'); -$langs->load('bills'); -$langs->load('propal'); -$langs->load('supplier_proposal'); -$langs->load('deliveries'); -$langs->load('products'); -$langs->load('stocks'); +$langs->loadLangs(array('admin','orders','sendings','companies','bills','propal','supplier_proposal','deliveries','products','stocks','productbatch')); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); $id = GETPOST('id','int'); From 99afa3a3e0fb3dbe9adb038d1d03f1988e665009 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 12:19:44 +0200 Subject: [PATCH 1055/1137] Use a shorter key for column title --- .../core/modules/livraison/doc/pdf_typhon.modules.php | 10 +++++----- htdocs/langs/en_US/sendings.lang | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index eeba25962cb..fcb0bb6b057 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -283,11 +283,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); $nexY = $pdf->GetY(); $height_incoterms=$nexY-$tab_top; - + // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - + $tab_top = $nexY+6; $height_incoterms += 4; } @@ -567,7 +567,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + return 1; // pas d'erreur } else @@ -662,14 +662,14 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqty, $tab_top+1); - $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); + $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities("QtyShippedShort"),'','R'); } // Remain to ship $pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxremainingqty, $tab_top+1); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxremainingqty, 2, $outputlangs->transnoentities("KeepToShip"),'','R'); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxremainingqty, 2, $outputlangs->transnoentities("KeepToShipShort"),'','R'); } } diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index fcd28cc9f56..47012406b74 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -18,11 +18,13 @@ SendingCard=Shipment card NewSending=New shipment CreateShipment=Create shipment QtyShipped=Qty shipped +QtyShippedShort=Qty ship. QtyPreparedOrShipped=Qty prepared or shipped QtyToShip=Qty to ship QtyReceived=Qty received QtyInOtherShipments=Qty in other shipments KeepToShip=Remain to ship +KeepToShipShort=Remain OtherSendingsForSameOrder=Other shipments for this order SendingsAndReceivingForSameOrder=Shipments and receipts for this order SendingsToValidate=Shipments to validate From c9066afa36c5385fa3d19dad055d613253bd107e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 11 Oct 2017 14:22:59 +0200 Subject: [PATCH 1056/1137] NEW add translation column for extrafields list --- htdocs/core/tpl/admin_extrafields_view.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 4975e00279d..95a9ea250a1 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -44,6 +44,7 @@ print ''.$langs->trans("Position"); print ''; print ''; print ''.$langs->trans("Label").''; +print ''.$langs->trans("TranslationString").''; print ''.$langs->trans("AttributeCode").''; print ''.$langs->trans("Type").''; print ''.$langs->trans("Size").''; @@ -71,6 +72,7 @@ if (count($extrafields->attribute_type)) print ''; print "".$extrafields->attribute_pos[$key]."\n"; print "".$extrafields->attribute_label[$key]."\n"; // We don't translate here, we want admin to know what is the key not translated value + print "".$langs->trans($extrafields->attribute_label[$key])."\n"; print "".$key."\n"; print "".$type2label[$extrafields->attribute_type[$key]]."\n"; print ''.$extrafields->attribute_size[$key]."\n"; From cd814d420b956a4d7c1f9ba06fb992054cf39383 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 16:54:17 +0200 Subject: [PATCH 1057/1137] Fix repair utf8 mix collation --- htdocs/install/mysql/migration/repair.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 46f75ff0d7f..68671ecd4d7 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -31,6 +31,10 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_journal MODIFY code VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_bank_account MODIFY accountancy_journal VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; From bcf56e3140f064f32ec64499c6d67d23759b3f5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 19:41:19 +0200 Subject: [PATCH 1058/1137] Introduce table c_email_senderprofile to have several profils --- htdocs/admin/mails.php | 90 ++++++++++++++----- htdocs/core/actions_massactions.inc.php | 9 ++ htdocs/core/actions_sendmails.inc.php | 9 ++ htdocs/core/class/html.formmail.class.php | 27 +++++- .../install/mysql/migration/6.0.0-7.0.0.sql | 17 ++++ htdocs/modulebuilder/index.php | 16 +++- 6 files changed, 143 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index aa859b18a7e..961491cce2e 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -69,20 +69,20 @@ complete_substitutions_array($substitutionarrayfortest, $langs); if ($action == 'update' && empty($_POST["cancel"])) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity); // Send mode parameters - dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"),'chaine',0,'',$conf->entity); // Content parameters - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE',GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'),'chaine',0,'',$conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -427,13 +427,30 @@ if ($action == 'edit') print '">'; // Default from type - - $liste = array(); - $liste['user'] = $langs->trans('UserEmail'); - $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')'; + $liste = array(); + $liste['user'] = $langs->trans('UserEmail'); + $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')'; + /* + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1'; + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i=0; + while($i < $num) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + $liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; + } + $i++; + } + } + else dol_print_error($db);*/ print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; - print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE',$liste,$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE,0); + print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0); print ''; // Separator @@ -569,13 +586,46 @@ else print ''; // Default from type + $liste = array(); + $liste['user'] = $langs->trans('UserEmail'); + $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')'; + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1'; + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i=0; + while($i < $num) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + $liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; + } + $i++; + } + } + else dol_print_error($db); print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user'){ + if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') + { print $langs->trans('UserEmail'); - } else { - print $langs->trans('CompanyEmail'); + } + else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') + { + print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); + } + else { + $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); + if ($id > 0) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + } } print ''; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 67fde5dbd48..76534211481 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -306,6 +306,15 @@ if (! $error && $massaction == 'confirm_presend') $tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); $from = trim($tmp[($reg[1] - 1)]); } + elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1]; + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + if ($obj) + { + $from = $obj->label.' <'.$obj->email.'>'; + } + } else { $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; } diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 7b1db834d22..57b6ae80b6c 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -258,6 +258,15 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); $from = trim($tmp[($reg[1] - 1)]); } + elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1]; + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + if ($obj) + { + $from = $obj->label.' <'.$obj->email.'>'; + } + } else { $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 788fa723cdb..77f3d30c93b 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -444,6 +444,8 @@ class FormMail extends Form } } else { $liste = array(); + + // Add user email if (empty($user->email)) { $langs->load('errors'); @@ -453,9 +455,32 @@ class FormMail extends Form { $liste['user'] = $user->getFullName($langs) .' <'.$user->email.'>'; } + + // Add also company main email $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; - // Add also email aliases if there is one + + // Add also email aliases if there is some $listaliases=array('user_aliases'=>$user->email_aliases, 'global_aliases'=>$conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); + + // Add also email aliases from the c_email_senderprofile table + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1 ORDER BY position'; + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while($i < $num) + { + $obj = $this->db->fetch_object($resql); + if ($obj) + { + $listaliases['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; + } + $i++; + } + } + else dol_print_error($db); + foreach($listaliases as $typealias => $listalias) { $posalias=0; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 3ecf4b405c8..b5e274c9d90 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -364,3 +364,20 @@ ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(id, entity, code); ALTER TABLE llx_c_payment_term DROP PRIMARY KEY; ALTER TABLE llx_c_payment_term ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(rowid, entity, code); + + +create table llx_c_email_senderprofile +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + private smallint DEFAULT 0 NOT NULL, -- Template public or private + date_creation datetime, + tms timestamp, + label varchar(255), -- Label of predefined email + email varchar(255), -- Email + signature text -- Predefined signature + position smallint, -- Position + active tinyint DEFAULT 1 NOT NULL, +)ENGINE=innodb; + +ALTER TABLE llx_c_email_senderprofile ADD UNIQUE INDEX uk_c_email_senderprofile(entity, label, email); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index efd0404ee72..40a69851a0e 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -86,7 +86,7 @@ if (empty($newmask)) // This should no happen if ($dirins && $action == 'initmodule' && $modulename) { - if (preg_match('/\s/', $modulename)) + if (preg_match('/[^a-z0-9_]/i', $modulename)) { $error++; setEventMessages($langs->trans("SpaceOrSpecialCharAreNotAllowed"), null, 'errors'); @@ -174,7 +174,7 @@ if ($dirins && $action == 'initmodule' && $modulename) if ($dirins && $action == 'initobject' && $module && $objectname) { - if (preg_match('/\s/', $objectname)) + if (preg_match('/[^a-z0-9_]/i', $objectname)) { $error++; setEventMessages($langs->trans("SpaceOrSpecialCharAreNotAllowed"), null, 'errors'); @@ -183,6 +183,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) $srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; $destdir = $dirins.'/'.strtolower($module); + // The dir was not created by init + dol_mkdir($destdir.'/class'); + dol_mkdir($destdir.'/img'); + dol_mkdir($destdir.'/lib'); + dol_mkdir($destdir.'/scripts'); + dol_mkdir($destdir.'/sql'); + dol_mkdir($destdir.'/test/phpunit'); + // Scan dir class to find if an object with same name already exists. if (! $error) { @@ -443,7 +451,7 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) if ($dirins && $action == 'confirm_delete') { - if (preg_match('/\s/', $module)) + if (preg_match('/[^a-z0-9_]/i', $module)) { $error++; setEventMessages($langs->trans("SpaceOrSpecialCharAreNotAllowed"), null, 'errors'); @@ -476,7 +484,7 @@ if ($dirins && $action == 'confirm_delete') if ($dirins && $action == 'confirm_deleteobject' && $objectname) { - if (preg_match('/[^a-z0-9]/i', $objectname)) + if (preg_match('/[^a-z0-9_]/i', $objectname)) { $error++; setEventMessages($langs->trans("SpaceOrSpecialCharAreNotAllowed"), null, 'errors'); From 56be9e2b60b8d2816813ed7a924783e9607d9d4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 19:41:45 +0200 Subject: [PATCH 1059/1137] Introduce table c_email_senderprofile to have several profils --- htdocs/admin/emailsenderprofile_card.php | 622 ++++++++++++++++ htdocs/admin/emailsenderprofile_list.php | 661 ++++++++++++++++++ .../core/class/emailsenderprofile.class.php | 445 ++++++++++++ .../tables/llx_c_email_senderprofile.key.sql | 21 + .../tables/llx_c_email_senderprofile.sql | 32 + 5 files changed, 1781 insertions(+) create mode 100644 htdocs/admin/emailsenderprofile_card.php create mode 100644 htdocs/admin/emailsenderprofile_list.php create mode 100644 htdocs/core/class/emailsenderprofile.class.php create mode 100644 htdocs/install/mysql/tables/llx_c_email_senderprofile.key.sql create mode 100644 htdocs/install/mysql/tables/llx_c_email_senderprofile.sql diff --git a/htdocs/admin/emailsenderprofile_card.php b/htdocs/admin/emailsenderprofile_card.php new file mode 100644 index 00000000000..547f810fa15 --- /dev/null +++ b/htdocs/admin/emailsenderprofile_card.php @@ -0,0 +1,622 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * 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 3 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, see . + */ + +/** + * \file emailsenderprofile_card.php + * \ingroup monmodule + * \brief Page to create/edit/view emailsenderprofile + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on. +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); +// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"); +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php"); +if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); +if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php"); +if (! $res) die("Include of main fails"); + +include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); +include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); +dol_include_once('/monmodule/class/emailsenderprofile.class.php'); +dol_include_once('/monmodule/lib/emailsenderprofile.lib.php'); + +// Load traductions files requiredby by page +$langs->loadLangs(array("monmodule@monmodule","other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object=new EmailSenderProfile($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->monmodule->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('emailsenderprofilecard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// Initialize array of search criterias +$search_all=trim(GETPOST("search_all",'alpha')); +$search=array(); +foreach($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); +} + +if (empty($action) && empty($id) && empty($ref)) $action='view'; + +// Security check - Protection if external user +//if ($user->societe_id > 0) access_forbidden(); +//if ($user->societe_id > 0) $socid = $user->societe_id; +//$result = restrictedArea($user, 'monmodule', $id); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + + + +/* + * ACTIONS + * + * Put here all code to do according to value of "action" parameter + */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + $error=0; + + if ($cancel) + { + if (! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + $action=''; + } + + // Action to add record + if ($action == 'add' && ! empty($user->rights->monmodule->create)) + { + foreach ($object->fields as $key => $val) + { + if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields + + $object->$key=GETPOST($key,'alpha'); + if ($val['notnull'] > 0 && $object->$key == '') + { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors'); + } + } + + if (! $error) + { + $result=$object->createCommon($user); + if ($result > 0) + { + // Creation OK + $urltogo=$backtopage?$backtopage:dol_buildpath('/monmodule/emailsenderprofile_list.php',1); + header("Location: ".$urltogo); + exit; + } + else + { + // Creation KO + if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); + $action='create'; + } + } + else + { + $action='create'; + } + } + + // Action to update record + if ($action == 'update' && ! empty($user->rights->monmodule->create)) + { + foreach ($object->fields as $key => $val) + { + if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields + + $object->$key=GETPOST($key,'alpha'); + if ($val['notnull'] > 0 && $object->$key == '') + { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors'); + } + } + + if (! $error) + { + $result=$object->updateCommon($user); + if ($result > 0) + { + $action='view'; + } + else + { + // Creation KO + if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); + $action='edit'; + } + } + else + { + $action='edit'; + } + } + + // Action to delete + if ($action == 'confirm_delete' && ! empty($user->rights->monmodule->delete)) + { + $result=$object->deleteCommon($user); + if ($result > 0) + { + // Delete OK + setEventMessages("RecordDeleted", null, 'mesgs'); + header("Location: ".dol_buildpath('/monmodule/emailsenderprofile_list.php',1)); + exit; + } + else + { + if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); + } + } + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + // Actions to send emails + $trigger_name='MYOBJECT_SENTBYMAIL'; + $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; + $trackid='emailsenderprofile'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; +} + + + + +/* + * VIEW + * + * Put here all code to build page + */ + +$form=new Form($db); +$formfile=new FormFile($db); + +llxHeader('','EmailSenderProfile',''); + +// Example : Adding jquery code +print ''; + + +// Part to create +if ($action == 'create') +{ + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("EmailSenderProfile"))); + + print '
        '; + print ''; + print ''; + print ''; + + dol_fiche_head(array(), ''); + + print ''."\n"; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; + print ''; + print ''; + print $langs->trans($val['label']); + print ''; + print ''; + print ''; + } + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + + print '
        '; + $defaultcss='minwidth100'; + if ($val['type'] == 'text') + { + print ''; + } + elseif (is_array($val['arrayofkeyval'])) + { + print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')); + } + else + { + $cssforinput = empty($val['css'])?$defaultcss:$val['css']; + print ''; + } + print '
        '."\n"; + + dol_fiche_end(); + + print '
        '; + print ''; + print '  '; + print ''; // Cancel for create doe not post form + print '
        '; + + print '
        '; +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') +{ + print load_fiche_titre($langs->trans("EmailSenderProfile")); + + print '
        '; + print ''; + print ''; + print ''; + + dol_fiche_head(); + + print ''."\n"; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; + + print ''.$langs->trans($val['label']).''; + print ''; + print ''; + } + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + + print '
        '; + $defaultcss='minwidth100'; + if ($val['type'] == 'text') + { + print ''; + } + elseif (is_array($val['arrayofkeyval'])) + { + print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key); + } + else + { + $cssforinput = empty($val['css'])?$defaultcss:$val['css']; + print ''; + } + print '
        '; + + dol_fiche_end(); + + print '
        '; + print '   '; + print '
        '; + + print '
        '; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) +{ + $res = $object->fetch_optionals($object->id, $extralabels); + + $head = emailsenderprofilePrepareHead($object); + dol_fiche_head($head, 'card', $langs->trans("EmailSenderProfile"), -1, 'emailsenderprofile@monmodule'); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteEmailSenderProfile'), $langs->trans('ConfirmDeleteEmailSenderProfile'), 'confirm_delete', '', 0, 1); + } + + // Confirmation of action xxxx + if ($action == 'xxx') + { + $formquestion=array(); + /* + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); + }*/ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + } + + if (! $formconfirm) { + $parameters = array('lineid' => $lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = '' . $langs->trans("BackToList") . ''; + + $morehtmlref='
        '; + /* + // Ref bis + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->monmodule->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->monmodule->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
        '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
        '.$langs->trans('Project') . ' '; + if ($user->rights->monmodule->creer) + { + if ($action != 'classify') + { + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
        '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
        '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + */ + $morehtmlref.='
        '; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
        '; + print '
        '; + print '
        '; + print ''."\n"; + + foreach($object->fields as $key => $val) + { + if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue; + + print ''.$langs->trans($val['label']).''; + print ''; + print ''; + + //if ($key == 'targetsrcfile3') break; // key used for break on second column + } + + print '
        '; + print dol_escape_htmltag($object->$key, 1, 1); + print '
        '; + print '
        '; + print '
        '; + print '
        '; + print '
        '; + print ''; + + $alreadyoutput = 1; + foreach($object->fields as $key => $val) + { + if ($alreadyoutput) + { + //if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column + continue; + } + + if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue; + + print ''.$langs->trans($val['label']).''; + print ''; + print ''; + } + + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
        '; + print dol_escape_htmltag($object->$key, 1, 1); + print '
        '; + print '
        '; + print '
        '; + print '
        '; + + print '

        '; + + dol_fiche_end(); + + + // Buttons for actions + if ($action != 'presend' && $action != 'editline') { + print '
        '."\n"; + $parameters=array(); + $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + if (empty($reshook)) + { + // Send + print ''."\n"; + + if ($user->rights->monmodule->write) + { + print ''."\n"; + } + + /* + if ($user->rights->sellyoursaas->create) + { + if ($object->status == 1) + { + print ''."\n"; + } + else + { + print ''."\n"; + } + } + */ + + if ($user->rights->monmodule->delete) + { + print ''."\n"; + } + } + print '
        '."\n"; + } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') + { + print '
        '; + print ''; // ancre + // Documents + $comref = dol_sanitizeFileName($object->ref); + $relativepath = $comref . '/' . $comref . '.pdf'; + $filedir = $conf->monmodule->dir_output . '/' . $comref; + $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $genallowed = $user->rights->monmodule->creer; + $delallowed = $user->rights->monmodule->supprimer; + print $formfile->showdocuments('monmodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('emailsenderprofile')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
        '; + + $MAXEVENT = 10; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, 'emailsenderprofile', $socid, 1, '', $MAXEVENT); + + print '
        '; + } + + // Presend form + $modelmail='emailsenderprofile'; + $defaulttopic='Information'; + $diroutput = $conf->monmodule->dir_output; + $trackid = 'emailsenderprofile'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; +} + + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/admin/emailsenderprofile_list.php b/htdocs/admin/emailsenderprofile_list.php new file mode 100644 index 00000000000..dd2372443b3 --- /dev/null +++ b/htdocs/admin/emailsenderprofile_list.php @@ -0,0 +1,661 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * 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 3 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, see . + */ + +/** + * \file emailsenderprofile_list.php + * \ingroup monmodule + * \brief List page for emailsenderprofile + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on. +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + + +// Load Dolibarr environment +$res=0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); +// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME +$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; +while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } +if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); +if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"); +// Try main.inc.php using relative path +if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php"); +if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); +if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php"); +if (! $res) die("Include of main fails"); + +require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +dol_include_once('/monmodule/class/emailsenderprofile.class.php'); + +// Load traductions files requiredby by page +$langs->loadLangs(array("monmodule@monmodule","other")); + +$action = GETPOST('action','alpha'); // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'emailsenderprofilelist'; // To manage different context of search +$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') + +$id = GETPOST('id','int'); + +// Load variable for pagination +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); +$page = GETPOST('page','int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Initialize technical objects +$object=new EmailSenderProfile($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction=$conf->monmodule->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. +if (! $sortorder) $sortorder="ASC"; + +// Protection if external user +$socid=0; +if ($user->societe_id > 0) +{ + //$socid = $user->societe_id; + accessforbidden(); +} + +// Initialize array of search criterias +$search_all=trim(GETPOST("search_all",'alpha')); +$search=array(); +foreach($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach($object->fields as $key => $val) +{ + if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; +} + +// Definition of fields for list +$arrayfields=array(); +foreach($object->fields as $key => $val) +{ + // If $val['visible']==0, then we never show the field + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } +} + + + + +/* + * ACTIONS + * + * Put here all code to do according to value of "$action" parameter + */ + +if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + foreach($object->fields as $key => $val) + { + $search[$key]=''; + } + $toselect=''; + $search_array_options=array(); + } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass='EmailSenderProfile'; + $objectlabel='EmailSenderProfile'; + $permtoread = $user->rights->monmodule->read; + $permtodelete = $user->rights->monmodule->delete; + $uploaddir = $conf->monmodule->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + + + +/* + * VIEW + * + * Put here all code to build page + */ + +$form=new Form($db); + +$now=dol_now(); + +//$help_url="EN:Module_EmailSenderProfile|FR:Module_EmailSenderProfile_FR|ES:Módulo_EmailSenderProfile"; +$help_url=''; +$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("EmailSenderProfiles")); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +foreach($object->fields as $key => $val) +{ + $sql.='t.'.$key.', '; +} +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +$sql=preg_replace('/, $/','', $sql); +$sql.= " FROM ".MAIN_DB_PREFIX."emailsenderprofile as t"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."emailsenderprofile_extrafields as ef on (t.rowid = ef.fk_object)"; +$sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")"; +foreach($search as $key => $val) +{ + $mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0); + if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search)); +} +if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all); +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode_search=0; + if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; + +/* If a group by is required +$sql.= " GROUP BY " +foreach($object->fields as $key => $val) +{ + $sql.='t.'.$key.', '; +} +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +*/ + +$sql.=$db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + +$sql.= $db->plimit($limit+1, $offset); + +dol_syslog($script_file, LOG_DEBUG); +$resql=$db->query($sql); +if (! $resql) +{ + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + +// Direct jump if only one record found +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) +{ + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url); + +// Example : Adding jquery code +print ''; + +$arrayofselected=is_array($toselect)?$toselect:array(); + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); +foreach($search as $key => $val) +{ + $param.= '&search_'.$key.'='.urlencode($search[$key]); +} +if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); +// Add $param from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); +} + +// List of mass actions available +$arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), +); +if ($user->rights->monmodule->delete) $arrayofmassactions['delete']=$langs->trans("Delete"); +if ($massaction == 'presend') $arrayofmassactions=array(); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + +print '
        '; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); + +if ($sall) +{ + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); +} + +$moreforfilter = ''; +$moreforfilter.='
        '; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
        '; + +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; +else $moreforfilter = $hookmanager->resPrint; + +if (! empty($moreforfilter)) +{ + print '
        '; + print $moreforfilter; + print '
        '; +} + +$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; +$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
        '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + + +// Fields title search +// -------------------------------------------------------------------- +print ''; +foreach($object->fields as $key => $val) +{ + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print ''; +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } +} +// Fields from hook +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Rest of fields search +foreach($object->fields as $key => $val) +{ + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print ''; +} +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +foreach($object->fields as $key => $val) +{ + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; +} +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; + } + } +} +// Hook fields +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Rest of fields title +foreach($object->fields as $key => $val) +{ + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; +} +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine=0; +foreach ($extrafields->attribute_computed as $key => $val) +{ + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object +} + + +// Loop on record +// -------------------------------------------------------------------- +$i=0; +$totalarray=array(); +while ($i < min($num, $limit)) +{ + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen + + // Store properties in $object + $object->id = $obj->rowid; + foreach($object->fields as $key => $val) + { + if (isset($obj->$key)) $object->$key = $obj->$key; + } + + // Show here line of result + print ''; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; + $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; + } + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Rest of fields + foreach($object->fields as $key => $val) + { + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; + if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; + + print ''; + + $i++; +} + +// Show total line +if (isset($totalarray['pos'])) +{ + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if (! empty($totalarray['pos'][$i])) print ''; + else + { + if ($i == 1) + { + if ($num < $limit) print ''; + else print ''; + } + else print ''; + } + } + print ''; +} + +// If no record found +if ($num == 0) +{ + $colspan=1; + foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } + print ''; +} + + +$db->free($resql); + +$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
        '; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; +$searchpicto=$form->showFilterButtons(); +print $searchpicto; +print '
        '; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
        '.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
        '.$langs->trans("NoRecordFound").'
        '."\n"; +print '
        '."\n"; + +print '
        '."\n"; + +if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) +{ + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) + { + require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&','&',$param); + + $filedir=$diroutputmassaction; + $genallowed=$user->rights->monmodule->read; + $delallowed=$user->rights->monmodule->read; + + print $formfile->showdocuments('massfilesarea_monmodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + } + else + { + print '
        '.$langs->trans("ShowTempMassFilesArea").''; + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php new file mode 100644 index 00000000000..f1e8332d116 --- /dev/null +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -0,0 +1,445 @@ + + * Copyright (C) 2014-2016 Juanjo Menent + * Copyright (C) 2015 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) ---Put here your own copyright and developer email--- + * + * 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 3 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, see . + */ + +/** + * \file class/emailsenderprofile.class.php + * \ingroup monmodule + * \brief This file is a CRUD class file for EmailSenderProfile (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + +/** + * Class for EmailSenderProfile + */ +class EmailSenderProfile extends CommonObject +{ + /** + * @var string ID to identify managed object + */ + public $element = 'emailsenderprofile'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_email_senderprofile'; + + /** + * @var array Does this field is linked to a thirdparty ? + */ + protected $isnolinkedbythird = 1; + /** + * @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + protected $ismultientitymanaged = 1; + /** + * @var string String with name of icon for emailsenderprofile + */ + public $picto = 'emailsenderprofile@monmodule'; + + + /** + * 'type' if the field format. + * 'label' the translation key. + * 'enabled' is a condition when the filed must be managed. + * 'visible' says if field is visible in list (-1 means not shown by default but can be added into list to be viewed). + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'position' is the sort order of field. + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'help' is a string visible as a tooltip on field + * 'comment' is not used. You can store here any text of your choice. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), + 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1), + 'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), + //'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), + //'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,), + 'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>-1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1,), + 'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>-1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1,), + 'active' => array('type'=>'integer', 'label'=>'Active', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1), + ); + public $rowid; + public $entity; + public $label; + public $email; + public $date_creation; + public $tms; + //public $fk_user_creat; + //public $fk_user_modif; + public $signature; + public $position; + public $active; + // END MODULEBUILDER PROPERTIES + + + + // If this object has a subtable with lines + + /** + * @var int Name of subtable line + */ + //public $table_element_line = 'emailsenderprofiledet'; + /** + * @var int Field with ID of parent key if this field has a parent + */ + //public $fk_element = 'fk_emailsenderprofile'; + /** + * @var int Name of subtable class that manage subtable lines + */ + //public $class_element_line = 'EmailSenderProfileline'; + /** + * @var array Array of child tables (child tables to delete before deleting a record) + */ + //protected $childtables=array('emailsenderprofiledet'); + /** + * @var EmailSenderProfileLine[] Array of subtable lines + */ + //public $lines = array(); + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible']=0; + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + return $this->createCommon($user, $notrigger); + } + + /** + * Clone and object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(User $user, $fromid) + { + global $hookmanager, $langs; + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $object->fetchCommon($fromid); + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + + // Clear fields + $object->ref = "copy_of_".$object->ref; + $object->title = $langs->trans("CopyOf")." ".$object->title; + // ... + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + if ($result < 0) { + $error++; + $this->error = $object->error; + $this->errors = $object->errors; + } + + // End + if (!$error) { + $this->db->commit(); + return $object; + } else { + $this->db->rollback(); + return -1; + } + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + $result = $this->fetchCommon($id, $ref); + if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + return $result; + } + + /** + * Load object lines in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines($id, $ref = null) + { + $this->lines=array(); + + // Load lines with object EmailSenderProfileLine + + return count($this->lines)?1:0; + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $trigger); + } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @return string String with URL + */ + function getNomUrl($withpicto=0) + { + global $db, $conf, $langs; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; + + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + + $result = ''; + $companylink = ''; + + $url=''; + //$url = dol_buildpath('/monmodule/emailsenderprofile_card.php',1).'?id='.$this->id; + + $linkstart = ''; + $linkend=''; + + if ($withpicto) + { + $result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend); + if ($withpicto != 2) $result.=' '; + } + $result.= $linkstart . $this->label . $linkend; + return $result; + } + + /** + * Return link to download file from a direct external access + * + * @param int $withpicto Add download picto into link + * @return string HTML link to file + */ + function getDirectExternalLink($withpicto=0) + { + return 'todo'; + } + + /** + * Retourne le libelle du status d'un user (actif, inactif) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->status,$mode); + } + + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + static function LibStatut($status,$mode=0) + { + global $langs; + + if ($mode == 0) + { + $prefix=''; + if ($status == 1) return $langs->trans('Enabled'); + if ($status == 0) return $langs->trans('Disabled'); + } + if ($mode == 1) + { + if ($status == 1) return $langs->trans('Enabled'); + if ($status == 0) return $langs->trans('Disabled'); + } + if ($mode == 2) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 3) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); + } + if ($mode == 4) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); + } + if ($mode == 5) + { + if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + } + if ($mode == 6) + { + if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); + if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); + } + } + + /** + * Charge les informations d'ordre info dans l'objet commande + * + * @param int $id Id of order + * @return void + */ + function info($id) + { + $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; + $sql.= ' fk_user_creat, fk_user_modif'; + $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + $sql.= ' WHERE t.rowid = '.$id; + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_valid) + { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + + if ($obj->fk_user_cloture) + { + $cluser = new User($this->db); + $cluser->fetch($obj->fk_user_cloture); + $this->user_cloture = $cluser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); + } + + $this->db->free($result); + + } + else + { + dol_print_error($this->db); + } + } + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + $this->initAsSpecimenCommon(); + } + +} + +/** + * Class EmailSenderProfileLine. You can also remove this and generate a CRUD class for lines objects. + */ +/* +class EmailSenderProfileLine +{ + // @var int ID + public $id; + // @var mixed Sample line property 1 + public $prop1; + // @var mixed Sample line property 2 + public $prop2; +} +*/ \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_c_email_senderprofile.key.sql b/htdocs/install/mysql/tables/llx_c_email_senderprofile.key.sql new file mode 100644 index 00000000000..a4896ea162c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_email_senderprofile.key.sql @@ -0,0 +1,21 @@ +-- =================================================================== +-- Copyright (C) 2017 Laurent Destailleur +-- +-- 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 3 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, see . +-- +-- Table with templates of emails +-- =================================================================== + +ALTER TABLE llx_c_email_senderprofile ADD UNIQUE INDEX uk_c_email_senderprofile(entity, label, email); + diff --git a/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql b/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql new file mode 100644 index 00000000000..24a050ca45a --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_email_senderprofile.sql @@ -0,0 +1,32 @@ +-- =================================================================== +-- Copyright (C) 2001-2017 Laurent Destailleur +-- +-- 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 3 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, see . +-- +-- Table with templates of emails +-- =================================================================== + +create table llx_c_email_senderprofile +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + private smallint DEFAULT 0 NOT NULL, -- Template public or private + date_creation datetime, + tms timestamp, + label varchar(255), -- Label of predefined email + email varchar(255) NOT NULL, -- Email + signature text -- Predefined signature + position smallint DEFAULT 0, -- Position + active tinyint DEFAULT 1 NOT NULL, +)ENGINE=innodb; From 37272b264c5d2a6b5f90e449c84104fa922751fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 19:45:18 +0200 Subject: [PATCH 1060/1137] Fix sql --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index b5e274c9d90..2380f13a06d 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -375,9 +375,9 @@ create table llx_c_email_senderprofile tms timestamp, label varchar(255), -- Label of predefined email email varchar(255), -- Email - signature text -- Predefined signature + signature text, -- Predefined signature position smallint, -- Position - active tinyint DEFAULT 1 NOT NULL, + active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; ALTER TABLE llx_c_email_senderprofile ADD UNIQUE INDEX uk_c_email_senderprofile(entity, label, email); From 0d0030cff4ee6c92bab3191100d48a4107a0628b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 19:57:53 +0200 Subject: [PATCH 1061/1137] Fix use of sender profiles --- htdocs/core/class/html.formmail.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 77f3d30c93b..3ad460a8688 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -426,7 +426,8 @@ class FormMail extends Form if (! ($this->fromtype === 'user' && $this->fromid > 0) && ! ($this->fromtype === 'company') && ! preg_match('/user_aliases/', $this->fromtype) - && ! preg_match('/global_aliases/', $this->fromtype)) + && ! preg_match('/global_aliases/', $this->fromtype) + && ! preg_match('/senderprofile/', $this->fromtype)) { // Use this->fromname and this->frommail or error if not defined $out.= $this->fromname; From d36af4a46a577c8496212fe7bcdbd210129a305b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 23:06:23 +0200 Subject: [PATCH 1062/1137] RUM number start with RUM- --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index a3d50d58143..99b087e1939 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1503,7 +1503,7 @@ class BonPrelevement extends CommonObject static function buildRumNumber($row_code_client, $row_datec, $row_drum) { global $langs; - $pre = ($row_datec > 1359673200) ? $langs->trans('RUM').'-' : '++R'; + $pre = $langs->trans('RUM').'-'; return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); } From 918738ce464166f8a606b0495a6c8d0efd3032b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 23:06:49 +0200 Subject: [PATCH 1063/1137] Set creation date --- htdocs/societe/rib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 7372229266c..6642cc62aac 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -205,7 +205,8 @@ if (empty($reshook)) $account->owner_address = GETPOST('owner_address','alpha'); $account->frstrecur = GETPOST('frstrecur'); $account->rum = GETPOST('rum','alpha'); - + $account->datec = dol_now(); + // This test can be done only once properties were set if ($account->needIBAN() == 1) { From 8674867db2368cce0d529519d8f3456391ceac8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 23:43:42 +0200 Subject: [PATCH 1064/1137] Fix creation/edit rum number --- .../class/companybankaccount.class.php | 80 +++++++++---------- htdocs/societe/rib.php | 57 +++++++++---- 2 files changed, 77 insertions(+), 60 deletions(-) diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 65c3ca37e0a..4853c54fdd9 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -70,7 +70,7 @@ class CompanyBankAccount extends Account function create(User $user = null, $notrigger=0) { $now = dol_now(); - $error = 0; + $error = 0; // Correct default_rib to be sure to have always one default $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".$this->socid." AND default_rib = 1"; $result = $this->db->query($sql); @@ -89,29 +89,27 @@ class CompanyBankAccount extends Account if ($this->db->affected_rows($resql)) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_rib"); - - if (! $notrigger) - { - // Call trigger - $result=$this->call_trigger('COMPANY_RIB_CREATE',$user); - if ($result < 0) $error++; - // End call triggers - if(! $error ) - { - return 1; - } - else - { - return 0; - } - - } - else - { - return 1; - } - + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('COMPANY_RIB_CREATE',$user); + if ($result < 0) $error++; + // End call triggers + + if (! $error) + { + return 1; + } + else + { + return 0; + } + } + else + { + return 1; + } } } else @@ -132,14 +130,10 @@ class CompanyBankAccount extends Account { global $conf; $error = 0; - - if (! $this->id) - { - $this->create(); - } - - if (dol_strlen($this->domiciliation) > 255) $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1); + if (! $this->id) return -1; + + if (dol_strlen($this->domiciliation) > 255) $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1); if (dol_strlen($this->owner_address) > 255) $this->owner_address = dol_trunc($this->owner_address, 254, 'right', 'UTF-8', 1); $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET"; @@ -169,8 +163,8 @@ class CompanyBankAccount extends Account $result = $this->db->query($sql); if ($result) { - - + + if (! $notrigger) { // Call trigger @@ -190,7 +184,7 @@ class CompanyBankAccount extends Account { return 1; } - + } else { @@ -265,13 +259,13 @@ class CompanyBankAccount extends Account function delete(User $user = null, $notrigger=0) { global $conf; - + $error = 0; - + dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); - + $this->db->begin(); - + if (! $error && ! $notrigger) { // Call trigger @@ -284,14 +278,14 @@ class CompanyBankAccount extends Account { $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_rib"; $sql .= " WHERE rowid = " . $this->id; - + if (! $this->db->query($sql)) { $error++; $this->errors[]=$this->db->lasterror(); } } - + if (! $error) { $this->db->commit(); @@ -380,7 +374,7 @@ class CompanyBankAccount extends Account return -1; } } - + /** * Initialise an instance with random values. * Used to build previews or test instances. @@ -406,13 +400,13 @@ class CompanyBankAccount extends Account $this->proprio = 'Owner'; $this->owner_address = 'Owner address'; $this->country_id = 1; - + $this->rum = 'UMR-CU1212-0007-5-1475405262'; $this->date_rum =dol_now() - 10000; $this->frstrecur = 'FRST'; - + $this->socid = 0; } - + } diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 6642cc62aac..0be8b7f0d42 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -207,6 +207,8 @@ if (empty($reshook)) $account->rum = GETPOST('rum','alpha'); $account->datec = dol_now(); + $db->begin(); + // This test can be done only once properties were set if ($account->needIBAN() == 1) { @@ -226,26 +228,44 @@ if (empty($reshook)) if (! $error) { - if (empty($account->rum)) + $result = $account->create($user); + if ($result < 0) { - $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); - $account->date_rum = dol_now(); + $error++; + setEventMessages($account->error, $account->errors, 'errors'); + $action='create'; // Force chargement page création } + if (empty($account->rum)) + { + $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); + $account->date_rum = dol_now(); + } + } + + if (! $error) + { $result = $account->update($user); // This will set the UMR number. - // TODO Use create and include update into create method - if (! $result) - { + if ($result < 0) + { + $error++; setEventMessages($account->error, $account->errors, 'errors'); - $_GET["action"]='create'; // Force chargement page création - } - else - { - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; - header('Location: '.$url); - exit; + $action='create'; } } + + if (! $error) + { + $db->commit(); + + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; + header('Location: '.$url); + exit; + } + else + { + $db->rollback(); + } } } @@ -321,11 +341,14 @@ $formfile = new FormFile($db); llxHeader(); $head=societe_prepare_head($object); - if (! $id) - $account->fetch(0,$object->id); +{ + $account->fetch(0,$object->id); +} else +{ $account->fetch($id); +} if (empty($account->socid)) $account->socid=$object->id; if ($socid && $action == 'edit' && $user->rights->societe->creer) @@ -775,7 +798,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) // RUM print ''.$langs->trans("RUM").''; - print ''; + print ''; print ''.$langs->trans("WithdrawMode").''; $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); @@ -872,7 +895,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) // RUM print ''.$langs->trans("RUM").''; - print '
        '.$langs->trans("RUMWillBeGenerated").''; + print '
        '.$langs->trans("RUMWillBeGenerated").''; print ''.$langs->trans("WithdrawMode").''; $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); From 5715f44fe648381b404a26587f0452c80f6c4552 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 00:02:24 +0200 Subject: [PATCH 1065/1137] Better error messages --- .../prelevement/class/bonprelevement.class.php | 13 +++++++++++-- htdocs/compta/prelevement/create.php | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 99b087e1939..25a4a6b18e2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -849,7 +849,7 @@ class BonPrelevement extends CommonObject if ($soc->fetch($fact->socid) >= 0) { $bac = new CompanyBankAccount($this->db); - $bac->fetch(0,$soc->id); + $bac->fetch(0, $soc->id); if ($bac->verif() >= 1) //if (true) @@ -862,7 +862,8 @@ class BonPrelevement extends CommonObject else { dol_syslog(__METHOD__."::Check RIB Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_ERR); - $this->invoice_in_error[$fac[0]]="Error on default bank number RIB/IBAN for invoice ".$fact->getNomUrl(0)." for thirdparty (reported by function verif) ".$soc->getNomUrl(0); + $this->invoice_in_error[$fac[0]]="Error on default bank number RIB/IBAN for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + $this->thirdparty_in_error[$soc->id]="Error on default bank number RIB/IBAN for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } else @@ -889,6 +890,14 @@ class BonPrelevement extends CommonObject //print $out."\n"; dol_syslog($out); + // Return warning + $i=0; + foreach ($this->thirdparty_in_error as $key => $val) + { + if ($i < 10) setEventMessages($val, null, 'warnings'); + else setEventMessages('More error were discarded...', null, 'warnings'); + $i++; + } if (count($factures_prev) > 0) { diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 09102ec1309..6c7eacc4015 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -192,7 +192,9 @@ if ($resql) if ($num) { - $var = True; + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + $bac = new CompanyBankAccount($db); + while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); @@ -211,6 +213,8 @@ if ($resql) // RIB print ''; print $thirdpartystatic->display_rib(); + $bac->fetch(0, $obj->id); + if ($bac->verif() <= 0) print img_warning('Error on default bank number RIB/IBAN'); print ''; // RUM print ''; From 56e437a6c312fd84db38fa5763a3824536aeb8ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 00:03:24 +0200 Subject: [PATCH 1066/1137] Bed fetch --- htdocs/compta/prelevement/create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 6c7eacc4015..5109a96c050 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -213,7 +213,7 @@ if ($resql) // RIB print ''; print $thirdpartystatic->display_rib(); - $bac->fetch(0, $obj->id); + $bac->fetch(0, $obj->socid); if ($bac->verif() <= 0) print img_warning('Error on default bank number RIB/IBAN'); print ''; // RUM From 31ab73ff3c36b4c87eb5ea7f2ff9f42fb19e526a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 00:12:26 +0200 Subject: [PATCH 1067/1137] Fix when verif is called several times --- htdocs/compta/bank/class/account.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8ff51305e08..7b084b9e5ae 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1345,6 +1345,8 @@ class Account extends CommonObject { require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; + $this->error_number = 0; + // Call function to check BAN if (! checkBanForAccount($this)) { From 15bcbc8b437ed1a17ac69755b3b9bf83bcb6b420 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 00:38:59 +0200 Subject: [PATCH 1068/1137] FIX Check on bank info for sepa must be done on iban/swift not on ban --- htdocs/compta/bank/class/account.class.php | 14 ++++++++++---- .../prelevement/class/bonprelevement.class.php | 15 +++++++-------- htdocs/compta/prelevement/create.php | 5 +++-- htdocs/societe/class/societe.class.php | 5 +++++ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 7b084b9e5ae..9d1bf141dc5 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1337,7 +1337,7 @@ class Account extends CommonObject /** - * Return if an account has valid information + * Return if an account has valid information for Direct debit payment * * @return int 1 if correct, <=0 if wrong */ @@ -1348,11 +1348,17 @@ class Account extends CommonObject $this->error_number = 0; // Call function to check BAN - if (! checkBanForAccount($this)) + + if (! checkIbanForAccount($bac) || ! checkSwiftForAccount($bac)) + { + $this->error_number = 12; + $this->error_message = 'IBANSWIFTControlError'; + } + /*if (! checkBanForAccount($this)) { $this->error_number = 12; - $this->error_message = 'RIBControlError'; - } + $this->error_message = 'BANControlError'; + }*/ if ($this->error_number == 0) { diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 25a4a6b18e2..1036fe9041c 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -851,8 +851,7 @@ class BonPrelevement extends CommonObject $bac = new CompanyBankAccount($this->db); $bac->fetch(0, $soc->id); - if ($bac->verif() >= 1) - //if (true) + if ($bac->verif() >= 1) { $factures_prev[$i] = $fac; /* second tableau necessaire pour BonPrelevement */ @@ -861,9 +860,9 @@ class BonPrelevement extends CommonObject } else { - dol_syslog(__METHOD__."::Check RIB Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_ERR); - $this->invoice_in_error[$fac[0]]="Error on default bank number RIB/IBAN for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); - $this->thirdparty_in_error[$soc->id]="Error on default bank number RIB/IBAN for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + dol_syslog(__METHOD__."::Check RIB Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_ERR); + $this->invoice_in_error[$fac[0]]="Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + $this->thirdparty_in_error[$soc->id]="Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } else @@ -1525,9 +1524,9 @@ class BonPrelevement extends CommonObject * @param string $row_zip soc.zip * @param string $row_town soc.town * @param string $row_country_code c.code AS country, - * @param string $row_cb pl.code_banque AS cb, - * @param string $row_cg pl.code_guichet AS cg, - * @param string $row_cc pl.number AS cc, + * @param string $row_cb pl.code_banque AS cb, Not used for SEPA + * @param string $row_cg pl.code_guichet AS cg, Not used for SEPA + * @param string $row_cc pl.number AS cc, Not used for SEPA * @param string $row_somme pl.amount AS somme, * @param string $row_facnumber f.facnumber * @param string $row_idfac pf.fk_facture AS idfac, diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 5109a96c050..1cdfe8d9a7c 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -28,6 +28,7 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -208,13 +209,13 @@ if ($resql) // Thirdparty print ''; $thirdpartystatic->fetch($obj->socid); - print $thirdpartystatic->getNomUrl(1,'card'); + print $thirdpartystatic->getNomUrl(1,'ban'); print ''; // RIB print ''; print $thirdpartystatic->display_rib(); $bac->fetch(0, $obj->socid); - if ($bac->verif() <= 0) print img_warning('Error on default bank number RIB/IBAN'); + if ($bac->verif() <= 0) print img_warning('Error on default bank number for IBAN : '.$bac->error_message); print ''; // RUM print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index bf449f30976..b8f54d86984 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1903,6 +1903,11 @@ class Societe extends CommonObject $label.= '' . $langs->trans("ShowContacts") . ''; $linkstart = ''; + $linkstart = 'db, $conf->global->PRELEVEMENT_USER); - /* - * Read invoices - */ + $this->invoice_in_error = array(); + $this->thirdparty_in_error = array(); + + // Read invoices $factures = array(); $factures_prev = array(); $factures_result = array(); @@ -851,6 +856,9 @@ class BonPrelevement extends CommonObject $bac = new CompanyBankAccount($this->db); $bac->fetch(0, $soc->id); + if ($format == 'FRST' && $bac->frstrecur != 'FRST') continue; + if ($format == 'RCUR' && $bac->frstrecur != 'RCUR') continue; + if ($bac->verif() >= 1) { $factures_prev[$i] = $fac; @@ -890,13 +898,13 @@ class BonPrelevement extends CommonObject dol_syslog($out); // Return warning - $i=0; + /*$i=0; foreach ($this->thirdparty_in_error as $key => $val) { if ($i < 10) setEventMessages($val, null, 'warnings'); else setEventMessages('More error were discarded...', null, 'warnings'); $i++; - } + }*/ if (count($factures_prev) > 0) { @@ -1060,7 +1068,7 @@ class BonPrelevement extends CommonObject $this->factures = $factures_prev_id; // Generation of SEPA file $this->filename - $this->generate(); + $this->generate($format); } dol_syslog(__METHOD__."::End withdraw receipt, file ".$this->filename, LOG_DEBUG); } @@ -1255,14 +1263,16 @@ class BonPrelevement extends CommonObject * - Others countries: Warning message * File is generated with name this->filename * - * @return int 0 if OK, <0 if KO + * @param string $format FRST, RCUR or ALL + * @return int 0 if OK, <0 if KO */ - //TODO: Optimize code to read lines in a single function - function generate() + function generate($format='ALL') { - global $conf,$langs,$mysoc; + global $conf,$langs,$mysoc; - $result = 0; + //TODO: Optimize code to read lines in a single function + + $result = 0; dol_syslog(get_class($this)."::generate build file ".$this->filename); @@ -1340,7 +1350,7 @@ class BonPrelevement extends CommonObject // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all DrctDbtTxInf if ($result != -2) { - $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf); + $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); } else { @@ -1663,9 +1673,10 @@ class BonPrelevement extends CommonObject * @param int $nombre 0 or 1 * @param float $total Total * @param string $CrLf End of line character + * @param string $format FRST or RCUR or ALL * @return string String with SEPA Sender */ - function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') + function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST') { // SEPA INITIALISATION global $conf; @@ -1706,7 +1717,7 @@ class BonPrelevement extends CommonObject $country = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY); $IdBon = sprintf("%05d", $obj->rowid); $RefBon = $obj->ref; - $type = ($nombre == 1) ? 'FRST' : 'RCUR' ; + // SEPA Paiement Information $XML_SEPA_INFO = ''; $XML_SEPA_INFO .= ' '.$CrLf; @@ -1721,7 +1732,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' CORE'.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$type.''.$CrLf; + $XML_SEPA_INFO .= ' '.$format.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$dateTime_ETAD.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 1cdfe8d9a7c..700e587a6a6 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -45,6 +45,8 @@ $result = restrictedArea($user, 'prelevement', '', '', 'bons'); // Get supervariables $action = GETPOST('action','alpha'); +$mode = GETPOST('mode','alpha')?GETPOST('mode','alpha'):'real'; +$format = GETPOST('format','alpha'); /* @@ -63,7 +65,7 @@ if ($action == 'create') { // $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty $bprev = new BonPrelevement($db); - $result=$bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET); + $result=$bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format); if ($result < 0) { setEventMessages($bprev->error, $bprev->errors, 'errors'); @@ -76,7 +78,7 @@ if ($action == 'create') $mesg.='
        '."\n"; foreach($bprev->invoice_in_error as $key => $val) { - $mesg.=$val."
        \n"; + $mesg.=''.$val."
        \n"; } } else @@ -146,8 +148,30 @@ print "
        \n"; if ($nb) { - if ($pricetowithdraw) print ''.$langs->trans("CreateAll")."\n"; - else print ''.$langs->trans("CreateAll")."\n"; + if ($pricetowithdraw) + { + if ($mysoc->isInEEC()) + { + print ''.$langs->trans("CreateForSepaFRST")."\n"; + print ''.$langs->trans("CreateForSepaRCUR")."\n"; + } + else + { + print ''.$langs->trans("CreateAll")."\n"; + } + } + else + { + if ($mysoc->isInEEC()) + { + print ''.$langs->trans("CreateForSepaFRST")."\n"; + print ''.$langs->trans("CreateForSepaRCUR")."\n"; + } + else + { + print ''.$langs->trans("CreateAll")."\n"; + } + } } else { @@ -220,6 +244,8 @@ if ($resql) // RUM print ''; print $thirdpartystatic->display_rib('rum'); + $format = $thirdpartystatic->display_rib('format'); + if ($format) print ' ('.$format.')'; print ''; // Amount print ''; diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 308987575f5..6b1babf9d88 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -55,7 +55,9 @@ StatusMotif5=RIB unusable StatusMotif6=Account without balance StatusMotif7=Judicial Decision StatusMotif8=Other reason -CreateAll=Withdraw all +CreateForSepaFRST=Create direct debit file (SEPA FRST) +CreateForSepaRCUR=Create direct debit file (SEPA RCUR) +CreateAll=Create direct debit file (all) CreateGuichet=Only office CreateBanque=Only bank OrderWaiting=Waiting for treatment diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b8f54d86984..d1d218a0061 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2254,7 +2254,7 @@ class Societe extends CommonObject /** * Return bank number property of thirdparty (label or rum) * - * @param string $mode 'label' or 'rum' + * @param string $mode 'label' or 'rum' or 'format' * @return string Bank number */ function display_rib($mode='label') @@ -2279,6 +2279,10 @@ class Societe extends CommonObject } return $bac->rum; } + elseif ($mode == 'format') + { + return $bac->frstrecur; + } return 'BadParameterToFunctionDisplayRib'; } From dd15884f830beeba51f0743049bf00a0635f34cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 01:35:04 +0200 Subject: [PATCH 1071/1137] Fix recur - rcur --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- htdocs/compta/prelevement/create.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 54990330135..e4156db8a5d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -857,7 +857,7 @@ class BonPrelevement extends CommonObject $bac->fetch(0, $soc->id); if ($format == 'FRST' && $bac->frstrecur != 'FRST') continue; - if ($format == 'RCUR' && $bac->frstrecur != 'RCUR') continue; + if ($format == 'RCUR' && ($bac->frstrecur != 'RCUR' && $bac->frstrecur != 'RECUR')) continue; if ($bac->verif() >= 1) { diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 700e587a6a6..380132058fd 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -46,7 +46,7 @@ $result = restrictedArea($user, 'prelevement', '', '', 'bons'); // Get supervariables $action = GETPOST('action','alpha'); $mode = GETPOST('mode','alpha')?GETPOST('mode','alpha'):'real'; -$format = GETPOST('format','alpha'); +$format = GETPOST('format','aZ09'); /* From 08c94f11b6b00bbf5e34ec97da8fb78ff487f92c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 01:44:26 +0200 Subject: [PATCH 1072/1137] FIX SEPA file if address is empty --- htdocs/compta/prelevement/class/bonprelevement.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index e4156db8a5d..3e8eb876a81 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1580,8 +1580,8 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.dolEscapeXML(strtoupper(dol_string_unaccent($row_nom))).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; - $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))),70,'right','UTF-8',true)).''.$CrLf; - $XML_DEBITOR .=' '.dolEscapeXML(dol_string_unaccent($row_zip.' '.$row_town)).''.$CrLf; + if (trim($row_address)) $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))),70,'right','UTF-8',true)).''.$CrLf; + if (trim($row_zip) || trim($row_town)) $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_zip.($row_zip && $row_town)?' ':''.$row_town), array(CHR(13) => ", ", CHR(10) => "")),70,'right','UTF-8',true)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; From 1d92e807887d3e73a859b40c7f51272fca9e94d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 02:07:51 +0200 Subject: [PATCH 1073/1137] Fix line addr in xml sepa file --- .../prelevement/class/bonprelevement.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 3e8eb876a81..972f67095e3 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1580,8 +1580,10 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.dolEscapeXML(strtoupper(dol_string_unaccent($row_nom))).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; - if (trim($row_address)) $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))),70,'right','UTF-8',true)).''.$CrLf; - if (trim($row_zip) || trim($row_town)) $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc(dol_string_unaccent(strtr($row_zip.($row_zip && $row_town)?' ':''.$row_town), array(CHR(13) => ", ", CHR(10) => "")),70,'right','UTF-8',true)).''.$CrLf; + $addressline1 = dol_string_unaccent(strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""))); + $addressline2 = dol_string_unaccent(strtr($row_zip.(($row_zip && $row_town)?' ':''.$row_town)), array(CHR(13) => ", ", CHR(10) => "")); + if (trim($addressline1)) $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc($addressline1,70,'right','UTF-8',true)).''.$CrLf; + if (trim($addressline2)) $XML_DEBITOR .=' '.dolEscapeXML(dol_trunc($addressline2,70,'right','UTF-8',true)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1739,8 +1741,10 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.strtoupper(dol_string_unaccent($this->raison_sociale)).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $XML_SEPA_INFO .= ' '.strtoupper(dol_string_unaccent($configuration->global->MAIN_INFO_SOCIETE_ADDRESS)).''.$CrLf; - $XML_SEPA_INFO .= ' '.strtoupper(dol_string_unaccent($configuration->global->MAIN_INFO_SOCIETE_ZIP.' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN)).''.$CrLf; + $addressline1 = dol_string_unaccent(strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""))); + $addressline2 = dol_string_unaccent(strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN)?' ':'').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""))); + if ($addressline1) $XML_SEPA_INFO .= ' '.$addressline1.''.$CrLf; + if ($addressline2) $XML_SEPA_INFO .= ' '.$addressline2.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; From 5fd6a27c62597a23258bcdfe910d09a067b6a5c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 02:16:54 +0200 Subject: [PATCH 1074/1137] Fix position of top menu --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f79ac461828..3af93cbcbf6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -182,7 +182,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='accountancy'; - $menu->add('/accountancy/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("Accountancy"), 0, $showmode, $atarget, "accountancy", '', 50, $id, $idsel, $classname); + $menu->add('/accountancy/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("Accountancy"), 0, $showmode, $atarget, "accountancy", '', 52, $id, $idsel, $classname); } From ca0af5cddf99dc60053bb918047b4407c9932a74 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 02:25:17 +0200 Subject: [PATCH 1075/1137] NEW Bulk action validate on customer invoices --- htdocs/compta/facture/list.php | 6 ++++-- htdocs/core/actions_massactions.inc.php | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index be81fe48a0c..1f22bf31523 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -233,7 +233,8 @@ if (empty($reshook)) $objectclass='Facture'; $objectlabel='Invoices'; $permtoread = $user->rights->facture->lire; - $permtodelete = $user->rights->facture->supprimer; + $permtocreate = $user->rights->facture->creer; + $permtodelete = $user->rights->facture->supprimer; $uploaddir = $conf->facture->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -573,7 +574,8 @@ if ($resql) } $arrayofmassactions=array( - 'presend'=>$langs->trans("SendByMail"), + 'validate'=>$langs->trans("Validate"), + 'presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"), ); if ($conf->prelevement->enabled) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 76534211481..0b196699dc0 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -663,6 +663,12 @@ if ($action == 'remove_file') // Validate records if (! $error && $massaction == 'validate' && $permtocreate) { + if ($object->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); + $error++; + } if ($object->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { $langs->load("errors"); From 4a93b709ad8b14de33e71def7cb6f7207e9b1bf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 02:46:49 +0200 Subject: [PATCH 1076/1137] Add param desc on payment link --- htdocs/public/payment/newpayment.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 1862a5b8a47..73fe099f09b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -712,6 +712,7 @@ if ($source == 'order') // Object $text=''.$langs->trans("PaymentOrderRef",$order->ref).''; + if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -824,6 +825,7 @@ if ($source == 'invoice') // Object $text=''.$langs->trans("PaymentInvoiceRef",$invoice->ref).''; + if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -1006,7 +1008,7 @@ if ($source == 'contractline') { $text.='
        '.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_fin_validite); } - + if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -1149,6 +1151,7 @@ if ($source == 'membersubscription') // Object $text=''.$langs->trans("PaymentSubscription").''; + if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; From 3dbd7e600f6ca7f958230500a1f32dc9f7dce497 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 02:47:53 +0200 Subject: [PATCH 1077/1137] Fix param desc --- htdocs/public/payment/newpayment.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 73fe099f09b..345504b2f1d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -712,7 +712,7 @@ if ($source == 'order') // Object $text=''.$langs->trans("PaymentOrderRef",$order->ref).''; - if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; + if (GETPOST('desc','alpha')) $text=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -825,7 +825,7 @@ if ($source == 'invoice') // Object $text=''.$langs->trans("PaymentInvoiceRef",$invoice->ref).''; - if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; + if (GETPOST('desc','alpha')) $text=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -1008,7 +1008,7 @@ if ($source == 'contractline') { $text.='
        '.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_fin_validite); } - if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; + if (GETPOST('desc','alpha')) $text=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -1151,7 +1151,7 @@ if ($source == 'membersubscription') // Object $text=''.$langs->trans("PaymentSubscription").''; - if (GETPOST('desc','alpha')) $text.=''.$langs->trans(GETPOST('desc','alpha')).''; + if (GETPOST('desc','alpha')) $text=''.$langs->trans(GETPOST('desc','alpha')).''; print ''.$langs->trans("Designation"); print ''.$text; print ''; From f8eca95c8257052fcc6bbff9ec4ad444cd527f36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 02:59:00 +0200 Subject: [PATCH 1078/1137] Better param desc --- htdocs/public/payment/newpayment.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 345504b2f1d..5e3428019d6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -277,7 +277,7 @@ if ($action == 'dopayment') $shipToStreet2=GETPOST("shipToStreet2"); $phoneNum=GETPOST("phoneNum"); $email=GETPOST("email"); - $desc=GETPOST("desc"); + $desc=GETPOST("desc",'alpha'); $mesg=''; if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); @@ -772,7 +772,9 @@ if ($source == 'order') print ''."\n"; } print ''."\n"; - print 'ref.'">'."\n"; + $labeldesc=$langs->trans("Order").' '.$order->ref; + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } @@ -893,7 +895,9 @@ if ($source == 'invoice') print ''."\n"; } print ''."\n"; - print 'ref.'">'."\n"; + $labeldesc=$langs->trans("Invoice").' '.$invoice->ref; + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } // Payment on contract line @@ -1096,7 +1100,9 @@ if ($source == 'contractline') print ''."\n"; } print ''."\n"; - print 'ref.'">'."\n"; + $labeldesc=$langs->trans("Contract").' '.$contract->ref; + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } // Payment on member subscription @@ -1252,7 +1258,9 @@ if ($source == 'membersubscription') print ''."\n"; } print ''."\n"; - print ''."\n"; + $labeldesc = $langs->trans("PaymentSubscription"); + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } From 8d3df7ea5751136bc01cdbca4608d16255766475 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 12 Oct 2017 09:59:25 +0200 Subject: [PATCH 1079/1137] Fix can not distinct which credit note are in select list --- htdocs/core/class/html.form.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 25cdfa2d887..5330ce24048 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1188,12 +1188,17 @@ class Form // On recherche les remises $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; $sql.= " re.description, re.fk_facture_source"; + if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST)) $sql.= ", f.facnumber"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re"; + if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture f ON (f.rowid = re.fk_facture_source)"; $sql.= " WHERE re.fk_soc = ".(int) $socid; $sql.= " AND re.entity = " . $conf->entity; if ($filter) $sql.= " AND ".$filter; $sql.= " ORDER BY re.description ASC"; + // Prevent sql error on the ambiguous column + if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST)) $sql = preg_replace('/(.*)(?!re\.)fk_facture_source(.*)/m', '\1 re.fk_facture_source \2', $sql); + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -1225,6 +1230,8 @@ class Form $disabled=' disabled'; } + if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->facnumber)) $desc=$desc.' - '.$obj->facnumber; + print ''; $i++; } From 151fb72183c21b8c630ba75955498229cf4f3631 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Oct 2017 12:28:10 +0200 Subject: [PATCH 1080/1137] NEW documents REST API return list of documents by element --- htdocs/api/class/api_documents.class.php | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 6339ce4a91a..397910a6e2f 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -129,6 +129,75 @@ class Documents extends DolibarrApi return array('filename'=>$filename, 'content'=>base64_encode($file_content), 'encoding'=>'MIME base64 (base64_encode php function, http://php.net/manual/en/function.base64-encode.php)' ); } + /** + * Return the list of documents of an element + * + * @param string $modulepart Name of module or area concerned ('facture', 'project', 'member', ...) + * @param int $id ID of element + * @param string $ref Ref of element + * @return array Array of documents with path + * + * @throws RestException + * + * @url GET list + */ + function getDocumentsListByElement($modulepart, $id=0, $ref='') + { + global $conf; + + if (empty($modulepart)) { + throw new RestException(400, 'bad value for parameter modulepart'); + } + + if (empty($id) && empty($ref)) { + throw new RestException(400, 'bad value for parameter id or ref'); + } + + $id = (empty($id)?0:$id); + + if ($modulepart == 'societe' || $modulepart == 'thirdparty') + { + if (!DolibarrApiAccess::$user->rights->societe->lire) { + throw new RestException(401); + } + + $object = new Societe($this->db); + $result=$object->fetch($id, $ref); + if ( ! $result ) { + throw new RestException(404, 'Thirdparty not found'); + } + + $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id; + } + else if ($modulepart == 'adherent' || $modulepart == 'member') + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + + if (!DolibarrApiAccess::$user->rights->adherent->lire) { + throw new RestException(401); + } + + $object = new Adherent($this->db); + $result=$object->fetch($id, $ref); + if ( ! $result ) { + throw new RestException(404, 'Member not found'); + } + + $upload_dir = $conf->adherent->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'member'); + } + else + { + throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); + } + + $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + if (empty($filearray)) { + throw new RestException(404, 'Modulepart '.$modulepart.' with Id '.$object->id.(! empty($object->Ref)?' and Ref '.$object->ref:'').' does not have any documents.'); + } + + return $filearray; + } + /** * Return a document. From 3f36cf23f59e83949c1b5e72e6093df9ea1543c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 13:03:45 +0200 Subject: [PATCH 1081/1137] NEW Break lines per project on the new timesheet page --- htdocs/core/lib/project.lib.php | 106 ++++++++++++++++++++--------- htdocs/projet/activity/perday.php | 17 ++--- htdocs/projet/activity/perweek.php | 16 ++--- htdocs/projet/class/task.class.php | 44 ++++++------ htdocs/theme/eldy/style.css.php | 23 ++++--- htdocs/theme/md/style.css.php | 7 ++ 6 files changed, 133 insertions(+), 80 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 05bbcf26098..b9c1eb1f1fb 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -611,6 +611,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr } } + $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_BREAK_ON_PROJECT)?0:-1); // 0 to start break , -1 no break + //dol_syslog('projectLinesPerDay inc='.$inc.' preselectedday='.$preselectedday.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0)); for ($i = 0 ; $i < $numlines ; $i++) { @@ -648,6 +650,31 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $projectstatic->public=$lines[$i]->public; $taskstatic->id=$lines[$i]->id; + $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); + $taskstatic->id=$lines[$i]->id; + $taskstatic->label=$lines[$i]->label; + $taskstatic->date_start=$lines[$i]->date_start; + $taskstatic->date_end=$lines[$i]->date_end; + + $thirdpartystatic->id=$lines[$i]->socid; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + $thirdpartystatic->email=$lines[$i]->thirdparty_email; + + if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) + { + print ''."\n"; + print ''; + print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($projectstatic->title) + { + print ' - '; + print $projectstatic->title; + } + print ''; + print ''; + } + + if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id; print ''."\n"; @@ -660,30 +687,23 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr // Project print ""; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); print ""; // Thirdparty print ''; - $thirdpartystatic->id=$lines[$i]->socid; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project', 10); + if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10); print ''; // Ref print ''; - $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); - print $taskstatic->getNomUrl(1, 'withproject', 'time'); - print ''; - - // Label task - print ""; + print ''; for ($k = 0 ; $k < $level ; $k++) print "   "; - $taskstatic->id=$lines[$i]->id; - $taskstatic->ref=$lines[$i]->label; - $taskstatic->date_start=$lines[$i]->date_start; - $taskstatic->date_end=$lines[$i]->date_end; - print $taskstatic->getNomUrl(0, 'withproject', 'time'); + print $taskstatic->getNomUrl(1, 'withproject', 'time'); + // Label task + print '
        '; + for ($k = 0 ; $k < $level ; $k++) print "   "; + print $taskstatic->label; //print "
        "; //for ($k = 0 ; $k < $level ; $k++) print "   "; //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); @@ -773,7 +793,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print ''; - print ''; + // Note + print ''; print ''; print ''; @@ -850,6 +871,8 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ //dol_syslog('projectLinesPerWeek inc='.$inc.' firstdaytoshow='.$firstdaytoshow.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0)); + $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_BREAK_ON_PROJECT)?0:-1); // 0 = start break, -1 = never break + for ($i = 0 ; $i < $numlines ; $i++) { if ($parent == 0) $level = 0; @@ -880,6 +903,33 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $projectstatic->public=$lines[$i]->public; $projectstatic->thirdparty_name=$lines[$i]->thirdparty_name; + $taskstatic->id=$lines[$i]->id; + $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); + $taskstatic->id=$lines[$i]->id; + $taskstatic->label=$lines[$i]->label; + $taskstatic->date_start=$lines[$i]->date_start; + $taskstatic->date_end=$lines[$i]->date_end; + + $thirdpartystatic->id=$lines[$i]->thirdparty_id; + $thirdpartystatic->name=$lines[$i]->thirdparty_name; + $thirdpartystatic->email=$lines[$i]->thirdparty_email; + + if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) + { + print ''."\n"; + print ''; + print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($projectstatic->title) + { + print ' - '; + print $projectstatic->title; + } + print ''; + print ''; + } + + if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id; + print ''."\n"; // User @@ -891,32 +941,24 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ // Project print ''; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); print ""; // Thirdparty print ''; - $thirdpartystatic->id=$lines[$i]->thirdparty_id; - $thirdpartystatic->name=$lines[$i]->thirdparty_name; - print $thirdpartystatic->getNomUrl(1, 'project'); + if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project'); print ''; // Ref print ''; - $taskstatic->id=$lines[$i]->id; - $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); - print $taskstatic->getNomUrl(1, 'withproject', 'time'); - print ''; - - // Label task - print ""; print ''; for ($k = 0 ; $k < $level ; $k++) print "   "; - $taskstatic->id=$lines[$i]->id; - $taskstatic->ref=$lines[$i]->label; - $taskstatic->date_start=$lines[$i]->date_start; - $taskstatic->date_end=$lines[$i]->date_end; - print $taskstatic->getNomUrl(0, 'withproject', 'time'); + print $taskstatic->getNomUrl(1, 'withproject', 'time'); + // Label task + print '
        '; + for ($k = 0 ; $k < $level ; $k++) print "   "; + //print $taskstatic->getNomUrl(0, 'withproject', 'time'); + print $taskstatic->label; //print "
        "; //for ($k = 0 ; $k < $level ; $k++) print "   "; //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 061c522918a..5cea39bc59e 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -324,9 +324,10 @@ if ($id) $onlyopenedproject=1; // or -1 $morewherefilter=''; -if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); -if ($search_task_label) $morewherefilter.=natural_search("t.label", $search_task_label); +if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); +if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); + $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. $projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id?$project->id:0), 0, $onlyopenedproject); $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id?$project->id:0), 0, $onlyopenedproject); @@ -445,7 +446,7 @@ print ''; print ''; print ''; -print ''; +//print ''; print ''; print ''; print ''; @@ -462,10 +463,10 @@ print ''; print "\n"; print ''; -print ''; +print ''; print ''; -print ''; -print ''; +//print ''; +print ''; print ''; print ''; /*print ''; @@ -475,7 +476,7 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -495,7 +496,7 @@ if (count($tasksarray) > 0) $j=0; projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse, $isavailable); - $colspan = 9; + $colspan = 8; print ''; if (! $i) $totalarray['nbfield']++; } @@ -854,7 +854,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } From 50da6a0c9e4c013a4afa4958fcfd1c2df5c4e1c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 14:59:38 +0200 Subject: [PATCH 1084/1137] Prepare code for removing adodb --- htdocs/core/lib/functions.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 96823262800..aa5628f02b9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1599,7 +1599,7 @@ function dol_strftime($fmt, $ts=false, $is_gmt=false) * @param string $tzoutput true or 'gmt' => string is for Greenwich location * false or 'tzserver' => output string is for local PHP server TZ usage * 'tzuser' => output string is for user TZ (current browser TZ with current dst) - * 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) + * 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) (TODO not implemented yet) * @param Translate $outputlangs Object lang that contains language for text translation. * @param boolean $encodetooutput false=no convert into output pagecode * @return string Formated date or '' if time is null @@ -1698,14 +1698,14 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e $ssec = (! empty($reg[6]) ? $reg[6] : ''); $time=dol_mktime($shour,$smin,$ssec,$smonth,$sday,$syear,true); - $ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt); + $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. } else { // Date is a timestamps if ($time < 100000000000) // Protection against bad date values { - $ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. + $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. } else $ret='Bad value '.$time.' for date'; } @@ -1713,8 +1713,8 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if (preg_match('/__b__/i',$format)) { // Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs. - $month=adodb_strftime('%m',$time+$offsettz+$offsetdst); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. - $month=sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'. + $month=adodb_strftime('%m', $time+$offsettz+$offsetdst); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. + $month=sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'. if ($encodetooutput) { $monthtext=$outputlangs->transnoentities('Month'.$month); @@ -1733,7 +1733,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e } if (preg_match('/__a__/i',$format)) { - $w=adodb_strftime('%w',$time+$offsettz+$offsetdst); // TODO Remove this + $w=adodb_strftime('%w', $time+$offsettz+$offsetdst); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. $dayweek=$outputlangs->transnoentitiesnoconv('Day'.$w); $ret=str_replace('__A__',$dayweek,$ret); $ret=str_replace('__a__',dol_substr($dayweek,0,3),$ret); From 1fba58b9ce1d359cb8700be09e4addea170c7ef7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 17:09:17 +0200 Subject: [PATCH 1085/1137] Fix bookmark list --- htdocs/bookmarks/list.php | 22 ++++--------------- .../install/mysql/migration/6.0.0-7.0.0.sql | 1 + htdocs/install/mysql/tables/llx_projet.sql | 2 +- htdocs/projet/list.php | 4 ++-- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index c9387561837..81205e4d6f8 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -83,7 +83,7 @@ llxHeader('', $langs->trans("ListOfBookmarks")); print load_fiche_titre($langs->trans("ListOfBookmarks")); -$sql = "SELECT b.fk_soc as rowid, b.dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,"; +$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,"; $sql.= " u.login, u.lastname, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid"; $sql.= " WHERE 1=1"; @@ -107,7 +107,7 @@ if ($resql) print ""; //print ""; - print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"rowid","", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre("Link",'',''); print_liste_field_titre("Target",'','','','','align="center"'); @@ -127,7 +127,7 @@ if ($resql) // Id print ''; $linkintern=0; @@ -136,21 +136,7 @@ if ($resql) // Title print "'; if (! $i) $totalarray['nbfield']++; } @@ -854,7 +854,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } From 074eda016b193af0ab773bfe81ffe9f73e9ca0f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 17:12:42 +0200 Subject: [PATCH 1086/1137] Fix redirect to bookmark only if not external link --- htdocs/bookmarks/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 2c3b200b4e4..3a4ae51d62d 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -65,7 +65,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') if (GETPOST('cancel','alpha')) { - if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); + if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url) && ! preg_match('/^http/i', $url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); header("Location: ".$backtopage); exit; } From 31aa1faa325c253ab18ff5dfc703f1f7b2529656 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 17:18:05 +0200 Subject: [PATCH 1087/1137] Fix bookmark edit --- htdocs/bookmarks/card.php | 2 +- htdocs/bookmarks/list.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 3a4ae51d62d..dcc6d8cdeab 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -98,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') if ($res > 0) { - if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); + if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url) && ! preg_match('/^http/i', $url))?$url:DOL_URL_ROOT.'/bookmarks/list.php')); header("Location: ".$backtopage); exit; } diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 81205e4d6f8..0e22e2112cd 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -50,7 +50,7 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield='position'; if (! $sortorder) $sortorder='ASC'; -$id = GETPOST("bid",'int'); +$id = GETPOST("id",'int'); /* @@ -179,11 +179,11 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } @@ -833,7 +833,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['d.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0f2fd46c3f6..5e893a3ab44 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -866,7 +866,7 @@ if ($resql) if (! empty($arrayfields['p.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -874,7 +874,7 @@ if ($resql) if (! empty($arrayfields['p.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 72f2ac61213..49386538468 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1307,7 +1307,7 @@ if ($resql) if (! empty($arrayfields['c.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -1315,7 +1315,7 @@ if ($resql) if (! empty($arrayfields['c.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 1f22bf31523..a7cc2f9e719 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1157,7 +1157,7 @@ if ($resql) if (! empty($arrayfields['f.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -1165,7 +1165,7 @@ if ($resql) if (! empty($arrayfields['f.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 05fcf3e0916..ac953d802de 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -821,7 +821,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -829,7 +829,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index dfc00f95e11..d32986cbeeb 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -795,7 +795,7 @@ if ($resql) if (! empty($arrayfields['c.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -803,7 +803,7 @@ if ($resql) if (! empty($arrayfields['c.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 945b5b8b983..d39c61e397c 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -720,7 +720,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['cd.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -728,7 +728,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['cd.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 4cdff0bd38c..2c1427c87f5 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -625,7 +625,7 @@ if ($resql) if (! empty($arrayfields['e.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -633,7 +633,7 @@ if ($resql) if (! empty($arrayfields['e.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index c483dae647f..ef97d487298 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -558,7 +558,7 @@ if ($resql) if (! empty($arrayfields['f.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -566,7 +566,7 @@ if ($resql) if (! empty($arrayfields['f.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index ce95cfc7ebf..3894cf28cc4 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1180,7 +1180,7 @@ if ($resql) if (! empty($arrayfields['cf.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -1188,7 +1188,7 @@ if ($resql) if (! empty($arrayfields['cf.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9d6c5e4ccd3..e74a3b4df8e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1074,7 +1074,7 @@ if ($resql) if (! empty($arrayfields['f.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -1082,7 +1082,7 @@ if ($resql) if (! empty($arrayfields['f.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index b6c2f86e13f..4c314661959 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -504,7 +504,7 @@ while ($i < min($num, $limit)) print ''; foreach($object->fields as $key => $val) { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Discard some field output at end $align=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; @@ -512,7 +512,8 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['t.'.$key]['checked'])) { print ''; - if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser'); + elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1); elseif ($key == 'status') print $object->getLibStatut(3); else print $obj->$key; @@ -555,7 +556,7 @@ while ($i < min($num, $limit)) // Rest of fields foreach($object->fields as $key => $val) { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Keep only field not yet already output $align=''; if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; @@ -563,7 +564,8 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['t.'.$key]['checked'])) { print ''; - if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser'); + elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); elseif ($key == 'status') print $object->getLibStatut(3); else print $obj->$key; print ''; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index df3a04d3233..525bd96ed90 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -963,7 +963,7 @@ else if (! empty($arrayfields['p.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -971,7 +971,7 @@ else if (! empty($arrayfields['p.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 6c282f12101..7d236c904f5 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -527,7 +527,7 @@ if ($resql) if (! empty($arrayfields['t.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -535,7 +535,7 @@ if ($resql) if (! empty($arrayfields['t.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index f2da27ea56f..ccc2c12584e 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -816,7 +816,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['t.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -824,7 +824,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['t.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 4f8b5513016..f9e10667ccd 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1261,7 +1261,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['s.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -1269,7 +1269,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['s.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 013ad832898..9b345827a8e 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -853,7 +853,7 @@ if ($resql) if (! empty($arrayfields['sp.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -861,7 +861,7 @@ if ($resql) if (! empty($arrayfields['sp.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 91fe86517c6..15571755944 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -644,7 +644,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['u.datec']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } @@ -652,7 +652,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['u.tms']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } From 6497ca53942213bd933b45a1e4f194e13ff9deff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 18:14:02 +0200 Subject: [PATCH 1089/1137] prepare tzuserrel --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index aa5628f02b9..c3c7913e2d4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1625,7 +1625,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e $offsettz=0; $offsetdst=0; } - elseif ($tzoutput == 'tzuser') + elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') { $to_gmt=true; $offsettzstring=(empty($_SESSION['dol_tz_string'])?'UTC':$_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion' From 86f7add3556e328a5264162c776905c815c10e95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 19:12:52 +0200 Subject: [PATCH 1090/1137] FIX Default value was not set --- htdocs/societe/rib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 0be8b7f0d42..7bfc5a482fe 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -571,6 +571,7 @@ if ($socid && $action != 'edit' && $action != "create") include_once DOL_DOCUMENT_ROOT.'/core/modules/bank/modules_bank.php'; $modellist=ModeleBankAccountDoc::liste_modeles($db); + $out = ''; if (is_array($modellist) && count($modellist)) { @@ -585,6 +586,8 @@ if ($socid && $action != 'edit' && $action != "create") $arraykeys=array_keys($modellist); $modelselected=$arraykeys[0]; } + if (! empty($conf->global->BANKADDON_PDF)) $modelselected = $conf->global->BANKADDON_PDF; + $out.= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); $out.= ajax_combobox('modelrib'.$rib->id); From 6455e6d4725bc2e0279889ffef16aab7b6a9a848 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Thu, 12 Oct 2017 21:19:24 +0200 Subject: [PATCH 1091/1137] Use billed field from database on fetch shipping --- htdocs/expedition/class/expedition.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d440396d0c3..cf1c7afad9c 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -481,7 +481,7 @@ class Expedition extends CommonObject // Check parameters if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut"; + $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.billed"; $sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; $sql.= ", e.fk_shipping_method, e.tracking_number"; @@ -525,7 +525,7 @@ class Expedition extends CommonObject $this->tracking_number = $obj->tracking_number; $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility $this->origin_id = $obj->origin_id; - $this->billed = ($obj->fk_statut==2?1:0); + $this->billed = $obj->billed; $this->trueWeight = $obj->weight; $this->weight_units = $obj->weight_units; From e0a8f03f06382325339ed45dcd7a6c175aefc8db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 23:45:53 +0200 Subject: [PATCH 1092/1137] Disable prof id 4,5,6 by default --- htdocs/langs/fr_FR/companies.lang | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 67ef632a010..ffed13c0c69 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -101,15 +101,15 @@ Gencod=Code-barres ProfId1Short=Id. prof. 1 ProfId2Short=Id. prof. 2 ProfId3Short=Id. prof. 3 -ProfId4Short=Id. prof. 4 -ProfId5Short=Id. prof. 5 -ProfId6Short=Id prof. 6 +ProfId4Short=- +ProfId5Short=- +ProfId6Short=- ProfId1=Identifiant professionnel 1 ProfId2=Identifiant professionnel 2 ProfId3=Identifiant professionnel 3 -ProfId4=Identifiant professionnel 4 -ProfId5=Identifiant professionnel 5 -ProfId6=Identifiant professionnel 6 +ProfId4=- +ProfId5=- +ProfId6=- ProfId1AR=Id. prof. 1 (CUIT/CUIL) ProfId2AR=Id. prof. 2 (Revenus brutes) ProfId3AR=- From 558f261b604a196bad04f7a6cc7d1b3c9b09ce33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 01:03:33 +0200 Subject: [PATCH 1093/1137] FIX #7593 --- htdocs/comm/remx.php | 2 +- htdocs/compta/facture/card.php | 12 ++++++------ htdocs/core/class/discount.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 17 ++++++++++++++--- htdocs/langs/en_US/companies.lang | 1 + 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 94142b6ec54..17e2feb4a84 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -389,7 +389,7 @@ if ($socid > 0) $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; - print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1); + print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("ExcessReceived"),$obj->description).' '.$facturestatic->getNomURl(1); print ''; } else diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1d621d153f5..9c0aff43abf 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2843,12 +2843,12 @@ else if ($id > 0 || ! empty($ref)) $resteapayer = 0; $resteapayeraffiche = $resteapayer; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { - $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%'))"; - $filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'"; + $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))"; + $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')"; } $absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount); @@ -2871,9 +2871,9 @@ else if ($id > 0 || ! empty($ref)) // Confirmation de la conversion de l'avoir en reduc if ($action == 'converttoreduc') { - if($object->type == 0) $type_fac = 'ExcessReceived'; - elseif($object->type == 2) $type_fac = 'CreditNote'; - elseif($object->type == 3) $type_fac = 'Deposit'; + if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived'; + elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote'; + elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit'; $text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac))); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2); } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 89bb230d34f..bef86a320ab 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -445,14 +445,14 @@ class DiscountAbsolute $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; - $sql.= ' AND f.type = 2'; + $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received } else if ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql.= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id; - $sql.= ' AND f.type = 2'; + $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 25cdfa2d887..05b976ad4d2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4153,15 +4153,26 @@ class Form print ''; print ''; print '
        '; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) // Never use this option. { if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); // If we want deposit to be substracted to payments only and not to total of final invoice else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); } else { - if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%'))") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); - else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); + if (! $filter) + { + print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); + } + elseif ($filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))") + { + // Replace trans key with CompanyHasDownPaymentOrCommercialDiscount + print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)); + } + else + { + print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)); + } } if (empty($hidelist)) print ': '; print '
        '; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index bd7d7983191..2be010b8803 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -265,6 +265,7 @@ CustomerAbsoluteDiscountShort=Absolute discount CompanyHasRelativeDiscount=This customer has a default discount of %s%% CompanyHasNoRelativeDiscount=This customer has no relative discount by default CompanyHasAbsoluteDiscount=This customer has discount available (credits notes or down payments) for %s %s +CompanyHasDownPaymentOrCommercialDiscount=This customer has discount available (commercial, down payments) for %s %s CompanyHasCreditNote=This customer still has credit notes for %s %s CompanyHasNoAbsoluteDiscount=This customer has no discount credit available CustomerAbsoluteDiscountAllUsers=Absolute discounts (granted by all users) From c3ada198927600fad1a7009551155a48f23d5ac1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 01:27:49 +0200 Subject: [PATCH 1094/1137] Fix demo backup --- dev/initdemo/savedemo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/initdemo/savedemo.sh b/dev/initdemo/savedemo.sh index fd3f8caafd5..20aebb29b28 100755 --- a/dev/initdemo/savedemo.sh +++ b/dev/initdemo/savedemo.sh @@ -187,6 +187,7 @@ export list=" --ignore-table=$base.llx_bt_webseedfiles --ignore-table=$base.llx_c_civilite --ignore-table=$base.llx_c_dolicloud_plans + --ignore-table=$base.llx_c_pays --ignore-table=$base.llx_c_source --ignore-table=$base.llx_cabinetmed_c_banques --ignore-table=$base.llx_cabinetmed_c_ccam From 857b59409c832ca1b3e6b49a6b8a0f50a3093d09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 01:50:00 +0200 Subject: [PATCH 1095/1137] FIX sql syntax error because of old field accountancy_journal --- htdocs/compta/charges/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index e048de2deb7..c9a58670897 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -135,7 +135,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,"; $sql.= " pct.code as payment_code,"; - $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; @@ -256,7 +256,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,"; $sql.= " pct.code as payment_code,"; - $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; @@ -470,7 +470,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,"; $sql.= " pct.code as payment_code,"; - $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; + $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; From 6fcc0bfdcab95996d7ed5a998ee878f5c75a9cc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 02:02:13 +0200 Subject: [PATCH 1096/1137] Remove deprecated option --- htdocs/accountancy/admin/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index bc078c062c6..5ce7d6c0413 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -6,6 +6,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2017 Laurent Destailleur * * 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 @@ -19,7 +20,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -167,7 +167,7 @@ print '' print ''; // Default mode for calculating turnover (parameter ACCOUNTING_MODE) - +/* print '
        '.$langs->trans("ProjectRef").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("RefTask").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").''.$langs->trans("TimeSpent").'
        ( print '
        '.$langs->trans("TimeSpent").''.$langs->trans("HourStart").''.$langs->trans("Duration").''.$langs->trans("Note").''.$langs->trans("Note").'
        '; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 1d71608e634..f44a03b0cd9 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -328,8 +328,8 @@ if ($id) $onlyopenedproject=1; // or -1 $morewherefilter=''; -if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); -if ($search_task_label) $morewherefilter.=natural_search("t.label", $search_task_label); +if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); +if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. @@ -450,7 +450,7 @@ print ''; print ''; print ''; -print ''; +//print ''; print ''; print ''; print ''; @@ -468,10 +468,10 @@ print ''; print "\n"; print ''; -print ''; +print ''; print ''; -print ''; -print ''; +//print ''; +print ''; print ''; print ''; /*print ''; @@ -517,7 +517,7 @@ if (count($tasksarray) > 0) $level=0; projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable); - $colspan=8; + $colspan=7; print ''; + print ''; } print "
        '.$langs->trans("ProjectRef").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("RefTask").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").'
        '; @@ -536,7 +536,7 @@ if (count($tasksarray) > 0) } else { - print '
        '.$langs->trans("NoTasks").'
        '.$langs->trans("NoTasks").'
        "; print ''; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f6969075b2a..e5c9e169b5c 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -669,14 +669,14 @@ class Task extends CommonObject * @param int $projectid Project id * @param int $socid Third party id * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists - * @param string $filteronprojref Filter on project ref + * @param string $filteronproj Filter on project ref or label * @param string $filteronprojstatus Filter on project status * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...') * @param string $filteronprojuser Filter on user that is a contact of project * @param string $filterontaskuser Filter on user assigned to task * @return array Array of tasks */ - function getTasksArray($usert=0, $userp=0, $projectid=0, $socid=0, $mode=0, $filteronprojref='', $filteronprojstatus=-1, $morewherefilter='',$filteronprojuser=0,$filterontaskuser=0) + function getTasksArray($usert=0, $userp=0, $projectid=0, $socid=0, $mode=0, $filteronproj='', $filteronprojstatus=-1, $morewherefilter='',$filteronprojuser=0,$filterontaskuser=0) { global $conf; @@ -690,7 +690,7 @@ class Task extends CommonObject $sql.= " p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus,"; $sql.= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,"; $sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,"; - $sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name"; + $sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name, s.email as thirdparty_email"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; if ($mode == 0) @@ -751,7 +751,7 @@ class Task extends CommonObject } if ($socid) $sql.= " AND p.fk_soc = ".$socid; if ($projectid) $sql.= " AND p.rowid in (".$projectid.")"; - if ($filteronprojref) $sql.= " AND p.ref LIKE '%".$this->db->escape($filteronprojref)."%'"; + if ($filteronproj) $sql.= " AND (p.ref LIKE '%".$this->db->escape($filteronproj)."%' OR p.title LIKE '%".$this->db->escape($filteronproj)."%')"; if ($filteronprojstatus > -1) $sql.= " AND p.fk_statut = ".$filteronprojstatus; if ($morewherefilter) $sql.=$morewherefilter; $sql.= " ORDER BY p.ref, t.rang, t.dateo"; @@ -807,8 +807,10 @@ class Task extends CommonObject $tasks[$i]->date_end = $this->db->jdate($obj->date_end); $tasks[$i]->rang = $obj->rang; + $tasks[$i]->socid = $obj->thirdparty_id; // For backward compatibility $tasks[$i]->thirdparty_id = $obj->thirdparty_id; $tasks[$i]->thirdparty_name = $obj->thirdparty_name; + $tasks[$i]->thirdparty_email= $obj->thirdparty_email; } $i++; @@ -1695,8 +1697,8 @@ class Task extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } - - + + /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -1706,12 +1708,12 @@ class Task extends CommonObject function load_board($user) { global $conf, $langs; - + $mine=0; $socid=$user->societe_id; - + $projectstatic = new Project($this->db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid); - + // List of tasks (does not care about permissions. Filtering will be done later) $sql = "SELECT p.rowid as projectid, p.fk_statut as projectstatus,"; $sql.= " t.rowid as taskid, t.progress as progress, t.fk_statut as status,"; @@ -1734,29 +1736,29 @@ class Task extends CommonObject if ($resql) { $task_static = new Task($this->db); - + $response = new WorkboardResponse(); $response->warning_delay = $conf->projet->task->warning_delay/60/60/24; $response->label = $langs->trans("OpenedTasks"); if ($user->rights->projet->all->lire) $response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mainmenu=project'; else $response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mode=mine&mainmenu=project'; $response->img = img_object('',"task"); - + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $response->nbtodo++; - + $task_static->projectstatus = $obj->projectstatus; $task_static->progress = $obj->progress; $task_static->fk_statut = $obj->status; $task_static->date_end = $this->db->jdate($obj->datee); - + if ($task_static->hasDelay()) { $response->nbtodolate++; } } - + return $response; } else @@ -1765,8 +1767,8 @@ class Task extends CommonObject return -1; } } - - + + /** * Charge indicateurs this->nb de tableau de bord * @@ -1775,12 +1777,12 @@ class Task extends CommonObject function load_state_board() { global $user; - + $mine=0; $socid=$user->societe_id; - + $projectstatic = new Project($this->db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid); - + // List of tasks (does not care about permissions. Filtering will be done later) $sql = "SELECT count(p.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; @@ -1794,11 +1796,11 @@ class Task extends CommonObject //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; - + $resql=$this->db->query($sql); if ($resql) { - + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b0ccd0ab097..7faca1aee80 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -47,6 +47,7 @@ $colorbacklineimpair2='255,255,255'; // line impair $colorbacklinepair1='248,248,248'; // line pair $colorbacklinepair2='248,248,248'; // line pair $colorbacklinepairhover='238,246,252'; // line pair +$colorbacklinebreak='214,218,220'; // line break $colorbackbody='255,255,255'; $colortexttitlenotab='100,60,20'; $colortexttitle='0,0,0'; @@ -100,7 +101,7 @@ $dol_no_mouse_hover=$conf->dol_no_mouse_hover; //$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; //var_dump($user->conf->THEME_ELDY_RGB); -$useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:1); +$useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:0); $borderwith=2; // Case of option always editable @@ -109,6 +110,7 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_ if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=$colorbacklinepairhover; +if (! isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK=$colorbacklinebreak; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; @@ -133,6 +135,7 @@ $colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( $colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); $colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); $colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinebreak =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEBREAK) ?$colorbacklinebreak:$conf->global->THEME_ELDY_LINEBREAK) :(empty($user->conf->THEME_ELDY_LINEBREAK)?$colorbacklinebreak:$user->conf->THEME_ELDY_LINEBREAK); $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); $colortexttitlenotab =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLENOTAB)?$colortexttitlenotab:$conf->global->THEME_ELDY_TEXTTITLENOTAB) :(empty($user->conf->THEME_ELDY_TEXTTITLENOTAB)?$colortexttitlenotab:$user->conf->THEME_ELDY_TEXTTITLENOTAB); $colortexttitle =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLE) ?$colortexttitle:$conf->global->THEME_ELDY_TEXTTITLE) :(empty($user->conf->THEME_ELDY_TEXTTITLE)?$colortexttitle:$user->conf->THEME_ELDY_TEXTTITLE); @@ -248,7 +251,8 @@ body { trans("DIRECTION").";\n"; ?> } -th a, .thumbstat, a.tab { color: rgb() !important; font-weight: bold !important; } +.thumbstat, a.tab { color: rgb() !important; font-weight: bold !important; } +th a { font-weight: !important; } a.tab { font-weight: bold !important; } a:link, a:visited, a:hover, a:active { font-family: ; font-weight: normal; color: rgb(); text-decoration: none; } @@ -2414,6 +2418,7 @@ table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.nobor } table.liste td, table.noborder td, div.noborder form div { padding: 7px 2px 7px 3px; /* t r b l */ + line-height: 1.2em; } div.liste_titre_bydiv .divsearchfield { padding: 2px 1px 2px 0px; /* t r b l */ @@ -2653,7 +2658,9 @@ td.evenodd, tr.nohoverpair td { background-color: # !important; background: # !important; } - +.trforbreak td { + background-color: # !important; +} table.dataTable td { padding: 5px 2px 5px 3px !important; @@ -2677,18 +2684,11 @@ tr.nobottom td, tr.nobottom , td.nobottom { div.liste_titre .tagtd { vertical-align: middle; } -/*div.liste_titre { - box-shadow: 2px 2px 4px #CCC; -}*/ div.liste_titre { min-height: 26px !important; /* We cant use height because it's a div and it should be higher if content is more. but min-height does not work either for div */ padding-top: 2px; padding-bottom: 2px; - -/* border-top-width: 1px; - border-top-color: #BBB; - border-top-style: solid;*/ } div.liste_titre_bydiv { border-top-width: px; @@ -2699,7 +2699,8 @@ div.liste_titre_bydiv { display: table; padding: 2px 0px 2px 0; box-shadow: none; - width: calc(100% - 1px); /* 1px more, i don't know why */ + /*width: calc(100% - 1px); 1px more, i don't know why so i remove */ + width: calc(100%); } tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index c5577469182..7cec201021e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -48,6 +48,7 @@ $colorbacklineimpair2='255,255,255'; // line impair $colorbacklinepair1='250,250,250'; // line pair $colorbacklinepair2='248,248,248'; // line pair $colorbacklinepairhover='244,244,244'; // line pair +$colorbacklinebreak='214,218,220'; $colorbackbody='248,248,248'; $colortexttitlenotab='90,90,90'; $colortexttitle='20,20,20'; @@ -107,8 +108,10 @@ $borderwith=2; // Case of option always editable if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody; if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1; +if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER==$colorbacklinepairhover; +if (! isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK=$colorbacklinebreak; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; @@ -136,6 +139,7 @@ $colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( $colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); $colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); $colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinebreak =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEBREAK) ?$colorbacklinebreak:$conf->global->THEME_ELDY_LINEBREAK) :(empty($user->conf->THEME_ELDY_LINEBREAK)?$colorbacklinebreak:$user->conf->THEME_ELDY_LINEBREAK); $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); $colortexttitlenotab =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLENOTAB)?$colortexttitlenotab:$conf->global->THEME_ELDY_TEXTTITLENOTAB) :(empty($user->conf->THEME_ELDY_TEXTTITLENOTAB)?$colortexttitlenotab:$user->conf->THEME_ELDY_TEXTTITLENOTAB); $colortexttitle =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXTTITLE) ?$colortext:$conf->global->THEME_ELDY_TEXTTITLE) :(empty($user->conf->THEME_ELDY_TEXTTITLE)?$colortexttitle:$user->conf->THEME_ELDY_TEXTTITLE); @@ -2762,6 +2766,9 @@ td.evenodd, tr.nohoverpair td { background-color: # !important; background: # !important; } +.trforbreak td { + background-color: # !important; +} table.dataTable td { padding: 5px 2px 5px 3px !important; From 45b4572ad48d990fb402a9d6a54c83856c2cf3e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 13:30:28 +0200 Subject: [PATCH 1082/1137] Label shorter --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/langs/en_US/bills.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 201a2806188..9c1e6519db9 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -126,7 +126,7 @@ $arrayfields=array( 'recurring'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1), 'f.frequency'=>array('label'=>$langs->trans("Frequency"), 'checked'=>1), 'f.unit_frequency'=>array('label'=>$langs->trans("FrequencyUnit"), 'checked'=>1), - 'f.nb_gen_done'=>array('label'=>$langs->trans("NbOfGenerationDone"), 'checked'=>1), + 'f.nb_gen_done'=>array('label'=>$langs->trans("NbOfGenerationDoneShort"), 'checked'=>1), 'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGeneration"), 'checked'=>1), 'f.date_when'=>array('label'=>$langs->trans("NextDateToExecution"), 'checked'=>1), 'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>100), diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index f093726ed4b..b3f9c030d3e 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -337,6 +337,7 @@ NextDateToExecution=Date for next invoice generation DateLastGeneration=Date of latest generation MaxPeriodNumber=Max nb of invoice generation NbOfGenerationDone=Nb of invoice generation already done +NbOfGenerationDoneShort=Nb of generation done MaxGenerationReached=Maximum nb of generations reached InvoiceAutoValidate=Validate invoices automatically GeneratedFromRecurringInvoice=Generated from template recurring invoice %s From 2fd0ffbfec8958ac66dce877ed9028e18e616598 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 14:50:25 +0200 Subject: [PATCH 1083/1137] Fix tz for date creation/update --- htdocs/projet/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 5d0af329952..6eaf231a5cb 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -846,7 +846,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.datec']['checked'])) { print '
        '; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print '
         '; - print "bid."\">".img_object($langs->trans("ShowBookmark"),"bookmark").' '.$obj->bid.""; + print "rowid."\">".img_object($langs->trans("ShowBookmark"),"bookmark").' '.$obj->rowid.""; print '"; - if ($obj->rowid) - { - // Lien interne societe - $linkintern=1; - $link="Dolibarr"; - if (! $obj->title) - { - // For compatibility with old Dolibarr bookmarks - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $societe=new Societe($db); - $societe->fetch($obj->rowid); - $obj->title=$societe->name; - } - $title=img_object($langs->trans("ShowCompany"),"company").' '.$obj->title; - } + $linkintern=1; if ($linkintern) print "url."\">"; print $title; if ($linkintern) print ""; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 2380f13a06d..b02fb81495b 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -365,6 +365,7 @@ ALTER TABLE llx_c_payment_term DROP PRIMARY KEY; ALTER TABLE llx_c_payment_term ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term(rowid, entity, code); +ALTER TABLE llx_projet CHANGE datec datec datetime; create table llx_c_email_senderprofile ( diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 8ca404d3a0e..3875e64e1a7 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -21,7 +21,7 @@ create table llx_projet ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_soc integer, - datec date, -- date creation project + datec datetime, -- date creation project tms timestamp, dateo date, -- date start project datee date, -- date end project diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 8eb9ba4b421..50a2148603b 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -846,7 +846,7 @@ while ($i < min($num,$limit)) if (! empty($arrayfields['p.datec']['checked'])) { print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; if ($user->rights->bookmark->creer) { - print "bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()." "; + print "rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()." "; } if ($user->rights->bookmark->supprimer) { - print "bid\">".img_delete().""; + print "rowid\">".img_delete().""; } else { @@ -209,7 +209,7 @@ print "
        \n"; if ($user->rights->bookmark->creer) { - print ''.$langs->trans("NewBookmark").''; + print ''.$langs->trans("NewBookmark").''; } print '
        '; From 8c5cf9ea45738a81dd1cce332f32b5ffe5c3d62a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Oct 2017 18:04:47 +0200 Subject: [PATCH 1088/1137] Fix date output --- htdocs/adherents/list.php | 4 ++-- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/list.php | 4 ++-- htdocs/compta/facture/list.php | 4 ++-- htdocs/contact/list.php | 4 ++-- htdocs/contrat/list.php | 4 ++-- htdocs/contrat/services.php | 4 ++-- htdocs/expedition/list.php | 4 ++-- htdocs/fichinter/list.php | 4 ++-- htdocs/fourn/commande/list.php | 4 ++-- htdocs/fourn/facture/list.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 10 ++++++---- htdocs/product/list.php | 4 ++-- htdocs/product/stock/productlot_list.php | 4 ++-- htdocs/projet/tasks/list.php | 4 ++-- htdocs/societe/list.php | 4 ++-- htdocs/supplier_proposal/list.php | 4 ++-- htdocs/user/index.php | 4 ++-- 18 files changed, 40 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 398d5b62adc..85c22a535bd 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -825,7 +825,7 @@ while ($i < min($num, $limit)) if (! empty($arrayfields['d.datec']['checked'])) { print '
        '; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print '
        '; - print dol_print_date($obj->date_creation, 'dayhour'); + print dol_print_date($obj->date_creation, 'dayhour', 'tzuser'); print ''; - print dol_print_date($obj->date_update, 'dayhour'); + print dol_print_date($obj->date_update, 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print '
        '; print ''; @@ -194,7 +194,7 @@ print "
        \n"; print '
        '; - +*/ // Others params From 647c4036cf105436048febbefd391702193fd845 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 13 Oct 2017 09:21:37 +0200 Subject: [PATCH 1097/1137] Fix simplification of code --- htdocs/core/class/html.form.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5330ce24048..8de5ba47ceb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1188,17 +1188,12 @@ class Form // On recherche les remises $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; $sql.= " re.description, re.fk_facture_source"; - if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST)) $sql.= ", f.facnumber"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re"; - if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture f ON (f.rowid = re.fk_facture_source)"; $sql.= " WHERE re.fk_soc = ".(int) $socid; $sql.= " AND re.entity = " . $conf->entity; if ($filter) $sql.= " AND ".$filter; $sql.= " ORDER BY re.description ASC"; - // Prevent sql error on the ambiguous column - if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST)) $sql = preg_replace('/(.*)(?!re\.)fk_facture_source(.*)/m', '\1 re.fk_facture_source \2', $sql); - dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -1230,7 +1225,11 @@ class Form $disabled=' disabled'; } - if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->facnumber)) $desc=$desc.' - '.$obj->facnumber; + if (!empty($conf->global->MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST) && !empty($obj->fk_facture_source)) + { + $tmpfac = new Facture($this->db); + if ($tmpfac->fetch($obj->fk_facture_source) > 0) $desc=$desc.' - '.$tmpfac->ref; + } print ''; $i++; From 2b55fb81b9fdf9e357e63ee331c1b8994d8a8f9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 10:35:21 +0200 Subject: [PATCH 1098/1137] Standardize substition keys. --- ChangeLog | 8 ++++--- htdocs/admin/mails.php | 2 +- htdocs/admin/mails_emailing.php | 2 +- htdocs/comm/mailing/card.php | 3 ++- htdocs/core/class/html.formmail.class.php | 8 +++---- htdocs/core/lib/functions.lib.php | 4 +++- htdocs/langs/en_US/other.lang | 26 +++++++++++------------ scripts/emailings/mailing-send.php | 3 ++- 8 files changed, 31 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40b4b40eb4a..9b5eef7aca5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,14 +13,16 @@ NEW: complete_head_from_modules() in ldap_prepare_head() WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* The methode "cloture" on contact were renamed into "closeAll". +* The methode "cloture" on contract were renamed into "closeAll". * The substitution key for reference of object is now __REF__ whatever is the object (it replaces __ORDERREF__, __PROPALREF__, ...) +* The substition key __SIGNATURE__ was renamed into __USER_SIGNATURE__ to standardize naming conventions. +* Substitution keys with syntax %XXX% were renamed into __XXX__ to match others. * Some REST API to access the dictionary (country, town, ...) were moved into a common API. * Page bank/index.php and bank/bankentries.php were renamed into bank/list.php and bank/bankentries_list.php to follow page naming conventions (so default filter/sort order features can also work). -* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed ORDER_SUPPLIER_STATUS_ORDERED -* The trigger ORDER_SUPPLIER_STATUS_RECEIVED_ALL was renamed ORDER_SUPPLIER_STATUS_RECEIVED_COMPLETELY +* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed into ORDER_SUPPLIER_STATUS_ORDERED +* The trigger ORDER_SUPPLIER_STATUS_RECEIVED_ALL was renamed into ORDER_SUPPLIER_STATUS_RECEIVED_COMPLETELY ***** ChangeLog for 6.0.2 compared to 6.0.1 ***** diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 961491cce2e..42fbd3903c0 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -50,7 +50,7 @@ $substitutionarrayfortest=array( '__ID__' => 'RecipientIdRecord', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails '__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'':'', -'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails +'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails '__LOGIN__' => 'RecipientLogin', '__LASTNAME__' => 'RecipientLastname', '__FIRSTNAME__' => 'RecipientFirstname', diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index b98661edab5..fc4b41bd6ab 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -51,7 +51,7 @@ $substitutionarrayfortest=array( '__EMAIL__' => 'TESTEMail', '__LASTNAME__' => 'TESTLastname', '__FIRSTNAME__' => 'TESTFirstname', -'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), +'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), //'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet ); complete_substitutions_array($substitutionarrayfortest, $langs); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 539f8bede92..c8338d22379 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -216,7 +216,8 @@ if (empty($reshook)) $substitutionarray['__OTHER3__'] = $other3; $substitutionarray['__OTHER4__'] = $other4; $substitutionarray['__OTHER5__'] = $other5; - $substitutionarray['__SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) + $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) + $substitutionarray['__SIGNATURE__'] = $signature; // For backward compatibility $substitutionarray['__CHECK_READ__'] = ''; $substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").''; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3ad460a8688..93d2244a6ec 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -858,9 +858,9 @@ class FormMail extends Form $defaultmessage=str_replace('\n',"\n",$defaultmessage); // Deal with format differences between message and signature (text / HTML) - if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) { - $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']); - } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) { + if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) { + $this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']); + } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) { $defaultmessage = dol_nl2br($defaultmessage); } @@ -1213,7 +1213,7 @@ class FormMail extends Form $tmparray['__OTHER3__'] = 'Other3'; $tmparray['__OTHER4__'] = 'Other4'; $tmparray['__OTHER5__'] = 'Other5'; - $tmparray['__SIGNATURE__'] = 'TagSignature'; + $tmparray['__USER_SIGNATURE__'] = 'TagSignature'; $tmparray['__CHECK_READ__'] = 'TagCheckMail'; $tmparray['__UNSUBSCRIBE__'] = 'TagUnsubscribe'; //,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c3c7913e2d4..6aafc6c2bbd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5511,7 +5511,9 @@ function make_substitutions($text, $substitutionarray, $outputlangs=null) // Make substitition for array $substitutionarray foreach ($substitutionarray as $key => $value) { - if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; + if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection + if ($key == '__USER_SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection + $text=str_replace("$key","$value",$text); // We must keep the " to work when value is 123.5 for example } diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index bbc8f34a92e..e1270533ae2 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -76,19 +76,19 @@ MaxSize=Maximum size AttachANewFile=Attach a new file/document LinkedObject=Linked object NbOfActiveNotifications=Number of notifications (nb of recipient emails) -PredefinedMailTest=This is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__ -PredefinedMailTestHtml=This is a test mail (the word test must be in bold).
        The two lines are separated by a carriage return.

        __SIGNATURE__ -PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nYou will find here the commercial proposal __PREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierProposal=__CONTACTCIVNAME__\n\nYou will find here the price request __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nYou will find here the order __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nYou will find here our order __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=__CONTACTCIVNAME__\n\nYou will find here the shipping __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=__CONTACTCIVNAME__\n\nYou will find here the intervention __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentThirdparty=\n\n__SIGNATURE__ -PredefinedMailContentUser=\n\n__SIGNATURE__ +PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__USER_SIGNATURE__ +PredefinedMailTestHtml=__(Hello)__\nThis is a test mail (the word test must be in bold).
        The two lines are separated by a carriage return.

        __USER_SIGNATURE__ +PredefinedMailContentSendInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendProposal=__(Hello)__\n\nYou will find here the commercial proposal __PREF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nYou will find here the price request __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendOrder=__(Hello)__\n\nYou will find here the order __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__(Hello)__\n\nYou will find here our order __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendShipping=__(Hello)__\n\nYou will find here the shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentSendFichInter=__(Hello)__\n\nYou will find here the intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ +PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available. ChooseYourDemoProfil=Choose the demo profile that best suits your needs... ChooseYourDemoProfilMore=...or build your own profile
        (manual module selection) diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 836f435890b..7daf0dace88 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -178,7 +178,8 @@ if ($resql) $substitutionarray['__OTHER3__'] = $other3; $substitutionarray['__OTHER4__'] = $other4; $substitutionarray['__OTHER5__'] = $other5; - $substitutionarray['__SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) + $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) + $substitutionarray['__SIGNATURE__'] = $signature; // For backward compatibility $substitutionarray['__CHECK_READ__'] = ''; $substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").''; From ec54621b6224e4d252ca107161626860f17fb55a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 11:08:30 +0200 Subject: [PATCH 1099/1137] FIX Tooltip using dialog are kept into visible screen --- htdocs/langs/en_US/mails.lang | 2 +- htdocs/main.inc.php | 5 +++-- htdocs/theme/eldy/style.css.php | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 0caae25c1d5..ccf52302e9a 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -115,7 +115,7 @@ DeliveryReceipt=Delivery Ack. YouCanUseCommaSeparatorForSeveralRecipients=You can use the comma separator to specify several recipients. TagCheckMail=Track mail opening TagUnsubscribe=Unsubscribe link -TagSignature=Signature sending user +TagSignature=Signature of sending user EMailRecipient=Recipient EMail TagMailtoEmail=Recipient EMail (including html "mailto:" link) NoEmailSentBadSenderOrRecipientEmail=No email sent. Bad sender or recipient email. Verify user profile. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6aadcb7cd0a..205f9677d82 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1971,13 +1971,14 @@ if (! function_exists("llxFooter")) print ''; - - -// Part to create -if ($action == 'create') -{ - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("EmailSenderProfile"))); - - print '
        '; - print ''; - print ''; - print ''; - - dol_fiche_head(array(), ''); - - print ''."\n"; - foreach($object->fields as $key => $val) - { - if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; - print ''; - print ''; - print $langs->trans($val['label']); - print ''; - print ''; - print ''; - } - - // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; - - print '
        '; - $defaultcss='minwidth100'; - if ($val['type'] == 'text') - { - print ''; - } - elseif (is_array($val['arrayofkeyval'])) - { - print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')); - } - else - { - $cssforinput = empty($val['css'])?$defaultcss:$val['css']; - print ''; - } - print '
        '."\n"; - - dol_fiche_end(); - - print '
        '; - print ''; - print '  '; - print ''; // Cancel for create doe not post form - print '
        '; - - print '
        '; -} - -// Part to edit record -if (($id || $ref) && $action == 'edit') -{ - print load_fiche_titre($langs->trans("EmailSenderProfile")); - - print '
        '; - print ''; - print ''; - print ''; - - dol_fiche_head(); - - print ''."\n"; - foreach($object->fields as $key => $val) - { - if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; - - print ''.$langs->trans($val['label']).''; - print ''; - print ''; - } - - // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; - - print '
        '; - $defaultcss='minwidth100'; - if ($val['type'] == 'text') - { - print ''; - } - elseif (is_array($val['arrayofkeyval'])) - { - print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key); - } - else - { - $cssforinput = empty($val['css'])?$defaultcss:$val['css']; - print ''; - } - print '
        '; - - dol_fiche_end(); - - print '
        '; - print '   '; - print '
        '; - - print '
        '; -} - -// Part to show record -if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) -{ - $res = $object->fetch_optionals($object->id, $extralabels); - - $head = emailsenderprofilePrepareHead($object); - dol_fiche_head($head, 'card', $langs->trans("EmailSenderProfile"), -1, 'emailsenderprofile@monmodule'); - - $formconfirm = ''; - - // Confirmation to delete - if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteEmailSenderProfile'), $langs->trans('ConfirmDeleteEmailSenderProfile'), 'confirm_delete', '', 0, 1); - } - - // Confirmation of action xxxx - if ($action == 'xxx') - { - $formquestion=array(); - /* - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); - }*/ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); - } - - if (! $formconfirm) { - $parameters = array('lineid' => $lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; - elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; - } - - // Print form confirm - print $formconfirm; - - - // Object card - // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; - - $morehtmlref='
        '; - /* - // Ref bis - $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->monmodule->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->monmodule->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
        '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
        '.$langs->trans('Project') . ' '; - if ($user->rights->monmodule->creer) - { - if ($action != 'classify') - { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
        '; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
        '; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - } - */ - $morehtmlref.='
        '; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - - print '
        '; - print '
        '; - print '
        '; - print ''."\n"; - - foreach($object->fields as $key => $val) - { - if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue; - - print ''.$langs->trans($val['label']).''; - print ''; - print ''; - - //if ($key == 'targetsrcfile3') break; // key used for break on second column - } - - print '
        '; - print dol_escape_htmltag($object->$key, 1, 1); - print '
        '; - print '
        '; - print '
        '; - print '
        '; - print '
        '; - print ''; - - $alreadyoutput = 1; - foreach($object->fields as $key => $val) - { - if ($alreadyoutput) - { - //if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column - continue; - } - - if (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue; - - print ''.$langs->trans($val['label']).''; - print ''; - print ''; - } - - // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - - print '
        '; - print dol_escape_htmltag($object->$key, 1, 1); - print '
        '; - print '
        '; - print '
        '; - print '
        '; - - print '

        '; - - dol_fiche_end(); - - - // Buttons for actions - if ($action != 'presend' && $action != 'editline') { - print '
        '."\n"; - $parameters=array(); - $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - if (empty($reshook)) - { - // Send - print ''."\n"; - - if ($user->rights->monmodule->write) - { - print ''."\n"; - } - - /* - if ($user->rights->sellyoursaas->create) - { - if ($object->status == 1) - { - print ''."\n"; - } - else - { - print ''."\n"; - } - } - */ - - if ($user->rights->monmodule->delete) - { - print ''."\n"; - } - } - print '
        '."\n"; - } - - - // Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } - - if ($action != 'presend') - { - print '
        '; - print ''; // ancre - // Documents - $comref = dol_sanitizeFileName($object->ref); - $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->monmodule->dir_output . '/' . $comref; - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->monmodule->creer; - $delallowed = $user->rights->monmodule->supprimer; - print $formfile->showdocuments('monmodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); - - - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('emailsenderprofile')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - - - print '
        '; - - $MAXEVENT = 10; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; - $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'emailsenderprofile', $socid, 1, '', $MAXEVENT); - - print '
        '; - } - - // Presend form - $modelmail='emailsenderprofile'; - $defaulttopic='Information'; - $diroutput = $conf->monmodule->dir_output; - $trackid = 'emailsenderprofile'.$object->id; - - include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; -} - - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 42fbd3903c0..ac06a302947 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -124,27 +124,7 @@ llxHeader('',$langs->trans("Setup"),$wikihelp); print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); - -$h = 0; - -$head[$h][0] = DOL_URL_ROOT."/admin/mails.php"; -$head[$h][1] = $langs->trans("OutGoingEmailSetup"); -$head[$h][2] = 'common'; -$h++; - -if ($conf->mailing->enabled) -{ - $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; - $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing"); - $head[$h][2] = 'common_emailing'; - $h++; -} - -$head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; -$head[$h][1] = $langs->trans("DictionaryEMailTemplates"); -$head[$h][2] = 'templates'; -$h++; - +$head = email_admin_prepare_head(); // List of sending methods $listofmethods=array(); diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index fc4b41bd6ab..1202e9817d3 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -114,27 +114,7 @@ llxHeader('',$langs->trans("Setup"),$wikihelp); print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); - -$h = 0; - -$head[$h][0] = DOL_URL_ROOT."/admin/mails.php"; -$head[$h][1] = $langs->trans("OutGoingEmailSetup"); -$head[$h][2] = 'common'; -$h++; - -if ($conf->mailing->enabled) -{ - $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; - $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing"); - $head[$h][2] = 'common_emailing'; - $h++; -} - -$head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php"; -$head[$h][1] = $langs->trans("DictionaryEMailTemplates"); -$head[$h][2] = 'templates'; -$h++; - +$head = email_admin_prepare_head(); // List of sending methods $listofmethods=array(); diff --git a/htdocs/admin/emailsenderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php similarity index 91% rename from htdocs/admin/emailsenderprofile_list.php rename to htdocs/admin/mails_senderprofile_list.php index dd2372443b3..91f0a3a8037 100644 --- a/htdocs/admin/emailsenderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- * * 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 @@ -17,9 +16,9 @@ */ /** - * \file emailsenderprofile_list.php - * \ingroup monmodule - * \brief List page for emailsenderprofile + * \file htdocs/admin/mails_senderprofile_list.php + * \ingroup core + * \brief Page to adminsiter email sender profiles */ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); @@ -37,30 +36,17 @@ //if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) -// Load Dolibarr environment -$res=0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include($_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"); -// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME -$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1; -while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; } -if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php"); -if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php"); -// Try main.inc.php using relative path -if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php"); -if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php"); -if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php"); -if (! $res) die("Include of main fails"); - +require '../main.inc.php'; require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -dol_include_once('/monmodule/class/emailsenderprofile.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; // Load traductions files requiredby by page -$langs->loadLangs(array("monmodule@monmodule","other")); +$langs->loadLangs(array("errors","admin","mails","languages")); -$action = GETPOST('action','alpha'); // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm','alpha'); // Result of a confirmation @@ -138,9 +124,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab /* - * ACTIONS - * - * Put here all code to do according to value of "$action" parameter + * Actions */ if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } @@ -174,18 +158,16 @@ if (empty($reshook)) // Mass actions $objectclass='EmailSenderProfile'; $objectlabel='EmailSenderProfile'; - $permtoread = $user->rights->monmodule->read; - $permtodelete = $user->rights->monmodule->delete; - $uploaddir = $conf->monmodule->dir_output; + $permtoread = $user->admin; + $permtodelete = $user->admin; + $uploaddir = $conf->admin->dir_output.'/senderprofiles'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } /* - * VIEW - * - * Put here all code to build page + * View */ $form=new Form($db); @@ -197,6 +179,18 @@ $help_url=''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("EmailSenderProfiles")); +llxHeader(); + +$titre=$langs->trans("EMailsSetup"); +$linkback=''; +$titlepicto='title_setup'; + +print load_fiche_titre($titre,$linkback,$titlepicto); + +$head = email_admin_prepare_head(); + +dol_fiche_head($head, 'senderprofiles', '', -1); + // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; @@ -211,7 +205,7 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/, $/','', $sql); -$sql.= " FROM ".MAIN_DB_PREFIX."emailsenderprofile as t"; +$sql.= " FROM ".MAIN_DB_PREFIX."c_email_senderprofile as t"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."emailsenderprofile_extrafields as ef on (t.rowid = ef.fk_object)"; $sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")"; foreach($search as $key => $val) @@ -285,11 +279,6 @@ if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && } -// Output page -// -------------------------------------------------------------------- - -llxHeader('', $title, $help_url); - // Example : Adding jquery code print ''; - } + } - $out.= "\n"; + $out.= "\n"; - return $out; - } - } + return $out; + } + } @@ -992,22 +992,22 @@ class FormMail extends Form { $defaultmessage=''; if ($type_template=='facture_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoice"); } - elseif ($type_template=='facture_relance') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } - elseif ($type_template=='propal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendProposal"); } - elseif ($type_template=='supplier_proposal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierProposal"); } - elseif ($type_template=='order_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendOrder"); } - elseif ($type_template=='order_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierOrder"); } - elseif ($type_template=='invoice_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } - elseif ($type_template=='shipping_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendShipping"); } - elseif ($type_template=='fichinter_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendFichInter"); } - elseif ($type_template=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); } - elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); } + elseif ($type_template=='facture_relance') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } + elseif ($type_template=='propal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendProposal"); } + elseif ($type_template=='supplier_proposal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierProposal"); } + elseif ($type_template=='order_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendOrder"); } + elseif ($type_template=='order_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierOrder"); } + elseif ($type_template=='invoice_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } + elseif ($type_template=='shipping_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendShipping"); } + elseif ($type_template=='fichinter_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendFichInter"); } + elseif ($type_template=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); } + elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); } - $ret['label']='default'; - $ret['lang']=$outputlangs->defaultlang; - $ret['topic']=''; - $ret['joinfiles']=1; - $ret['content']=$defaultmessage; + $ret['label']='default'; + $ret['lang']=$outputlangs->defaultlang; + $ret['topic']=''; + $ret['joinfiles']=1; + $ret['content']=$defaultmessage; $ret['content_lines']=''; } @@ -1130,41 +1130,41 @@ class FormMail extends Form $this->substit=$tmparray; - // Fill substit_lines with each object lines content - if (is_array($object->lines)) - { - foreach ($object->lines as $line) - { - $substit_line = array( - '__PRODUCT_REF__' => isset($line->product_ref) ? $line->product_ref : '', - '__PRODUCT_LABEL__' => isset($line->product_label) ? $line->product_label : '', - '__PRODUCT_DESCRIPTION__' => isset($line->product_desc) ? $line->product_desc : '', - '__LABEL__' => isset($line->label) ? $line->label : '', - '__DESCRIPTION__' => isset($line->desc) ? $line->desc : '', - '__DATE_START_YMD__' => dol_print_date($line->date_start, 'day', 0, $outputlangs), - '__DATE_END_YMD__' => dol_print_date($line->date_end, 'day', 0, $outputlangs), - '__QUANTITY__' => $line->qty, - '__SUBPRICE__' => price($line->subprice), - '__AMOUNT__' => price($line->total_ttc), - '__AMOUNT_EXCL_TAX__' => price($line->total_ht), - //'__PRODUCT_EXTRAFIELD_FIELD__' Done dinamically just after - ); + // Fill substit_lines with each object lines content + if (is_array($object->lines)) + { + foreach ($object->lines as $line) + { + $substit_line = array( + '__PRODUCT_REF__' => isset($line->product_ref) ? $line->product_ref : '', + '__PRODUCT_LABEL__' => isset($line->product_label) ? $line->product_label : '', + '__PRODUCT_DESCRIPTION__' => isset($line->product_desc) ? $line->product_desc : '', + '__LABEL__' => isset($line->label) ? $line->label : '', + '__DESCRIPTION__' => isset($line->desc) ? $line->desc : '', + '__DATE_START_YMD__' => dol_print_date($line->date_start, 'day', 0, $outputlangs), + '__DATE_END_YMD__' => dol_print_date($line->date_end, 'day', 0, $outputlangs), + '__QUANTITY__' => $line->qty, + '__SUBPRICE__' => price($line->subprice), + '__AMOUNT__' => price($line->total_ttc), + '__AMOUNT_EXCL_TAX__' => price($line->total_ht), + //'__PRODUCT_EXTRAFIELD_FIELD__' Done dinamically just after + ); - // Create dynamic tags for __PRODUCT_EXTRAFIELD_FIELD__ - if (!empty($line->fk_product)) - { - $extrafields = new ExtraFields($this->db); - $extralabels = $extrafields->fetch_name_optionals_label('product', true); - $product = new Product($this->db); - $product->fetch($line->fk_product, '', '', 1); - $product->fetch_optionals($product->id, $extralabels); - foreach ($extrafields->attribute_label as $key => $label) { - $substit_line['__PRODUCT_EXTRAFIELD_' . strtoupper($key) . '__'] = $product->array_options['options_' . $key]; - } - } - $this->substit_lines[] = $substit_line; - } - } + // Create dynamic tags for __PRODUCT_EXTRAFIELD_FIELD__ + if (!empty($line->fk_product)) + { + $extrafields = new ExtraFields($this->db); + $extralabels = $extrafields->fetch_name_optionals_label('product', true); + $product = new Product($this->db); + $product->fetch($line->fk_product, '', '', 1); + $product->fetch_optionals($product->id, $extralabels); + foreach ($extrafields->attribute_label as $key => $label) { + $substit_line['__PRODUCT_EXTRAFIELD_' . strtoupper($key) . '__'] = $product->array_options['options_' . $key]; + } + } + $this->substit_lines[] = $substit_line; + } + } } /** @@ -1188,11 +1188,11 @@ class FormMail extends Form if ($mode == 'formwithlines') { - $tmparray['__LINES__'] = '__LINES__'; // Will be set by the get_form function + $tmparray['__LINES__'] = '__LINES__'; // Will be set by the get_form function } if ($mode == 'formforlines') { - $tmparray['__QUANTITY__'] = '__QUANTITY__'; // Will be set by the get_form function + $tmparray['__QUANTITY__'] = '__QUANTITY__'; // Will be set by the get_form function } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6aafc6c2bbd..f56cd2f523d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -275,17 +275,17 @@ function GETPOSTISSET($paramname) */ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=NULL) { - global $mysoc,$user,$conf; + global $mysoc,$user,$conf; - if (empty($paramname)) return 'BadFirstParameterForGETPOST'; - if (empty($check)) - { - dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING); - // Enable this line to know who call the GETPOST with '' $check parameter. - //var_dump(debug_backtrace()[0]); - } + if (empty($paramname)) return 'BadFirstParameterForGETPOST'; + if (empty($check)) + { + dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING); + // Enable this line to know who call the GETPOST with '' $check parameter. + //var_dump(debug_backtrace()[0]); + } - if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); + if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:''; elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:''); @@ -295,38 +295,38 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N if (empty($method) || $method == 3 || $method == 4) { - $relativepathstring = $_SERVER["PHP_SELF"]; - // Clean $relativepathstring - if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); - $relativepathstring = preg_replace('/^\//', '', $relativepathstring); - $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); + $relativepathstring = $_SERVER["PHP_SELF"]; + // Clean $relativepathstring + if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); + $relativepathstring = preg_replace('/^\//', '', $relativepathstring); + $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); //var_dump($relativepathstring); //var_dump($user->default_values); - // Code for search criteria persistence. - // Retrieve values if restore_lastsearch_values is set and there is saved values - if (! empty($_GET['restore_lastsearch_values']) && ! empty($_SESSION['lastsearch_values_'.$relativepathstring])) // Keep $_GET here - { - $tmp=json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true); - if (is_array($tmp)) - { - foreach($tmp as $key => $val) - { - if ($key == $paramname) - { - $out=$val; - break; - } - } - } - } - // Else, retreive default values if we are not doing a sort - elseif (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_ENABLE_DEFAULT_VALUES is not set - { - if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) - { - if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values' - { + // Code for search criteria persistence. + // Retrieve values if restore_lastsearch_values is set and there is saved values + if (! empty($_GET['restore_lastsearch_values']) && ! empty($_SESSION['lastsearch_values_'.$relativepathstring])) // Keep $_GET here + { + $tmp=json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true); + if (is_array($tmp)) + { + foreach($tmp as $key => $val) + { + if ($key == $paramname) + { + $out=$val; + break; + } + } + } + } + // Else, retreive default values if we are not doing a sort + elseif (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_ENABLE_DEFAULT_VALUES is not set + { + if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + { + if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values' + { if (isset($user->default_values[$relativepathstring]['createform'])) { foreach($user->default_values[$relativepathstring]['createform'] as $defkey => $defval) @@ -348,107 +348,107 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N if ($qualified) { - //var_dump($user->default_values[$relativepathstring][$defkey]['createform']); - if (isset($user->default_values[$relativepathstring]['createform'][$defkey][$paramname])) - { - $out = $user->default_values[$relativepathstring]['createform'][$defkey][$paramname]; - break; - } + //var_dump($user->default_values[$relativepathstring][$defkey]['createform']); + if (isset($user->default_values[$relativepathstring]['createform'][$defkey][$paramname])) + { + $out = $user->default_values[$relativepathstring]['createform'][$defkey][$paramname]; + break; + } } } } } - } - // Management of default search_filters and sort order - //elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) - elseif (! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) - { - if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values' - { - //var_dump($user->default_values[$relativepathstring]); - if ($paramname == 'sortfield' || $paramname == 'sortorder') // Sorted on which fields ? ASC or DESC ? - { - if (isset($user->default_values[$relativepathstring]['sortorder'])) // Even if paramname is sortfield, data are stored into ['sortorder...'] - { - foreach($user->default_values[$relativepathstring]['sortorder'] as $defkey => $defval) - { - $qualified = 0; - if ($defkey != '_noquery_') - { - $tmpqueryarraytohave=explode('&', $defkey); - $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); - $foundintru=0; - foreach($tmpqueryarraytohave as $tmpquerytohave) - { - if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; - } - if (! $foundintru) $qualified=1; - //var_dump($defkey.'-'.$qualified); - } - else $qualified = 1; + } + // Management of default search_filters and sort order + //elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + elseif (! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + { + if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values' + { + //var_dump($user->default_values[$relativepathstring]); + if ($paramname == 'sortfield' || $paramname == 'sortorder') // Sorted on which fields ? ASC or DESC ? + { + if (isset($user->default_values[$relativepathstring]['sortorder'])) // Even if paramname is sortfield, data are stored into ['sortorder...'] + { + foreach($user->default_values[$relativepathstring]['sortorder'] as $defkey => $defval) + { + $qualified = 0; + if ($defkey != '_noquery_') + { + $tmpqueryarraytohave=explode('&', $defkey); + $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); + $foundintru=0; + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; + } + if (! $foundintru) $qualified=1; + //var_dump($defkey.'-'.$qualified); + } + else $qualified = 1; - if ($qualified) - { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - foreach($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val) - { - if ($out) $out.=', '; - if ($paramname == 'sortfield') - { - $out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace); - } - if ($paramname == 'sortorder') - { - $out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace); - } - } - //break; // No break for sortfield and sortorder so we can cumulate fields (is it realy usefull ?) - } - } + if ($qualified) + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + foreach($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val) + { + if ($out) $out.=', '; + if ($paramname == 'sortfield') + { + $out.=dol_string_nospecial($key, '', $forbidden_chars_to_replace); + } + if ($paramname == 'sortorder') + { + $out.=dol_string_nospecial($val, '', $forbidden_chars_to_replace); + } + } + //break; // No break for sortfield and sortorder so we can cumulate fields (is it realy usefull ?) + } + } } - } - elseif (isset($user->default_values[$relativepathstring]['filters'])) - { - foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval) - { - $qualified = 0; - if ($defkey != '_noquery_') - { - $tmpqueryarraytohave=explode('&', $defkey); - $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); - $foundintru=0; - foreach($tmpqueryarraytohave as $tmpquerytohave) - { - if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; - } - if (! $foundintru) $qualified=1; - //var_dump($defkey.'-'.$qualified); - } - else $qualified = 1; + } + elseif (isset($user->default_values[$relativepathstring]['filters'])) + { + foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval) + { + $qualified = 0; + if ($defkey != '_noquery_') + { + $tmpqueryarraytohave=explode('&', $defkey); + $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); + $foundintru=0; + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; + } + if (! $foundintru) $qualified=1; + //var_dump($defkey.'-'.$qualified); + } + else $qualified = 1; if ($qualified) { - if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) - { - // We made a search from quick search menu, do we still use default filter ? - if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) - { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); - } - } - else - { - $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , - $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); - } - break; + if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) + { + // We made a search from quick search menu, do we still use default filter ? + if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); + } + } + else + { + $forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",";","="); // we accept _, -, . and , + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace); + } + break; } - } - } - } - } - } + } + } + } + } + } } @@ -457,110 +457,110 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. if (! is_array($out) && empty($_POST[$paramname])) { - $maxloop=20; $loopnb=0; // Protection against infinite loop - while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. - { - $loopnb++; $newout = ''; + $maxloop=20; $loopnb=0; // Protection against infinite loop + while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. + { + $loopnb++; $newout = ''; - if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; } - elseif ($reg[1] == 'MONTH') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mon']; } - elseif ($reg[1] == 'YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['year']; } - elseif ($reg[1] == 'PREVIOUS_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; } - elseif ($reg[1] == 'PREVIOUS_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_month($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['month']; } - elseif ($reg[1] == 'PREVIOUS_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] - 1); } - elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; } - elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['month']; } - elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); } - elseif ($reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID') - { - $newout = $mysoc->country_id; - } - elseif ($reg[1] == 'USER_ID' || $reg[1] == 'USERID') - { - $newout = $user->id; - } - elseif ($reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID') - { - $newout = $user->fk_user; - } - elseif ($reg[1] == 'ENTITYID') - { - $newout = $conf->entity; - } - else $newout = ''; // Key not found, we replace with empty string - //var_dump('__'.$reg[1].'__ -> '.$newout); - $out = preg_replace('/__'.preg_quote($reg[1],'/').'__/', $newout, $out); - } + if ($reg[1] == 'DAY') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mday']; } + elseif ($reg[1] == 'MONTH') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['mon']; } + elseif ($reg[1] == 'YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = $tmp['year']; } + elseif ($reg[1] == 'PREVIOUS_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; } + elseif ($reg[1] == 'PREVIOUS_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_prev_month($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['month']; } + elseif ($reg[1] == 'PREVIOUS_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] - 1); } + elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; } + elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['month']; } + elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); } + elseif ($reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID') + { + $newout = $mysoc->country_id; + } + elseif ($reg[1] == 'USER_ID' || $reg[1] == 'USERID') + { + $newout = $user->id; + } + elseif ($reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID') + { + $newout = $user->fk_user; + } + elseif ($reg[1] == 'ENTITYID') + { + $newout = $conf->entity; + } + else $newout = ''; // Key not found, we replace with empty string + //var_dump('__'.$reg[1].'__ -> '.$newout); + $out = preg_replace('/__'.preg_quote($reg[1],'/').'__/', $newout, $out); + } } - // Check is done after replacement - switch ($check) - { - case 'none': - break; - case 'int': // Check param is a numeric value (integer but also float or hexadecimal) - if (! is_numeric($out)) { $out=''; } - break; - case 'intcomma': - if (preg_match('/[^0-9,]+/i',$out)) $out=''; - break; - case 'alpha': - $out=trim($out); - // '"' is dangerous because param in url can close the href= or src= and add javascript functions. - // '../' is dangerous because it allows dir transversals - if (preg_match('/"/',$out)) $out=''; - else if (preg_match('/\.\.\//',$out)) $out=''; - break; - case 'san_alpha': - $out=filter_var($out,FILTER_SANITIZE_STRING); - break; - case 'aZ': - $out=trim($out); - if (preg_match('/[^a-z]+/i',$out)) $out=''; - break; - case 'aZ09': - $out=trim($out); - if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out=''; - break; - case 'array': - if (! is_array($out) || empty($out)) $out=array(); - break; + // Check is done after replacement + switch ($check) + { + case 'none': + break; + case 'int': // Check param is a numeric value (integer but also float or hexadecimal) + if (! is_numeric($out)) { $out=''; } + break; + case 'intcomma': + if (preg_match('/[^0-9,]+/i',$out)) $out=''; + break; + case 'alpha': + $out=trim($out); + // '"' is dangerous because param in url can close the href= or src= and add javascript functions. + // '../' is dangerous because it allows dir transversals + if (preg_match('/"/',$out)) $out=''; + else if (preg_match('/\.\.\//',$out)) $out=''; + break; + case 'san_alpha': + $out=filter_var($out,FILTER_SANITIZE_STRING); + break; + case 'aZ': + $out=trim($out); + if (preg_match('/[^a-z]+/i',$out)) $out=''; + break; + case 'aZ09': + $out=trim($out); + if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out=''; + break; + case 'array': + if (! is_array($out) || empty($out)) $out=array(); + break; case 'nohtml': - $out=dol_string_nohtmltag($out); + $out=dol_string_nohtmltag($out); break; case 'alphanohtml': // Recommended for search params - $out=trim($out); - // '"' is dangerous because param in url can close the href= or src= and add javascript functions. - // '../' is dangerous because it allows dir transversals - if (preg_match('/"/',$out)) $out=''; - else if (preg_match('/\.\.\//',$out)) $out=''; - $out=dol_string_nohtmltag($out); + $out=trim($out); + // '"' is dangerous because param in url can close the href= or src= and add javascript functions. + // '../' is dangerous because it allows dir transversals + if (preg_match('/"/',$out)) $out=''; + else if (preg_match('/\.\.\//',$out)) $out=''; + $out=dol_string_nohtmltag($out); break; case 'custom': - if (empty($filter)) return 'BadFourthParameterForGETPOST'; - $out=filter_var($out, $filter, $options); - break; - } + if (empty($filter)) return 'BadFourthParameterForGETPOST'; + $out=filter_var($out, $filter, $options); + break; + } - // Code for search criteria persistence. + // Code for search criteria persistence. // Save data into session if key start with 'search_' or is 'smonth', 'syear', 'month', 'year' if (empty($method) || $method == 3 || $method == 4) { - //if (preg_match('/^search_/', $paramname) || in_array($paramname, array('sortorder', 'sortfield", 'smonth', 'syear', 'month', 'year'))) - if (preg_match('/^search_/', $paramname) || in_array($paramname, array('sortorder','sortfield'))) - { - //var_dump($paramname.' - '.$out.' '.$user->default_values[$relativepathstring]['filters'][$paramname]); + //if (preg_match('/^search_/', $paramname) || in_array($paramname, array('sortorder', 'sortfield", 'smonth', 'syear', 'month', 'year'))) + if (preg_match('/^search_/', $paramname) || in_array($paramname, array('sortorder','sortfield'))) + { + //var_dump($paramname.' - '.$out.' '.$user->default_values[$relativepathstring]['filters'][$paramname]); - // We save search key only if: - // - not empty, or - // - if value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not). + // We save search key only if: + // - not empty, or + // - if value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not). - //if (! empty($out) || ! empty($user->default_values[$relativepathstring]['filters'][$paramname])) - if (! empty($out)) - { - $user->lastsearch_values_tmp[$relativepathstring][$paramname]=$out; - } - } + //if (! empty($out) || ! empty($user->default_values[$relativepathstring]['filters'][$paramname])) + if (! empty($out)) + { + $user->lastsearch_values_tmp[$relativepathstring][$paramname]=$out; + } + } } return $out; @@ -577,14 +577,14 @@ function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=N */ function dol_getprefix($mode='') { - global $conf; + global $conf; - // If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email - if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) - { - if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID; - else if (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"]; - } + // If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email + if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) + { + if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID; + else if (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"]; + } if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) { @@ -670,18 +670,18 @@ function dol_buildpath($path, $type=0, $returnemptyifnotfound=0) { if ($key == 'main') { - if ($type == 3) - { - global $dolibarr_main_url_root; + if ($type == 3) + { + global $dolibarr_main_url_root; - // Define $urlwithroot - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).'/'.$path; // Test on start with http is for old conf syntax - } - continue; + $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).'/'.$path; // Test on start with http is for old conf syntax + } + continue; } preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i',$path,$regs); // Take part before '?' if (! empty($regs[1])) @@ -695,18 +695,18 @@ function dol_buildpath($path, $type=0, $returnemptyifnotfound=0) } if ($type == 2) { - $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path; + $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path; } if ($type == 3) { - global $dolibarr_main_url_root; + global $dolibarr_main_url_root; - // Define $urlwithroot - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax + $res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path; // Test on start with http is for old conf syntax } break; } @@ -789,8 +789,8 @@ function dol_sanitizeFileName($str,$newstr='_',$unaccent=1) */ function dol_sanitizePathName($str,$newstr='_',$unaccent=1) { - $filesystem_forbidden_chars = array('<','>','?','*','|','"','°'); - return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars); + $filesystem_forbidden_chars = array('<','>','?','*','|','"','°'); + return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars); } /** @@ -974,54 +974,54 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename=' if (! empty($message)) { - // Test log level - $logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG); - if (!in_array($level, $logLevels, true)) - { - throw new Exception('Incorrect log level'); - } - if ($level > $conf->global->SYSLOG_LEVEL) return; + // Test log level + $logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG); + if (!in_array($level, $logLevels, true)) + { + throw new Exception('Incorrect log level'); + } + if ($level > $conf->global->SYSLOG_LEVEL) return; - // If adding log inside HTML page is required - if (! empty($_REQUEST['logtohtml']) && (! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || ! empty($conf->global->MAIN_LOGTOHTML))) // MAIN_LOGTOHTML kept for backward compatibility - { - $conf->logbuffer[] = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".$message; - } + // If adding log inside HTML page is required + if (! empty($_REQUEST['logtohtml']) && (! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || ! empty($conf->global->MAIN_LOGTOHTML))) // MAIN_LOGTOHTML kept for backward compatibility + { + $conf->logbuffer[] = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".$message; + } - //TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output - // If enable html log tag enabled and url parameter log defined, we show output log on HTML comments - if (! empty($conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && ! empty($_GET["log"])) - { - print "\n\n\n"; - } + //TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output + // If enable html log tag enabled and url parameter log defined, we show output log on HTML comments + if (! empty($conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && ! empty($_GET["log"])) + { + print "\n\n\n"; + } - $data = array( - 'message' => $message, - 'script' => (isset($_SERVER['PHP_SELF'])? basename($_SERVER['PHP_SELF'],'.php') : false), - 'level' => $level, - 'user' => ((is_object($user) && $user->id) ? $user->login : false), - 'ip' => false - ); + $data = array( + 'message' => $message, + 'script' => (isset($_SERVER['PHP_SELF'])? basename($_SERVER['PHP_SELF'],'.php') : false), + 'level' => $level, + 'user' => ((is_object($user) && $user->id) ? $user->login : false), + 'ip' => false + ); - // This is when server run behind a reverse proxy - if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].(empty($_SERVER["REMOTE_ADDR"])?'':'->'.$_SERVER['REMOTE_ADDR']); - // This is when server run normally on a server - else if (! empty($_SERVER["REMOTE_ADDR"])) $data['ip'] = $_SERVER['REMOTE_ADDR']; - // This is when PHP session is ran inside a web server but not inside a client request (example: init code of apache) - else if (! empty($_SERVER['SERVER_ADDR'])) $data['ip'] = $_SERVER['SERVER_ADDR']; - // This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it). - else if (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']); - // This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it). - else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME']; - // Loop on each log handler and send output - foreach ($conf->loghandlers as $loghandlerinstance) - { - if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler) continue; - $loghandlerinstance->export($data,$suffixinfilename); - } - unset($data); + // This is when server run behind a reverse proxy + if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].(empty($_SERVER["REMOTE_ADDR"])?'':'->'.$_SERVER['REMOTE_ADDR']); + // This is when server run normally on a server + else if (! empty($_SERVER["REMOTE_ADDR"])) $data['ip'] = $_SERVER['REMOTE_ADDR']; + // This is when PHP session is ran inside a web server but not inside a client request (example: init code of apache) + else if (! empty($_SERVER['SERVER_ADDR'])) $data['ip'] = $_SERVER['SERVER_ADDR']; + // This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it). + else if (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']); + // This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it). + else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME']; + // Loop on each log handler and send output + foreach ($conf->loghandlers as $loghandlerinstance) + { + if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler) continue; + $loghandlerinstance->export($data,$suffixinfilename); + } + unset($data); } if (! empty($ident)) @@ -1099,7 +1099,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD); $displaytab=0; $nbintab=0; - $popuptab=0; $outmore=''; + $popuptab=0; $outmore=''; for ($i = 0 ; $i <= $maxkey ; $i++) { if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) @@ -1150,13 +1150,13 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi } else { - // The popup with the other tabs + // The popup with the other tabs if (! $popuptab) { - $popuptab=1; - $outmore.='
        '; + $popuptab=1; + $outmore.='
        '; } - $outmore.='
        '; + $outmore.='
        '; if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) @@ -1266,26 +1266,26 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if (class_exists("Imagick")) { - if ($object->element == 'propal') $modulepart='propal'; + if ($object->element == 'propal') $modulepart='propal'; if ($object->element == 'commande') $modulepart='commande'; if ($object->element == 'facture') $modulepart='facture'; if ($object->element == 'fichinter') $modulepart='ficheinter'; if ($object->element == 'contrat') $modulepart='contract'; - if ($object->element == 'supplier_proposal') $modulepart='supplier_proposal'; + if ($object->element == 'supplier_proposal') $modulepart='supplier_proposal'; if ($object->element == 'order_supplier') $modulepart='supplier_order'; - if ($object->element == 'invoice_supplier') $modulepart='supplier_invoice'; + if ($object->element == 'invoice_supplier') $modulepart='supplier_invoice'; if ($object->element == 'expensereport') $modulepart='expensereport'; } if ($object->element == 'product') { - $width=80; $cssclass='photoref'; - $showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]); - $maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5); + $width=80; $cssclass='photoref'; + $showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]); + $maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5); if ($conf->browser->phone) $maxvisiblephotos=1; if ($showimage) $morehtmlleft.='
        '.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'
        '; - else - { + else + { if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) { $nophoto=''; $morehtmlleft.='
        '; @@ -1294,153 +1294,153 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $nophoto='/public/theme/common/nophoto.png'; $morehtmlleft.='
        No photo
        '; //} - } + } } else { if ($showimage) - { - if ($modulepart != 'unknown') - { - $phototoshow=''; - // Check if a preview file is available - if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice', 'expensereport')) && class_exists("Imagick")) - { - $objectref = dol_sanitizeFileName($object->ref); - $dir_output = $conf->$modulepart->dir_output . "/"; - if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice'))) - { - $subdir = get_exdir($object->id, 2, 0, 0, $object, $modulepart).$objectref; - } - else - { - $subdir = get_exdir($object->id, 0, 0, 0, $object, $modulepart).$objectref; - } - $filepath = $dir_output . $subdir . "/"; - $file = $filepath . $objectref . ".pdf"; - $relativepath = $subdir.'/'.$objectref.'.pdf'; + { + if ($modulepart != 'unknown') + { + $phototoshow=''; + // Check if a preview file is available + if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice', 'expensereport')) && class_exists("Imagick")) + { + $objectref = dol_sanitizeFileName($object->ref); + $dir_output = $conf->$modulepart->dir_output . "/"; + if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice'))) + { + $subdir = get_exdir($object->id, 2, 0, 0, $object, $modulepart).$objectref; + } + else + { + $subdir = get_exdir($object->id, 0, 0, 0, $object, $modulepart).$objectref; + } + $filepath = $dir_output . $subdir . "/"; + $file = $filepath . $objectref . ".pdf"; + $relativepath = $subdir.'/'.$objectref.'.pdf'; - // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") - $fileimage = $file.'_preview.png'; // If PDF has 1 page - $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page - $relativepathimage = $relativepath.'_preview.png'; + // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") + $fileimage = $file.'_preview.png'; // If PDF has 1 page + $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page + $relativepathimage = $relativepath.'_preview.png'; - // Si fichier PDF existe - if (file_exists($file)) - { - $encfile = urlencode($file); - // Conversion du PDF en image png si fichier png non existant - if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) - && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) - ) - { - if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. - { - $ret = dol_convert_file($file, 'png', $fileimage); - if ($ret < 0) $error++; - } - } + // Si fichier PDF existe + if (file_exists($file)) + { + $encfile = urlencode($file); + // Conversion du PDF en image png si fichier png non existant + if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) + && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) + ) + { + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. + { + $ret = dol_convert_file($file, 'png', $fileimage); + if ($ret < 0) $error++; + } + } - $heightforphotref=70; - if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60; - // Si fichier png PDF d'1 page trouve - if (file_exists($fileimage)) - { - $phototoshow = '
        '; - $phototoshow.= ''; - $phototoshow.= '
        '; - } - // Si fichier png PDF de plus d'1 page trouve - elseif (file_exists($fileimagebis)) - { - $preview = preg_replace('/\.png/','',$relativepathimage) . "-0.png"; - $phototoshow = '
        '; - $phototoshow.= '

        '; - $phototoshow.= '

        '; - } - } - } - else if (! $phototoshow) - { - $phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos); - } + $heightforphotref=70; + if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60; + // Si fichier png PDF d'1 page trouve + if (file_exists($fileimage)) + { + $phototoshow = '
        '; + $phototoshow.= ''; + $phototoshow.= '
        '; + } + // Si fichier png PDF de plus d'1 page trouve + elseif (file_exists($fileimagebis)) + { + $preview = preg_replace('/\.png/','',$relativepathimage) . "-0.png"; + $phototoshow = '
        '; + $phototoshow.= '

        '; + $phototoshow.= '

        '; + } + } + } + else if (! $phototoshow) + { + $phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos); + } - if ($phototoshow) - { - $morehtmlleft.='
        '; - $morehtmlleft.=$phototoshow; - $morehtmlleft.='
        '; - } - } + if ($phototoshow) + { + $morehtmlleft.='
        '; + $morehtmlleft.=$phototoshow; + $morehtmlleft.='
        '; + } + } - if (! $phototoshow) // Show No photo link (picto of pbject) - { - $morehtmlleft.='
        '; - if ($object->element == 'action') - { - $width=80; - $cssclass='photorefcenter'; - $nophoto=img_picto('', 'title_agenda', '', false, 1); - } - else - { - $width=14; $cssclass='photorefcenter'; - $picto = $object->picto; - if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub - $nophoto=img_picto('', 'object_'.$picto, '', false, 1); - } - $morehtmlleft.=''; - $morehtmlleft.='
        No photo
        '; + if (! $phototoshow) // Show No photo link (picto of pbject) + { + $morehtmlleft.='
        '; + if ($object->element == 'action') + { + $width=80; + $cssclass='photorefcenter'; + $nophoto=img_picto('', 'title_agenda', '', false, 1); + } + else + { + $width=14; $cssclass='photorefcenter'; + $picto = $object->picto; + if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub + $nophoto=img_picto('', 'object_'.$picto, '', false, 1); + } + $morehtmlleft.=''; + $morehtmlleft.='
        No photo
        '; - $morehtmlleft.='
        '; - } - } + $morehtmlleft.='
        '; + } + } } if ($showbarcode) $morehtmlleft.='
        '.$form->showbarcode($object).'
        '; if ($object->element == 'societe') { - if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) - { - $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); - } + if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) + { + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + } } elseif ($object->element == 'product') { - //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); - } else { - $morehtmlstatus.=''.$object->getLibStatut(5,0).''; - } - $morehtmlstatus.='   '; - //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') '; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - $morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); - } else { - $morehtmlstatus.=''.$object->getLibStatut(5,1).''; - } + //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Sell").') '; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + $morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + } else { + $morehtmlstatus.=''.$object->getLibStatut(5,0).''; + } + $morehtmlstatus.='   '; + //$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') '; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + $morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + } else { + $morehtmlstatus.=''.$object->getLibStatut(5,1).''; + } } elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan'))) { - $tmptxt=$object->getLibStatut(6, $object->totalpaye); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); + $tmptxt=$object->getLibStatut(6, $object->totalpaye); + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); $morehtmlstatus.=$tmptxt; } elseif ($object->element == 'contrat' || $object->element == 'contract') { - if ($object->statut==0) $morehtmlstatus.=$object->getLibStatut(2); - else $morehtmlstatus.=$object->getLibStatut(4); + if ($object->statut==0) $morehtmlstatus.=$object->getLibStatut(2); + else $morehtmlstatus.=$object->getLibStatut(4); } elseif ($object->element == 'facturerec') { - if ($object->frequency==0) $morehtmlstatus.=$object->getLibStatut(2); - else $morehtmlstatus.=$object->getLibStatut(4); + if ($object->frequency==0) $morehtmlstatus.=$object->getLibStatut(2); + else $morehtmlstatus.=$object->getLibStatut(4); } else { // Generic case - $tmptxt=$object->getLibStatut(6); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); + $tmptxt=$object->getLibStatut(6); + if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); $morehtmlstatus.=$tmptxt; } if (! empty($object->name_alias)) $morehtmlref.='
        '.$object->name_alias.'
        '; // For thirdparty @@ -1453,9 +1453,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories') { - $morehtmlref.='
        '; - $morehtmlref.=$object->getBannerAddress('refaddress',$object); - $morehtmlref.='
        '; + $morehtmlref.='
        '; + $morehtmlref.=$object->getBannerAddress('refaddress',$object); + $morehtmlref.='
        '; } if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product'))) { @@ -1714,7 +1714,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e { // Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs. $month=adodb_strftime('%m', $time+$offsettz+$offsetdst); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. - $month=sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'. + $month=sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'. if ($encodetooutput) { $monthtext=$outputlangs->transnoentities('Month'.$month); @@ -1898,7 +1898,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) */ function dol_now($mode='gmt') { - $ret=''; + $ret=''; // Note that gmmktime and mktime return same value (GMT) when used without parameters //if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead if ($mode == 'gmt') $ret=time(); // Time for now at greenwich. @@ -2141,9 +2141,9 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep if (strtoupper($countrycode) == "CA") { - if (dol_strlen($phone) == 10) { - $newphone=($separ!=''?'(':'').substr($newphone,0,3).($separ!=''?')':'').$separ.substr($newphone,3,3).($separ!=''?'-':'').substr($newphone,6,4); - } + if (dol_strlen($phone) == 10) { + $newphone=($separ!=''?'(':'').substr($newphone,0,3).($separ!=''?')':'').$separ.substr($newphone,3,3).($separ!=''?'-':'').substr($newphone,6,4); + } } if (! empty($addlink)) // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) @@ -2299,37 +2299,37 @@ function dol_print_address($address, $htmlid, $mode, $id, $noprint=0, $charfornl if ($address) { - if ($hookmanager) { - $parameters = array('element' => $mode, 'id' => $id); - $reshook = $hookmanager->executeHooks('printAddress', $parameters, $address); - $out.=$hookmanager->resPrint; - } - if (empty($reshook)) - { - if (empty($charfornl)) $out.=nl2br($address); - else $out.=preg_replace('/[\r\n]+/', $charfornl, $address); + if ($hookmanager) { + $parameters = array('element' => $mode, 'id' => $id); + $reshook = $hookmanager->executeHooks('printAddress', $parameters, $address); + $out.=$hookmanager->resPrint; + } + if (empty($reshook)) + { + if (empty($charfornl)) $out.=nl2br($address); + else $out.=preg_replace('/[\r\n]+/', $charfornl, $address); - $showgmap=$showomap=0; + $showgmap=$showomap=0; - // TODO Add a hook here - if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; - if ($mode=='contact' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) $showgmap=1; - if ($mode=='member' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) $showgmap=1; - if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) $showomap=1; - if ($mode=='contact' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) $showomap=1; - if ($mode=='member' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) $showomap=1; + // TODO Add a hook here + if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; + if ($mode=='contact' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) $showgmap=1; + if ($mode=='member' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) $showgmap=1; + if (($mode=='thirdparty' || $mode =='societe') && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) $showomap=1; + if ($mode=='contact' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) $showomap=1; + if ($mode=='member' && ! empty($conf->openstreetmap->enabled) && ! empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) $showomap=1; - if ($showgmap) - { - $url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1); - $out.=' '; - } - if ($showomap) - { - $url=dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id,1); - $out.=' '; - } - } + if ($showgmap) + { + $url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1); + $out.=' '; + } + if ($showomap) + { + $url=dol_buildpath('/openstreetmap/maps.php?mode='.$mode.'&id='.$id,1); + $out.=' '; + } + } } if ($noprint) return $out; else print $out; @@ -2432,9 +2432,9 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie', if ($shownographyet) { - print '
        '; - print '
        '.$langs->trans("NotEnoughDataYet").'
        '; - return; + print '
        '; + print '
        '.$langs->trans("NotEnoughDataYet").'
        '; + return; } if (empty($conf->use_javascript_ajax)) return; @@ -2928,9 +2928,9 @@ function img_delete($titlealt = 'default', $other = 'class="pictodelete"') */ function img_printer($titlealt = "default", $other='') { - global $conf,$langs; - if ($titlealt=="default") $titlealt=$langs->trans("Print"); - return img_picto($titlealt,'printer.png',$other); + global $conf,$langs; + if ($titlealt=="default") $titlealt=$langs->trans("Print"); + return img_picto($titlealt,'printer.png',$other); } /** @@ -3021,7 +3021,7 @@ function img_error($titlealt = 'default') * * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"') - * @return string Return img tag + * @return string Return img tag */ function img_next($titlealt = 'default', $moreatt='') { @@ -3320,8 +3320,8 @@ function dol_print_error($db='',$error='',$errors=null) } else // Mode CLI { - // No dol_escape_htmltag for output, we are in CLI mode - $out.='> '.$langs->transnoentities("DatabaseTypeManager").":\n".$db->type."\n"; + // No dol_escape_htmltag for output, we are in CLI mode + $out.='> '.$langs->transnoentities("DatabaseTypeManager").":\n".$db->type."\n"; $out.='> '.$langs->transnoentities("RequestLastAccessInError").":\n".($db->lastqueryerror()?$db->lastqueryerror():$langs->transnoentities("ErrorNoRequestInError"))."\n"; $out.='> '.$langs->transnoentities("ReturnCodeLastAccessInError").":\n".($db->lasterrno()?$db->lasterrno():$langs->transnoentities("ErrorNoRequestInError"))."\n"; $out.='> '.$langs->transnoentities("InformationLastAccessInError").":\n".($db->lasterror()?$db->lasterror():$langs->transnoentities("ErrorNoRequestInError"))."\n"; @@ -3439,7 +3439,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m $sortorder=strtoupper($sortorder); $out=''; - $sortimg=''; + $sortimg=''; $tag='th'; if ($thead==2) $tag='div'; @@ -3464,13 +3464,13 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m if ($field1 != $sortfield1) // We are on another field { - if (preg_match('/^DESC/', $sortorder)) $out.= ''; - else $out.= ''; + if (preg_match('/^DESC/', $sortorder)) $out.= ''; + else $out.= ''; } else // We are of first sorting criteria { - if (preg_match('/^ASC/', $sortorder)) $out.= ''; - else $out.= ''; + if (preg_match('/^ASC/', $sortorder)) $out.= ''; + else $out.= ''; } } @@ -3620,8 +3620,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so global $conf,$langs; $savlimit = $limit; - $savtotalnboflines = $totalnboflines; - $totalnboflines=abs($totalnboflines); + $savtotalnboflines = $totalnboflines; + $totalnboflines=abs($totalnboflines); if ($picto == 'setup') $picto='title_setup.png'; if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif'; @@ -3734,40 +3734,40 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee print ''; } - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - if ($moreforfilter) - { + if ($moreforfilter) + { print '
        '; - print $moreforfilter; - print '
        '; - } + print $moreforfilter; + print '
        '; + } - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - print '
        '; - print ''."\n"; + print '
        '; + print '
        '."\n"; // Line for filters print ''; // Ref if (! empty($arrayfields['f.ref']['checked'])) { - print ''; + print ''; } // Ref supplier if (! empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; + print ''; } // Label if (! empty($arrayfields['f.label']['checked'])) { - print ''; + print ''; } // Date invoice if (! empty($arrayfields['f.datef']['checked'])) { - print ''; + print ''; } // Date due if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; + print ''; } // Project if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -651,98 +651,98 @@ if ($resql) // State if (! empty($arrayfields['state.nom']['checked'])) { - print ''; + print ''; } // Country if (! empty($arrayfields['country.code_iso']['checked'])) { - print ''; + print ''; } // Company type if (! empty($arrayfields['typent.code']['checked'])) { - print ''; + print ''; } // Payment mode if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['f.total_ht']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['f.total_vat']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['f.total_localtax1']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['f.total_localtax2']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['f.total_ttc']['checked'])) { - // Amount - print ''; + // Amount + print ''; + } + if (! empty($arrayfields['dynamount_payed']['checked'])) + { + print ''; + } + if (! empty($arrayfields['rtp']['checked'])) + { + print ''; } - if (! empty($arrayfields['dynamount_payed']['checked'])) - { - print ''; - } - if (! empty($arrayfields['rtp']['checked'])) - { - print ''; - } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } } // Fields from hook $parameters=array('arrayfields'=>$arrayfields); @@ -751,22 +751,22 @@ if ($resql) // Date creation if (! empty($arrayfields['f.datec']['checked'])) { - print ''; + print ''; } // Date modification if (! empty($arrayfields['f.tms']['checked'])) { - print ''; + print ''; } // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print ''; + print ''; } // Action column print '\n"; - $facturestatic=new FactureFournisseur($db); + $facturestatic=new FactureFournisseur($db); $supplierstatic=new Fournisseur($db); $projectstatic=new Project($db); if ($num > 0) - { + { $i=0; $var=true; - $totalarray=array(); + $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); @@ -838,7 +838,7 @@ if ($resql) $datelimit=$db->jdate($obj->datelimite); $facturestatic->id=$obj->facid; $facturestatic->ref=$obj->ref; - $facturestatic->type=$obj->type; + $facturestatic->type=$obj->type; $facturestatic->ref_supplier=$obj->ref_supplier; $facturestatic->date_echeance = $db->jdate($obj->datelimite); $facturestatic->statut = $obj->fk_statut; @@ -849,271 +849,271 @@ if ($resql) $totalpay = $paiement + $totalcreditnotes + $totaldeposits; $remaintopay = $obj->total_ttc - $totalpay; - print ''; - if (! empty($arrayfields['f.ref']['checked'])) - { - print ''; + if (! empty($arrayfields['f.ref']['checked'])) + { + print '
        '; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($year?$year:-1,'year',1, 20, 5); - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year?$year:-1,'year',1, 20, 5); + print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5); - print '
        '.$langs->trans("Late"); - print '
        '; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5); + print '
        '.$langs->trans("Late"); + print '
        '; - print ''; - print ''; + print ''; + print ''; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); - print ''; + print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; - $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10); - print ''; + $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10); + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $searchclass=''; - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; - print ''; - } - print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; - print ''; + print ''; - print ''; + print ''; - $liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); - print $form->selectarray('search_status', $liststatus, $search_status, 1); - print ''; + $liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + print $form->selectarray('search_status', $liststatus, $search_status, 1); + print ''; @@ -795,21 +795,21 @@ if ($resql) if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'],$_SERVER['PHP_SELF'],'f.localtax1','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'],$_SERVER['PHP_SELF'],'f.localtax2','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $sortonfield = "ef.".$key; - if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } } // Hook fields $parameters=array('arrayfields'=>$arrayfields); @@ -821,16 +821,16 @@ if ($resql) print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "
        '; + print '
        '; - print ''; - // Picto + Ref - print ''; - // Warning - //print ''; - // Other picto tool - print '\n"; + print "\n"; if (! $i) $totalarray['nbfield']++; - } + } // Customer ref - if (! empty($arrayfields['f.ref_supplier']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! empty($arrayfields['f.ref_supplier']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Label - if (! empty($arrayfields['f.label']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! empty($arrayfields['f.label']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Date - if (! empty($arrayfields['f.datef']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! empty($arrayfields['f.datef']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Date limit - if (! empty($arrayfields['f.date_lim_reglement']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Date limit + if (! empty($arrayfields['f.date_lim_reglement']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Project - if (! empty($arrayfields['p.ref']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Project + if (! empty($arrayfields['p.ref']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Third party - if (! empty($arrayfields['s.nom']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Town - if (! empty($arrayfields['s.town']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Zip - if (! empty($arrayfields['s.zip']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // State - if (! empty($arrayfields['state.nom']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Country - if (! empty($arrayfields['country.code_iso']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Type ent - if (! empty($arrayfields['typent.code']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Third party + if (! empty($arrayfields['s.nom']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Town + if (! empty($arrayfields['s.town']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Zip + if (! empty($arrayfields['s.zip']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // State + if (! empty($arrayfields['state.nom']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Type ent + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Payment mode - if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Payment mode + if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Amount HT - if (! empty($arrayfields['f.total_ht']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; - $totalarray['totalht'] += $obj->total_ht; - } - // Amount VAT - if (! empty($arrayfields['f.total_vat']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; - $totalarray['totalvat'] += $obj->total_vat; - } - // Amount LocalTax1 - if (! empty($arrayfields['f.total_localtax1']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; - $totalarray['totallocaltax1'] += $obj->total_localtax1; - } - // Amount LocalTax2 - if (! empty($arrayfields['f.total_localtax2']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; - $totalarray['totallocaltax2'] += $obj->total_localtax2; - } - // Amount TTC - if (! empty($arrayfields['f.total_ttc']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; - $totalarray['totalttc'] += $obj->total_ttc; - } + // Amount HT + if (! empty($arrayfields['f.total_ht']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; + $totalarray['totalht'] += $obj->total_ht; + } + // Amount VAT + if (! empty($arrayfields['f.total_vat']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; + $totalarray['totalvat'] += $obj->total_vat; + } + // Amount LocalTax1 + if (! empty($arrayfields['f.total_localtax1']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; + $totalarray['totallocaltax1'] += $obj->total_localtax1; + } + // Amount LocalTax2 + if (! empty($arrayfields['f.total_localtax2']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; + $totalarray['totallocaltax2'] += $obj->total_localtax2; + } + // Amount TTC + if (! empty($arrayfields['f.total_ttc']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; + $totalarray['totalttc'] += $obj->total_ttc; + } - if (! empty($arrayfields['dynamount_payed']['checked'])) - { - print ''; // TODO Use a denormalized field - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; - $totalarray['totalam'] += $totalpay; - } + if (! empty($arrayfields['dynamount_payed']['checked'])) + { + print ''; // TODO Use a denormalized field + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; + $totalarray['totalam'] += $totalpay; + } - if (! empty($arrayfields['rtp']['checked'])) - { - print ''; // TODO Use a denormalized field - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; - $totalarray['totalrtp'] += $remaintopay; - } + if (! empty($arrayfields['rtp']['checked'])) + { + print ''; // TODO Use a denormalized field + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; + $totalarray['totalrtp'] += $remaintopay; + } - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - print 'getAlignFlag($key); - if ($align) print ' align="'.$align.'"'; - print '>'; - $tmpkey='options_'.$key; - print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); - print ''; - if (! $i) $totalarray['nbfield']++; - } - } - } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['f.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['f.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status - if (! empty($arrayfields['f.fk_statut']['checked'])) - { - print '"; - if (! $i) $totalarray['nbfield']++; - } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['f.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['f.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status + if (! empty($arrayfields['f.fk_statut']['checked'])) + { + print '"; + if (! $i) $totalarray['nbfield']++; + } - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; print "\n"; $i++; } - // Show total line - if (isset($totalarray['totalhtfield']) + // Show total line + if (isset($totalarray['totalhtfield']) || isset($totalarray['totalvatfield']) || isset($totalarray['totallocaltax1field']) || isset($totalarray['totallocaltax2field']) @@ -1121,29 +1121,29 @@ if ($resql) || isset($totalarray['totalamfield']) || isset($totalarray['totalrtpfield']) ) - { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totallocaltax1field'] == $i) print ''; - elseif ($totalarray['totallocaltax2field'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; - elseif ($totalarray['totalamfield'] == $i) print ''; - elseif ($totalarray['totalrtpfield'] == $i) print ''; - else print ''; - } - print ''; + { + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if ($i == 1) + { + if ($num < $limit && empty($offset)) print ''; + else print ''; + } + elseif ($totalarray['totalhtfield'] == $i) print ''; + elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totallocaltax1field'] == $i) print ''; + elseif ($totalarray['totallocaltax2field'] == $i) print ''; + elseif ($totalarray['totalttcfield'] == $i) print ''; + elseif ($totalarray['totalamfield'] == $i) print ''; + elseif ($totalarray['totalrtpfield'] == $i) print ''; + else print ''; + } + print ''; - } + } } $db->free($resql); @@ -1153,11 +1153,11 @@ if ($resql) print $hookmanager->resPrint; print "
        '; - print $facturestatic->getNomUrl(1); - print ''; - //print ''; - $filename=dol_sanitizeFileName($obj->ref); - $filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref); + print ''; + // Picto + Ref + print ''; + // Warning + //print ''; + // Other picto tool + print '
        '; + print $facturestatic->getNomUrl(1); + print ''; + //print ''; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref); $subdir = get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref); print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir); print '
        '; - print "
        '; - print $obj->ref_supplier; - print ''; + print $obj->ref_supplier; + print ''; - print $obj->label; - print ''; + print $obj->label; + print ''; - print dol_print_date($db->jdate($obj->datef),'day'); - print ''; + print dol_print_date($db->jdate($obj->datef),'day'); + print ''.dol_print_date($datelimit,'day'); - if ($facturestatic->hasDelay()) - { - print img_warning($langs->trans('Late')); - } - print ''.dol_print_date($datelimit,'day'); + if ($facturestatic->hasDelay()) + { + print img_warning($langs->trans('Late')); + } + print ''; - if ($obj->project_id > 0) - { - $projectstatic->id=$obj->project_id; - $projectstatic->ref=$obj->project_ref; - print $projectstatic->getNomUrl(1); - } - print ''; + if ($obj->project_id > 0) + { + $projectstatic->id=$obj->project_id; + $projectstatic->ref=$obj->project_ref; + print $projectstatic->getNomUrl(1); + } + print ''; - $thirdparty=new Societe($db); - $thirdparty->id=$obj->socid; - $thirdparty->name=$obj->name; - $thirdparty->client=$obj->client; - $thirdparty->code_client=$obj->code_client; - print $thirdparty->getNomUrl(1,'supplier'); - print ''; - print $obj->town; - print ''; - print $obj->zip; - print '".$obj->state_name."'; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''; + $thirdparty=new Societe($db); + $thirdparty->id=$obj->socid; + $thirdparty->name=$obj->name; + $thirdparty->client=$obj->client; + $thirdparty->code_client=$obj->code_client; + print $thirdparty->getNomUrl(1,'supplier'); + print ''; + print $obj->town; + print ''; + print $obj->zip; + print '".$obj->state_name."'; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; + print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); - print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + print ''.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'.(! empty($totalpay)?price($totalpay,0,$langs):' ').''.(! empty($totalpay)?price($totalpay,0,$langs):' ').''.(! empty($remaintopay)?price($remaintopay,0,$langs):' ').''.(! empty($remaintopay)?price($remaintopay,0,$langs):' ').''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - // TODO $paiement is not yet defined - print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type); - print "'; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + // TODO $paiement is not yet defined + print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type); + print "'; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->facid, $arrayofselected)) $selected=1; - print ''; - } - print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->facid, $arrayofselected)) $selected=1; + print ''; + } + print '
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totallocaltax1']).''.price($totalarray['totallocaltax2']).''.price($totalarray['totalttc']).''.price($totalarray['totalam']).''.price($totalarray['totalrtp']).'
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totallocaltax1']).''.price($totalarray['totallocaltax2']).''.price($totalarray['totalttc']).''.price($totalarray['totalam']).''.price($totalarray['totalrtp']).'
        \n"; - print ''; + print ''; print "\n"; - /* + /* if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { // Show list of available documents diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 07f896d195c..b40f96f669a 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -99,7 +99,7 @@ if (! $sortorder) $sortorder="ASC"; $socid=0; if ($user->societe_id > 0) { - //$socid = $user->societe_id; + //$socid = $user->societe_id; accessforbidden(); } @@ -108,14 +108,14 @@ $search_all=trim(GETPOST("search_all",'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); } // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach($object->fields as $key => $val) { - if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; + if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; } // Definition of fields for list @@ -123,15 +123,15 @@ $arrayfields=array(); foreach($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field - if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } } @@ -152,32 +152,32 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers - { - foreach($object->fields as $key => $val) - { - $search[$key]=''; - } - $toselect=''; - $search_array_options=array(); - } - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') - || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) - { - $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation - } + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + foreach($object->fields as $key => $val) + { + $search[$key]=''; + } + $toselect=''; + $search_array_options=array(); + } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } - // Mass actions - $objectclass='MyObject'; - $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; - $uploaddir = $conf->mymodule->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + // Mass actions + $objectclass='MyObject'; + $objectlabel='MyObject'; + $permtoread = $user->rights->mymodule->read; + $permtodelete = $user->rights->mymodule->delete; + $uploaddir = $conf->mymodule->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -202,7 +202,7 @@ $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("MyObjects")); $sql = 'SELECT '; foreach($object->fields as $key => $val) { - $sql.='t.'.$key.', '; + $sql.='t.'.$key.', '; } // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); @@ -223,16 +223,16 @@ if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_a // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode_search=0; - if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode_search=0; + if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); + } } // Add where from hooks $parameters=array(); @@ -269,8 +269,8 @@ dol_syslog($script_file, LOG_DEBUG); $resql=$db->query($sql); if (! $resql) { - dol_print_error($db); - exit; + dol_print_error($db); + exit; } $num = $db->num_rows($resql); @@ -278,10 +278,10 @@ $num = $db->num_rows($resql); // Direct jump if only one record found if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/mymodule/myobject_card.php?id='.$id); - exit; + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/mymodule/myobject_card.php?id='.$id); + exit; } @@ -312,21 +312,21 @@ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&con if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); foreach($search as $key => $val) { - $param.= '&search_'.$key.'='.urlencode($search[$key]); + $param.= '&search_'.$key.'='.urlencode($search[$key]); } if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->mymodule->delete) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); @@ -346,8 +346,8 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort if ($sall) { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } $moreforfilter = ''; @@ -364,7 +364,7 @@ if (! empty($moreforfilter)) { print '
        '; print $moreforfilter; - print '
        '; + print ''; } $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; @@ -380,35 +380,35 @@ print ''; foreach($object->fields as $key => $val) { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print ''; + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } } // Fields from hook $parameters=array('arrayfields'=>$arrayfields); @@ -417,12 +417,12 @@ print $hookmanager->resPrint; // Rest of fields search foreach($object->fields as $key => $val) { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print ''; + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print ''; } // Action column print ''."\n"; print ''; foreach($object->fields as $key => $val) { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) - { + if (! empty($arrayfields["ef.".$key]['checked'])) + { $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; - } + } } } // Hook fields @@ -465,12 +465,12 @@ print $hookmanager->resPrint; // Rest of fields title foreach($object->fields as $key => $val) { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; } print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; print ''."\n"; @@ -480,7 +480,7 @@ print ''."\n"; $needToFetchEachLine=0; foreach ($extrafields->attribute_computed as $key => $val) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object } @@ -490,43 +490,43 @@ $i=0; $totalarray=array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); - if (empty($obj)) break; // Should not happen + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen - // Store properties in $object + // Store properties in $object $object->id = $obj->rowid; foreach($object->fields as $key => $val) { if (isset($obj->$key)) $object->$key = $obj->$key; } - // Show here line of result - print ''; - foreach($object->fields as $key => $val) - { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Discard some field output at end - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) - { - print ''; - if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser'); - elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); - elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1); - elseif ($key == 'status') print $object->getLibStatut(3); - else print $obj->$key; - print ''; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) - { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; - $totalarray['val']['t.'.$key] += $obj->$key; - } - } - } - // Extra fields + // Show here line of result + print ''; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Discard some field output at end + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser'); + elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); + elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) @@ -540,87 +540,87 @@ while ($i < min($num, $limit)) $tmpkey='options_'.$key; print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print ''; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) - { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; - $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; - } + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; + $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; + } } } } - // Fields from hook + // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Rest of fields - foreach($object->fields as $key => $val) - { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Keep only field not yet already output - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) - { - print ''; - if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser'); - elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); - elseif ($key == 'status') print $object->getLibStatut(3); - else print $obj->$key; - print ''; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) - { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; - $totalarray['val']['t.'.$key] += $obj->$key; - } - } - } - // Action column - print ''; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Action column + print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; - print ''; + print ''; - $i++; + $i++; } // Show total line if (isset($totalarray['pos'])) { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if (! empty($totalarray['pos'][$i])) print ''; + else + { + if ($i == 1) + { + if ($num < $limit) print ''; + else print ''; + } + else print ''; + } + } + print ''; } // If no record found if ($num == 0) { - $colspan=1; - foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } - print ''; + $colspan=1; + foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } + print ''; } @@ -637,25 +637,25 @@ print ''."\n"; if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) - { - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); - $formfile = new FormFile($db); + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) + { + require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + $formfile = new FormFile($db); - // Show list of available documents - $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + // Show list of available documents + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&','&',$param); - $filedir=$diroutputmassaction; - $genallowed=$user->rights->mymodule->read; - $delallowed=$user->rights->mymodule->read; + $filedir=$diroutputmassaction; + $genallowed=$user->rights->mymodule->read; + $delallowed=$user->rights->mymodule->read; - print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); - } - else - { - print '
        '.$langs->trans("ShowTempMassFilesArea").''; - } + print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + } + else + { + print '
        '.$langs->trans("ShowTempMassFilesArea").''; + } } // End of page diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 525bd96ed90..07a9da3bdb0 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -109,9 +109,9 @@ $canvas=GETPOST("canvas"); $objcanvas=null; if (! empty($canvas)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; - $objcanvas = new Canvas($db,$action); - $objcanvas->getCanvas('product','list',$canvas); + require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; + $objcanvas = new Canvas($db,$action); + $objcanvas->getCanvas('product','list',$canvas); } // Security check @@ -123,16 +123,16 @@ else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); $virtualdiffersfromphysical=0; if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs. + $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs. } // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'p.ref'=>"Ref", - 'pfp.ref_fourn'=>"RefSupplier", + 'pfp.ref_fourn'=>"RefSupplier", 'p.label'=>"ProductLabel", 'p.description'=>"Description", - "p.note"=>"Note", + "p.note"=>"Note", ); // multilang if (! empty($conf->global->MAIN_MULTILANGS)) @@ -156,34 +156,34 @@ if (empty($conf->global->PRODUIT_MULTIPRICES)) // Definition of fields for lists $arrayfields=array( - 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), - 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), - 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(! empty($conf->produit->enabled) && ! empty($conf->service->enabled))), - 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))), - 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), + 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), + 'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), + 'p.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(! empty($conf->produit->enabled) && ! empty($conf->service->enabled))), + 'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))), + 'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))), 'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)), - 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))), + 'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))), 'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))), 'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(! empty($user->rights->fournisseur->lire))), 'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), - 'stock_virtual'=>array('label'=>$langs->trans("VirtualStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service' && $virtualdiffersfromphysical)), - 'p.tobatch'=>array('label'=>$langs->trans("ManageLotSerial"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), + 'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), + 'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')), + 'stock_virtual'=>array('label'=>$langs->trans("VirtualStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service' && $virtualdiffersfromphysical)), + 'p.tobatch'=>array('label'=>$langs->trans("ManageLotSerial"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), 'p.accountancy_code_sell'=>array('label'=>$langs->trans("ProductAccountancySellCode"), 'checked'=>0), 'p.accountancy_code_buy'=>array('label'=>$langs->trans("ProductAccountancyBuyCode"), 'checked'=>0), 'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000), - 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Buy").')', 'checked'=>1, 'position'=>1000) + 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000), + 'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Buy").')', 'checked'=>1, 'position'=>1000) ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } } @@ -202,35 +202,35 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers - { - $sall=""; - $search_ref=""; - $search_label=""; - $search_barcode=""; - $search_categ=0; - $search_tosell=""; - $search_tobuy=""; - $search_tobatch=''; - $search_type=''; - $search_accountancy_code_sell=''; - $search_accountancy_code_buy=''; - $search_array_options=array(); - } + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + $sall=""; + $search_ref=""; + $search_label=""; + $search_barcode=""; + $search_categ=0; + $search_tosell=""; + $search_tobuy=""; + $search_tobatch=''; + $search_type=''; + $search_accountancy_code_sell=''; + $search_accountancy_code_buy=''; + $search_array_options=array(); + } - // Mass actions - $objectclass='Product'; - if ((string) $search_type == '1') { $objectlabel='Services'; } - if ((string) $search_type == '0') { $objectlabel='Products'; } + // Mass actions + $objectclass='Product'; + if ((string) $search_type == '1') { $objectlabel='Services'; } + if ((string) $search_type == '0') { $objectlabel='Products'; } - $permtoread = $user->rights->produit->lire; - $permtodelete = $user->rights->produit->supprimer; - $uploaddir = $conf->product->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + $permtoread = $user->rights->produit->lire; + $permtodelete = $user->rights->produit->supprimer; + $uploaddir = $conf->product->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -243,7 +243,7 @@ $htmlother=new FormOther($db); if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $objcanvas->assign_values($action); // This must contains code to load data (must call LoadListDatas($limit, $offset, $sortfield, $sortorder)) - $objcanvas->display_canvas($action); // This is code to show template + $objcanvas->display_canvas($action); // This is code to show template } else { @@ -265,24 +265,24 @@ else $texte = $langs->trans("ProductsAndServices"); } - $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; - $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; - $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy,'; - $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,'; - //$sql.= ' pfp.ref_fourn as ref_supplier, '; - $sql.= ' MIN(pfp.unitprice) as minsellprice'; + $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; + $sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; + $sql.= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy,'; + $sql.= ' p.datec as date_creation, p.tms as date_update, p.pmp,'; + //$sql.= ' pfp.ref_fourn as ref_supplier, '; + $sql.= ' MIN(pfp.unitprice) as minsellprice'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { $sql .= ', pac.rowid prod_comb_id'; } // Add fields from extrafields - foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); + foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; - $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)"; - if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ + if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'"; @@ -292,27 +292,27 @@ else $sql.= ' WHERE p.entity IN ('.getEntity('product').')'; if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); - // if the type is not 1, we show all products (type = 0,2,3) - if (dol_strlen($search_type) && $search_type != '-1') - { - if ($search_type == 1) $sql.= " AND p.fk_product_type = 1"; - else $sql.= " AND p.fk_product_type <> 1"; - } + // if the type is not 1, we show all products (type = 0,2,3) + if (dol_strlen($search_type) && $search_type != '-1') + { + if ($search_type == 1) $sql.= " AND p.fk_product_type = 1"; + else $sql.= " AND p.fk_product_type <> 1"; + } if ($search_ref) $sql .= natural_search('p.ref', $search_ref); if ($search_label) $sql .= natural_search('p.label', $search_label); if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode); - if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell); - if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy); - if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'"; - if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid; - if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL"; - if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ); - if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL"; - if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; - if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); - if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); - if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); - // Add where from extra fields + if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell); + if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy); + if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'"; + if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid; + if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL"; + if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ); + if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL"; + if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; + if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); + if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); + if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); + // Add where from extra fields if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { $sql .= " AND pac.rowid IS NULL"; @@ -321,171 +321,171 @@ else // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } } // Add where from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; - $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; - $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy, p.pmp'; + $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; + $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; + $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy, p.pmp'; if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { $sql .= ', pac.rowid'; } // Add fields from extrafields - foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); + foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; - //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet - $sql.= $db->order($sortfield,$sortorder); + //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet + $sql.= $db->order($sortfield,$sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - $sql.= $db->plimit($limit + 1, $offset); + $sql.= $db->plimit($limit + 1, $offset); - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); - $arrayofselected=is_array($toselect)?$toselect:array(); + $arrayofselected=is_array($toselect)?$toselect:array(); - if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) - { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/product/card.php?id='.$id); - exit; - } + if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) + { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/product/card.php?id='.$id); + exit; + } - $helpurl=''; - if ($search_type != '') - { - if ($search_type == 0) - { - $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; - } - else if ($search_type == 1) - { - $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; - } - } + $helpurl=''; + if ($search_type != '') + { + if ($search_type == 0) + { + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + } + else if ($search_type == 1) + { + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + } + } - llxHeader('',$title,$helpurl,''); + llxHeader('',$title,$helpurl,''); - // Displays product removal confirmation - if (GETPOST('delprod')) { - setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs'); - } + // Displays product removal confirmation + if (GETPOST('delprod')) { + setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs'); + } - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($sall) $param.="&sall=".urlencode($sall); - if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); - if ($search_ref) $param="&search_ref=".urlencode($search_ref); - if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):""); - if ($search_label) $param.="&search_label=".urlencode($search_label); - if ($search_tosell != '') $param.="&search_tosell=".urlencode($search_tosell); - if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy); - if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); - if ($type != '') $param.='&type='.urlencode($type); - if ($search_type != '') $param.='&search_type='.urlencode($search_type); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell); - if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy); - // Add $param from extra fields - foreach ($search_array_options as $key => $val) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($sall) $param.="&sall=".urlencode($sall); + if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); + if ($search_ref) $param="&search_ref=".urlencode($search_ref); + if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); + if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):""); + if ($search_label) $param.="&search_label=".urlencode($search_label); + if ($search_tosell != '') $param.="&search_tosell=".urlencode($search_tosell); + if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy); + if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); + if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); + if ($type != '') $param.='&type='.urlencode($type); + if ($search_type != '') $param.='&search_type='.urlencode($search_type); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier); + if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell); + if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy); + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } - // List of mass actions available - $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), - ); - if ($user->rights->produit->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); - if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array(); - $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + // List of mass actions available + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + if ($user->rights->produit->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); print ''; - if ($optioncss != '') print ''; + if ($optioncss != '') print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - print ''; - if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; + print ''; + print ''; + if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, '', '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, '', '', $limit); - if (! empty($catid)) - { - print "
        "; - $c = new Categorie($db); - $ways = $c->print_all_ways(' > ','product/list.php'); - print " > ".$ways[0]."
        \n"; - print "

        "; - } + if (! empty($catid)) + { + print "
        "; + $c = new Categorie($db); + $ways = $c->print_all_ways(' > ','product/list.php'); + print " > ".$ways[0]."
        \n"; + print "

        "; + } - if (! empty($canvas) && file_exists(DOL_DOCUMENT_ROOT.'/product/canvas/'.$canvas.'/actions_card_'.$canvas.'.class.php')) - { - $fieldlist = $object->field_list; - $datas = $object->list_datas; - $picto='title.png'; - $title_picto = img_picto('',$picto); - $title_text = $title; + if (! empty($canvas) && file_exists(DOL_DOCUMENT_ROOT.'/product/canvas/'.$canvas.'/actions_card_'.$canvas.'.class.php')) + { + $fieldlist = $object->field_list; + $datas = $object->list_datas; + $picto='title.png'; + $title_picto = img_picto('',$picto); + $title_text = $title; - // Default templates directory - $template_dir = DOL_DOCUMENT_ROOT . '/product/canvas/'.$canvas.'/tpl/'; - // Check if a custom template is present - if (file_exists(DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$canvas.'/list.tpl.php')) - { - $template_dir = DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$canvas.'/'; - } + // Default templates directory + $template_dir = DOL_DOCUMENT_ROOT . '/product/canvas/'.$canvas.'/tpl/'; + // Check if a custom template is present + if (file_exists(DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$canvas.'/list.tpl.php')) + { + $template_dir = DOL_DOCUMENT_ROOT . '/theme/'.$conf->theme.'/tpl/product/'.$canvas.'/'; + } - include $template_dir.'list.tpl.php'; // Include native PHP templates - } - else - { - if ($sall) - { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); - } + include $template_dir.'list.tpl.php'; // Include native PHP templates + } + else + { + if ($sall) + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.='
        '; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1); - $moreforfilter.='
        '; - } + // Filter on categories + $moreforfilter=''; + if (! empty($conf->categorie->enabled)) + { + $moreforfilter.='
        '; + $moreforfilter.=$langs->trans('Categories'). ': '; + $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1); + $moreforfilter.='
        '; + } //Show/hide child products. Hidden by default if (!empty($conf->variants->enabled) && $search_type === 0) { @@ -495,117 +495,117 @@ else $moreforfilter.=''; } - if ($moreforfilter) - { - print '
        '; - print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
        '; - } + if ($moreforfilter) + { + print '
        '; + print $moreforfilter; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
        '; + } $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - print '
        '; - print '
        '; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $searchclass=''; - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; - print ''; - } - print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; @@ -437,25 +437,25 @@ print '
        '; + print $hookmanager->resPrint; + // Rest of fields + foreach($object->fields as $key => $val) + { + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; // Keep only field not yet already output + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; + if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print ''; + if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser'); + elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; + { + $selected=0; if (in_array($obj->rowid, $arrayofselected)) $selected=1; print ''; - } + } print '
        '.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
        '.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
        '.$langs->trans("NoRecordFound").'
        '.$langs->trans("NoRecordFound").'
        '."\n"; + print '
        '; + print '
        '."\n"; - // Lines with input filters - print ''; - if (! empty($arrayfields['p.ref']['checked'])) - { - print ''; - } - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) - { - print ''; - } - if (! empty($arrayfields['p.label']['checked'])) - { - print ''; + if (! empty($arrayfields['p.ref']['checked'])) + { + print ''; + } + if (! empty($arrayfields['pfp.ref_fourn']['checked'])) + { + print ''; + } + if (! empty($arrayfields['p.label']['checked'])) + { + print ''; - } - // Type - if (! empty($arrayfields['p.fk_product_type']['checked'])) - { - print ''; + } + // Type + if (! empty($arrayfields['p.fk_product_type']['checked'])) + { + print ''; - } - // Barcode - if (! empty($arrayfields['p.barcode']['checked'])) - { - print ''; - } - // Duration + print $form->selectarray('search_type', $array, $search_type); + print ''; + } + // Barcode + if (! empty($arrayfields['p.barcode']['checked'])) + { + print ''; + } + // Duration if (! empty($arrayfields['p.duration']['checked'])) - { - print ''; - } - // Sell price + { + print ''; + } + // Sell price if (! empty($arrayfields['p.sellprice']['checked'])) - { - print ''; - } - // Minimum buying Price + { + print ''; + } + // Minimum buying Price if (! empty($arrayfields['p.minbuyprice']['checked'])) - { - print ''; - } + { + print ''; + } // Number buying Price if (! empty($arrayfields['p.numbuyprice']['checked'])) - { - print ''; - } + { + print ''; + } // WAP if (! empty($arrayfields['p.pmp']['checked'])) - { - print ''; - } - // Limit for alert + { + print ''; + } + // Limit for alert if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) - { - print ''; - } - // Desired stock + { + print ''; + } + // Desired stock if (! empty($arrayfields['p.desiredstock']['checked'])) - { - print ''; - } - // Stock + { + print ''; + } + // Stock if (! empty($arrayfields['p.stock']['checked'])) print ''; - // Stock + // Stock if (! empty($arrayfields['stock_virtual']['checked'])) print ''; // To batch if (! empty($arrayfields['p.tobatch']['checked'])) print ''; // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print ''; - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print ''; - // Extra fields + if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print ''; + // Accountancy code sell + if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print ''; + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) @@ -632,221 +632,221 @@ else } } } - // Fields from hook + // Fields from hook $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['p.datec']['checked'])) - { - print ''; - } - // Date modification - if (! empty($arrayfields['p.tms']['checked'])) - { - print ''; - } - if (! empty($arrayfields['p.tosell']['checked'])) - { - print ''; - } + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['p.datec']['checked'])) + { + print ''; + } + // Date modification + if (! empty($arrayfields['p.tms']['checked'])) + { + print ''; + } + if (! empty($arrayfields['p.tosell']['checked'])) + { + print ''; + } if (! empty($arrayfields['p.tobuy']['checked'])) - { - print ''; - } - print ''; + { + print ''; + } + print ''; - print ''; + print ''; - print ''; - if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) print_liste_field_titre($arrayfields['pfp.ref_fourn']['label'], $_SERVER["PHP_SELF"],"pfp.ref_fourn","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.fk_product_type']['checked'])) print_liste_field_titre($arrayfields['p.fk_product_type']['label'], $_SERVER["PHP_SELF"],"p.fk_product_type","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.barcode']['checked'])) print_liste_field_titre($arrayfields['p.barcode']['label'], $_SERVER["PHP_SELF"],"p.barcode","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.numbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.pmp']['checked'])) print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['stock_virtual']['checked'])) print_liste_field_titre($arrayfields['stock_virtual']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_sell","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_buy","",$param,'',$sortfield,$sortorder); - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $sortonfield = "ef.".$key; - if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } - } - // Hook fields - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tosell']['checked'])) print_liste_field_titre($arrayfields['p.tosell']['label'],$_SERVER["PHP_SELF"],"p.tosell","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($arrayfields['p.tobuy']['label'],$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; + print ''; + if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['pfp.ref_fourn']['checked'])) print_liste_field_titre($arrayfields['pfp.ref_fourn']['label'], $_SERVER["PHP_SELF"],"pfp.ref_fourn","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.fk_product_type']['checked'])) print_liste_field_titre($arrayfields['p.fk_product_type']['label'], $_SERVER["PHP_SELF"],"p.fk_product_type","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.barcode']['checked'])) print_liste_field_titre($arrayfields['p.barcode']['label'], $_SERVER["PHP_SELF"],"p.barcode","",$param,"",$sortfield,$sortorder); + if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.numbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.pmp']['checked'])) print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['stock_virtual']['checked'])) print_liste_field_titre($arrayfields['stock_virtual']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_sell","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_buy","",$param,'',$sortfield,$sortorder); + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tosell']['checked'])) print_liste_field_titre($arrayfields['p.tosell']['label'],$_SERVER["PHP_SELF"],"p.tosell","",$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($arrayfields['p.tobuy']['label'],$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; - $product_static=new Product($db); - $product_fourn =new ProductFournisseur($db); + $product_static=new Product($db); + $product_fourn =new ProductFournisseur($db); - $i = 0; - $totalarray=array(); - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($resql); + $i = 0; + $totalarray=array(); + while ($i < min($num,$limit)) + { + $obj = $db->fetch_object($resql); - // Multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active - { - $sql = "SELECT label"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql.= " WHERE fk_product=".$obj->rowid; - $sql.= " AND lang='". $langs->getDefaultLang() ."'"; - $sql.= " LIMIT 1"; + // Multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active + { + $sql = "SELECT label"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; + $sql.= " WHERE fk_product=".$obj->rowid; + $sql.= " AND lang='". $langs->getDefaultLang() ."'"; + $sql.= " LIMIT 1"; - $result = $db->query($sql); - if ($result) - { - $objtp = $db->fetch_object($result); - if (! empty($objtp->label)) $obj->label = $objtp->label; - } - } + $result = $db->query($sql); + if ($result) + { + $objtp = $db->fetch_object($result); + if (! empty($objtp->label)) $obj->label = $objtp->label; + } + } - $product_static->id = $obj->rowid; - $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; - $product_static->label = $obj->label; - $product_static->type = $obj->fk_product_type; - $product_static->status_buy = $obj->tobuy; - $product_static->status = $obj->tosell; + $product_static->id = $obj->rowid; + $product_static->ref = $obj->ref; + $product_static->ref_fourn = $obj->ref_supplier; + $product_static->label = $obj->label; + $product_static->type = $obj->fk_product_type; + $product_static->status_buy = $obj->tobuy; + $product_static->status = $obj->tosell; $product_static->entity = $obj->entity; $product_static->pmp = $obj->pmp; if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock { - if ($obj->fk_product_type != 1 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Not a service - { - $product_static->load_stock('nobatch'); // Load stock_reel + stock_warehouse. This also call load_virtual_stock() - } + if ($obj->fk_product_type != 1 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Not a service + { + $product_static->load_stock('nobatch'); // Load stock_reel + stock_warehouse. This also call load_virtual_stock() + } } - print ''; + print ''; - // Ref - if (! empty($arrayfields['p.ref']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - } - // Ref supplier - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - } - // Label - if (! empty($arrayfields['p.label']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Ref + if (! empty($arrayfields['p.ref']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + } + // Ref supplier + if (! empty($arrayfields['pfp.ref_fourn']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + } + // Label + if (! empty($arrayfields['p.label']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Type - if (! empty($arrayfields['p.fk_product_type']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Type + if (! empty($arrayfields['p.fk_product_type']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Barcode - if (! empty($arrayfields['p.barcode']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Barcode + if (! empty($arrayfields['p.barcode']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Duration - if (! empty($arrayfields['p.duration']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Duration + if (! empty($arrayfields['p.duration']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Sell price - if (! empty($arrayfields['p.sellprice']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Sell price + if (! empty($arrayfields['p.sellprice']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Better buy price - if (! empty($arrayfields['p.minbuyprice']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Better buy price + if (! empty($arrayfields['p.minbuyprice']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Number of buy prices if (! empty($arrayfields['p.numbuyprice']['checked'])) @@ -871,73 +871,73 @@ else print ''; } - // Limit alert - if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Desired stock - if (! empty($arrayfields['p.desiredstock']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + // Limit alert + if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Desired stock + if (! empty($arrayfields['p.desiredstock']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Stock - if (! empty($arrayfields['p.stock']['checked'])) - { + if (! empty($arrayfields['p.stock']['checked'])) + { print ''; - if (! $i) $totalarray['nbfield']++; - } - // Stock - if (! empty($arrayfields['stock_virtual']['checked'])) - { + print $product_static->stock_reel; + } + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Stock + if (! empty($arrayfields['stock_virtual']['checked'])) + { print ''; - if (! $i) $totalarray['nbfield']++; - } - // Lot/Serial - if (! empty($arrayfields['p.tobatch']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Extra fields + print $product_static->stock_theorique; + } + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Lot/Serial + if (! empty($arrayfields['p.tobatch']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Accountancy code sell + if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Accountancy code sell + if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) @@ -951,81 +951,81 @@ else $tmpkey='options_'.$key; print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } } } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['p.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['p.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['p.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['p.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Status (to sell) - if (! empty($arrayfields['p.tosell']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status (to buy) - if (! empty($arrayfields['p.tobuy']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Action - print ''; - if (! $i) $totalarray['nbfield']++; + // Status (to sell) + if (! empty($arrayfields['p.tosell']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status (to buy) + if (! empty($arrayfields['p.tobuy']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Action + print ''; + if (! $i) $totalarray['nbfield']++; - print "\n"; - $i++; - } + print "\n"; + $i++; + } - $db->free($resql); + $db->free($resql); - print "
        '; - print ''; - print ''; - print ''; - print ''; + // Lines with input filters + print '
        '; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; $array=array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service')); - print $form->selectarray('search_type', $array, $search_type); - print ''; - print ''; - print ''; + print ''; + print ''; - print ' '; - print ''; + print ' '; + print ''; - print ''; + print ''; - print ' '; - print ''; + print ' '; + print ''; - print ' '; - print ''; + print ' '; + print ''; - print ' '; - print ''; + print ' '; + print ''; - print ' '; - print ''; + print ' '; + print ''; - print ' '; - print ''; + print ' '; + print '  '.$form->selectyesno($search_tobatch, '', '', '', 1).''; - print ''; - print ''; - print $form->selectarray('search_tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$search_tosell,1); - print ''; + print ''; + print ''; + print $form->selectarray('search_tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$search_tosell,1); + print ''; - print $form->selectarray('search_tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$search_tobuy,1); - print ''; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; - print ''; + print $form->selectarray('search_tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$search_tobuy,1); + print ''; + $searchpicto=$form->showFilterButtons(); + print $searchpicto; + print '
        '; - print $product_static->getNomUrl(1,'',24); - print "'; - print $product_static->getNomUrl(1,'',24); - print "'.dol_trunc($obj->label,40).''; + print $product_static->getNomUrl(1,'',24); + print "'; + print $product_static->getNomUrl(1,'',24); + print "'.dol_trunc($obj->label,40).''.$obj->fk_product_type.''.$obj->fk_product_type.''.$obj->barcode.''.$obj->barcode.''; - if (preg_match('/([^a-z]+)[a-z]/i',$obj->duration)) - { - if (preg_match('/([^a-z]+)y/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); - elseif (preg_match('/([^a-z]+)m/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); - elseif (preg_match('/([^a-z]+)w/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek"); - elseif (preg_match('/([^a-z]+)d/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); - //elseif (preg_match('/([^a-z]+)h/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationHour"); - else print $obj->duration; - } - print ''; + if (preg_match('/([^a-z]+)[a-z]/i',$obj->duration)) + { + if (preg_match('/([^a-z]+)y/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); + elseif (preg_match('/([^a-z]+)m/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); + elseif (preg_match('/([^a-z]+)w/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek"); + elseif (preg_match('/([^a-z]+)d/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); + //elseif (preg_match('/([^a-z]+)h/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationHour"); + else print $obj->duration; + } + print ''; - if ($obj->tosell) - { - if ($obj->price_base_type == 'TTC') print price($obj->price_ttc).' '.$langs->trans("TTC"); - else print price($obj->price).' '.$langs->trans("HT"); - } - print ''; + if ($obj->tosell) + { + if ($obj->price_base_type == 'TTC') print price($obj->price_ttc).' '.$langs->trans("TTC"); + else print price($obj->price).' '.$langs->trans("HT"); + } + print ''; - if ($obj->tobuy && $obj->minsellprice != '') - { - //print price($obj->minsellprice).' '.$langs->trans("HT"); - if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) - { - if ($product_fourn->product_fourn_price_id > 0) - { - if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) - { - $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1); - print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); - } - else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); - } - } - } - print ''; + if ($obj->tobuy && $obj->minsellprice != '') + { + //print price($obj->minsellprice).' '.$langs->trans("HT"); + if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) + { + if ($product_fourn->product_fourn_price_id > 0) + { + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) + { + $htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1); + print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); + } + else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); + } + } + } + print ''; - if ($obj->fk_product_type != 1) - { - print $obj->seuil_stock_alerte; - } - print ''; - if ($obj->fk_product_type != 1) - { - print $obj->desiredstock; - } - print ''; + if ($obj->fk_product_type != 1) + { + print $obj->seuil_stock_alerte; + } + print ''; + if ($obj->fk_product_type != 1) + { + print $obj->desiredstock; + } + print ''; - if ($obj->fk_product_type != 1) - { + if ($obj->fk_product_type != 1) + { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; - print $product_static->stock_reel; - } - print ''; - if ($obj->fk_product_type != 1) - { + if ($obj->fk_product_type != 1) + { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; - print $product_static->stock_theorique; - } - print ''; - print yn($obj->tobatch); - print ''.$obj->accountancy_code_sell.''.$obj->accountancy_code_buy.''; + print yn($obj->tobatch); + print ''.$obj->accountancy_code_sell.''.$obj->accountancy_code_buy.''; - print dol_print_date($obj->date_creation, 'dayhour', 'tzuser'); - print ''; - print dol_print_date($obj->date_update, 'dayhour', 'tzuser'); - print ''; + print dol_print_date($obj->date_creation, 'dayhour', 'tzuser'); + print ''; + print dol_print_date($obj->date_update, 'dayhour', 'tzuser'); + print ''; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); - } else { - print $product_static->LibStatut($obj->tosell,5,0); - } - print ''; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); - } else { - print $product_static->LibStatut($obj->tobuy,5,1); - } - print ''; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->rowid, $arrayofselected)) $selected=1; - print ''; - } - print ''; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + } else { + print $product_static->LibStatut($obj->tosell,5,0); + } + print ''; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + } else { + print $product_static->LibStatut($obj->tobuy,5,1); + } + print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
        "; - print ""; - } - print ''; - } - else - { - dol_print_error($db); - } + print "
        "; + print "
        "; + } + print ''; + } + else + { + dol_print_error($db); + } } diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 7d236c904f5..7880c262d04 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -76,7 +76,7 @@ if (! $sortorder) $sortorder="ASC"; $socid=0; if ($user->societe_id > 0) { - $socid = $user->societe_id; + $socid = $user->societe_id; //accessforbidden(); } @@ -90,31 +90,31 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 't.ref'=>'Ref', - 't.note_public'=>'NotePublic', + 't.ref'=>'Ref', + 't.note_public'=>'NotePublic', ); // Definition of fields for list $arrayfields=array( //'t.entity'=>array('label'=>$langs->trans("Fieldentity"), 'checked'=>1), 't.batch'=>array('label'=>$langs->trans("Batch"), 'checked'=>1), - 't.fk_product'=>array('label'=>$langs->trans("Product"), 'checked'=>1), + 't.fk_product'=>array('label'=>$langs->trans("Product"), 'checked'=>1), 't.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>1), 't.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>1), //'t.import_key'=>array('label'=>$langs->trans("ImportKey"), 'checked'=>1), - //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), - //'t.fk_user_creat'=>array('label'=>$langs->trans("UserCreationShort"), 'checked'=>0, 'position'=>500), + //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), + //'t.fk_user_creat'=>array('label'=>$langs->trans("UserCreationShort"), 'checked'=>0, 'position'=>500), //'t.fk_user_modif'=>array('label'=>$langs->trans("UserModificationShort"), 'checked'=>0, 'position'=>500), - 't.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), - 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 't.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), + 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } } @@ -122,8 +122,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab $object=new Productlot($db); if (($id > 0 || ! empty($ref)) && $action != 'add') { - $result=$object->fetch($id,$ref); - if ($result < 0) dol_print_error($db); + $result=$object->fetch($id,$ref); + if ($result < 0) dol_print_error($db); } @@ -144,12 +144,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { - $search_entity=''; - $search_product=''; - $search_batch=''; - $search_fk_user_creat=''; - $search_fk_user_modif=''; - $search_import_key=''; + $search_entity=''; + $search_product=''; + $search_batch=''; + $search_fk_user_creat=''; + $search_fk_user_modif=''; + $search_import_key=''; $search_date_creation=''; $search_date_update=''; $toselect=''; @@ -159,12 +159,12 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', if (empty($reshook)) { - $objectclass='ProductLot'; - $objectlabel='LotSerial'; - $permtoread = $user->rights->stock->read; - $permtodelete = $user->rights->stock->delete; - $uploaddir = $conf->stock->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + $objectclass='ProductLot'; + $objectlabel='LotSerial'; + $permtoread = $user->rights->stock->read; + $permtodelete = $user->rights->stock->delete; + $uploaddir = $conf->stock->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -240,16 +240,16 @@ if ($sall) $sql.= natural_search(array_keys($fieldstosearchall), $sall); // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } } // Add where from hooks $parameters=array(); @@ -273,325 +273,325 @@ dol_syslog($script_file, LOG_DEBUG); $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $num = $db->num_rows($resql); - $arrayofselected=is_array($toselect)?$toselect:array(); + $arrayofselected=is_array($toselect)?$toselect:array(); - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($search_entity != '') $param.= '&search_entity='.urlencode($search_entity); - if ($search_product != '') $param.= '&search_product='.urlencode($search_product); - if ($search_batch != '') $param.= '&search_batch='.urlencode($search_batch); - if ($search_fk_user_creat != '') $param.= '&search_fk_user_creat='.urlencode($search_fk_user_creat); - if ($search_fk_user_modif != '') $param.= '&search_fk_user_modif='.urlencode($search_fk_user_modif); - if ($search_import_key != '') $param.= '&search_import_key='.urlencode($search_import_key); - if ($optioncss != '') $param.='&optioncss='.$optioncss; - // Add $param from extra fields - foreach ($search_array_options as $key => $val) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($search_entity != '') $param.= '&search_entity='.urlencode($search_entity); + if ($search_product != '') $param.= '&search_product='.urlencode($search_product); + if ($search_batch != '') $param.= '&search_batch='.urlencode($search_batch); + if ($search_fk_user_creat != '') $param.= '&search_fk_user_creat='.urlencode($search_fk_user_creat); + if ($search_fk_user_modif != '') $param.= '&search_fk_user_modif='.urlencode($search_fk_user_modif); + if ($search_import_key != '') $param.= '&search_import_key='.urlencode($search_import_key); + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } - $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), - ); - //if ($user->rights->stock->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); - if ($massaction == 'presend') $arrayofmassactions=array(); - $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + //if ($user->rights->stock->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + if ($massaction == 'presend') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); print '
        '; - if ($optioncss != '') print ''; + if ($optioncss != '') print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); if ($sall) - { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); - } + { + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + } - /*$moreforfilter = ''; + /*$moreforfilter = ''; $moreforfilter.='
        '; $moreforfilter.= $langs->trans('MyFilter') . ': '; $moreforfilter.= '
        ';*/ - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; - else $moreforfilter = $hookmanager->resPrint; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; - if (! empty($moreforfilter)) + if (! empty($moreforfilter)) { print '
        '; print $moreforfilter; - print '
        '; + print '
        '; } - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - print '
        '; - print ''."\n"; + print '
        '; + print '
        '."\n"; - // Fields title search - print ''; - if (! empty($arrayfields['t.entity']['checked'])) print ''; - if (! empty($arrayfields['t.batch']['checked'])) print ''; - if (! empty($arrayfields['t.fk_product']['checked'])) print ''; - if (! empty($arrayfields['t.eatby']['checked'])) print ''; - if (! empty($arrayfields['t.sellby']['checked'])) print ''; - if (! empty($arrayfields['t.fk_user_creat']['checked'])) print ''; - if (! empty($arrayfields['t.fk_user_modif']['checked'])) print ''; - if (! empty($arrayfields['t.import_key']['checked'])) print ''; - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; - } - } - } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['t.datec']['checked'])) - { - // Date creation - print ''; - } - if (! empty($arrayfields['t.tms']['checked'])) - { - // Date modification - print ''; - } - /*if (! empty($arrayfields['u.statut']['checked'])) + // Fields title search + print ''; + if (! empty($arrayfields['t.entity']['checked'])) print ''; + if (! empty($arrayfields['t.batch']['checked'])) print ''; + if (! empty($arrayfields['t.fk_product']['checked'])) print ''; + if (! empty($arrayfields['t.eatby']['checked'])) print ''; + if (! empty($arrayfields['t.sellby']['checked'])) print ''; + if (! empty($arrayfields['t.fk_user_creat']['checked'])) print ''; + if (! empty($arrayfields['t.fk_user_modif']['checked'])) print ''; + if (! empty($arrayfields['t.import_key']['checked'])) print ''; + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['t.datec']['checked'])) + { + // Date creation + print ''; + } + if (! empty($arrayfields['t.tms']['checked'])) + { + // Date modification + print ''; + } + /*if (! empty($arrayfields['u.statut']['checked'])) { // Status print ''; }*/ - // Action column - print ''; - print ''."\n"; + // Action column + print ''; + print ''."\n"; - // Fields title - print ''; - if (! empty($arrayfields['t.entity']['checked'])) print_liste_field_titre($arrayfields['t.entity']['label'],$_SERVER['PHP_SELF'],'t.entity','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.batch']['checked'])) print_liste_field_titre($arrayfields['t.batch']['label'],$_SERVER['PHP_SELF'],'t.batch','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.fk_product']['checked'])) print_liste_field_titre($arrayfields['t.fk_product']['label'],$_SERVER['PHP_SELF'],'t.fk_product','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.eatby']['checked'])) print_liste_field_titre($arrayfields['t.eatby']['label'],$_SERVER['PHP_SELF'],'t.eatby','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.sellby']['checked'])) print_liste_field_titre($arrayfields['t.sellby']['label'],$_SERVER['PHP_SELF'],'t.sellby','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.fk_user_creat']['checked'])) print_liste_field_titre($arrayfields['t.fk_user_creat']['label'],$_SERVER['PHP_SELF'],'t.fk_user_creat','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.fk_user_modif']['checked'])) print_liste_field_titre($arrayfields['t.fk_user_modif']['label'],$_SERVER['PHP_SELF'],'t.fk_user_modif','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['t.import_key']['checked'])) print_liste_field_titre($arrayfields['t.import_key']['label'],$_SERVER['PHP_SELF'],'t.import_key','',$param,'',$sortfield,$sortorder); + // Fields title + print ''; + if (! empty($arrayfields['t.entity']['checked'])) print_liste_field_titre($arrayfields['t.entity']['label'],$_SERVER['PHP_SELF'],'t.entity','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.batch']['checked'])) print_liste_field_titre($arrayfields['t.batch']['label'],$_SERVER['PHP_SELF'],'t.batch','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.fk_product']['checked'])) print_liste_field_titre($arrayfields['t.fk_product']['label'],$_SERVER['PHP_SELF'],'t.fk_product','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.eatby']['checked'])) print_liste_field_titre($arrayfields['t.eatby']['label'],$_SERVER['PHP_SELF'],'t.eatby','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.sellby']['checked'])) print_liste_field_titre($arrayfields['t.sellby']['label'],$_SERVER['PHP_SELF'],'t.sellby','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.fk_user_creat']['checked'])) print_liste_field_titre($arrayfields['t.fk_user_creat']['label'],$_SERVER['PHP_SELF'],'t.fk_user_creat','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.fk_user_modif']['checked'])) print_liste_field_titre($arrayfields['t.fk_user_modif']['label'],$_SERVER['PHP_SELF'],'t.fk_user_modif','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.import_key']['checked'])) print_liste_field_titre($arrayfields['t.import_key']['label'],$_SERVER['PHP_SELF'],'t.import_key','',$param,'',$sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) - { + if (! empty($arrayfields["ef.".$key]['checked'])) + { $align=$extrafields->getAlignFlag($key); - $sortonfield = "ef.".$key; - if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } } } - // Hook fields + // Hook fields $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (! empty($arrayfields['t.datec']['checked'])) print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); //if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($arrayfields['t.status']['label'],$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); - print ''."\n"; + print ''."\n"; $productlot = new Productlot($db); $i=0; $var=true; $totalarray=array(); - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($resql); - if ($obj) - { - $var = !$var; + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + $var = !$var; - $productlot->id = $obj->rowid; - $productlot->batch = $obj->batch; + $productlot->id = $obj->rowid; + $productlot->batch = $obj->batch; - // You can use here results - print ''; - if (! empty($arrayfields['t.entity']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.batch']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.fk_product']['checked'])) - { - $productstatic->id=$obj->fk_product; - $productstatic->type=$obj->product_type; - $productstatic->ref=$obj->product_ref; - $productstatic->label=$obj->product_label; - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.eatby']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.sellby']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.fk_user_creat']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.fk_user_modif']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['t.import_key']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - print 'getAlignFlag($key); - if ($align) print ' align="'.$align.'"'; - print '>'; - $tmpkey='options_'.$key; - print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); - print ''; - if (! $i) $totalarray['nbfield']++; - } - } - } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['t.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['t.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status - /* + // You can use here results + print ''; + if (! empty($arrayfields['t.entity']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.batch']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.fk_product']['checked'])) + { + $productstatic->id=$obj->fk_product; + $productstatic->type=$obj->product_type; + $productstatic->ref=$obj->product_ref; + $productstatic->label=$obj->product_label; + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.eatby']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.sellby']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.fk_user_creat']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.fk_user_modif']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['t.import_key']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['t.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['t.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status + /* if (! empty($arrayfields['u.statut']['checked'])) { $userstatic->statut=$obj->statut; print ''; }*/ - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; - print ''; - } - $i++; - } + print ''; + } + $i++; + } - // Show total line - if (isset($totalarray['totalhtfield'])) - { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; - else print ''; - } - print ''; - } + // Show total line + if (isset($totalarray['totalhtfield'])) + { + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if ($i == 1) + { + if ($num < $limit && empty($offset)) print ''; + else print ''; + } + elseif ($totalarray['totalhtfield'] == $i) print ''; + elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totalttcfield'] == $i) print ''; + else print ''; + } + print ''; + } - $db->free($resql); + $db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
        '; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $searchclass=''; - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; - print ''; - } - print ''; - print ''; - print '
        '; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; + print ''; + print ''; print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); print ''; - $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); - print $searchpicto; - print '
        '; + $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpicto; + print '
        '.$obj->entity.''.$productlot->getNomUrl(1).''.$productstatic->getNomUrl(1).''.dol_print_date($db->jdate($obj->eatby), 'day').''.dol_print_date($db->jdate($obj->sellby), 'day').''.$obj->fk_user_creat.''.$obj->fk_user_modif.''.$obj->import_key.''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print '
        '.$obj->entity.''.$productlot->getNomUrl(1).''.$productstatic->getNomUrl(1).''.dol_print_date($db->jdate($obj->eatby), 'day').''.dol_print_date($db->jdate($obj->sellby), 'day').''.$obj->fk_user_creat.''.$obj->fk_user_modif.''.$obj->import_key.''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''.$userstatic->getLibStatut(3).''; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->rowid, $arrayofselected)) $selected=1; - print ''; - } - print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
        '."\n"; - print '
        '; + print '
        '; print ''."\n"; @@ -616,8 +616,8 @@ if ($resql) } else { - $error++; - dol_print_error($db); + $error++; + dol_print_error($db); } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index ccc2c12584e..12c8eb2038e 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -45,8 +45,8 @@ $search_categ=GETPOST("search_categ",'alpha'); $search_project=GETPOST('search_project'); if (! isset($_GET['search_projectstatus']) && ! isset($_POST['search_projectstatus'])) { - if ($search_all != '') $search_projectstatus=-1; - else $search_projectstatus=1; + if ($search_all != '') $search_projectstatus=-1; + else $search_projectstatus=1; } else $search_projectstatus=GETPOST('search_projectstatus'); $search_project_ref=GETPOST('search_project_ref'); @@ -99,36 +99,36 @@ if (! $sortorder) $sortorder='DESC'; // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 't.ref'=>"Ref", - 't.label'=>"Label", - 't.description'=>"Description", - 't.note_public'=>"NotePublic", + 't.label'=>"Label", + 't.description'=>"Description", + 't.note_public'=>"NotePublic", ); if (empty($user->socid)) $fieldstosearchall['t.note_private']="NotePrivate"; $arrayfields=array( - 't.ref'=>array('label'=>$langs->trans("RefTask"), 'checked'=>1, 'position'=>80), - 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>80), - 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), - 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), - 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1), - 'p.title'=>array('label'=>$langs->trans("ProjectLabel"), 'checked'=>0), - 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>0), - 'p.fk_statut'=>array('label'=>$langs->trans("ProjectStatus"), 'checked'=>1), - 't.planned_workload'=>array('label'=>$langs->trans("PlannedWorkload"), 'checked'=>1, 'position'=>102), - 't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>103), - 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>104), - 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>105), - 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - //'t.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 't.ref'=>array('label'=>$langs->trans("RefTask"), 'checked'=>1, 'position'=>80), + 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>80), + 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), + 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), + 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1), + 'p.title'=>array('label'=>$langs->trans("ProjectLabel"), 'checked'=>0), + 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>0), + 'p.fk_statut'=>array('label'=>$langs->trans("ProjectStatus"), 'checked'=>1), + 't.planned_workload'=>array('label'=>$langs->trans("PlannedWorkload"), 'checked'=>1, 'position'=>102), + 't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>103), + 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>104), + 't.progress'=>array('label'=>$langs->trans("ProgressDeclared"), 'checked'=>1, 'position'=>105), + 't.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + //'t.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } } $object = new Task($db); @@ -147,40 +147,40 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers - { - $search_all=""; - $search_categ=""; - $search_project=""; - $search_projectstatus=-1; - $search_project_ref=""; - $search_project_title=""; - $search_task_ref=""; - $search_task_label=""; - $search_task_description=""; - $search_task_user=-1; - $search_project_user=-1; - $search_sday=''; - $search_smonth=''; - $search_syear=''; - $search_eday=''; - $search_emonth=''; - $search_eyear=''; - $toselect=''; - $search_array_options=array(); - } + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + $search_all=""; + $search_categ=""; + $search_project=""; + $search_projectstatus=-1; + $search_project_ref=""; + $search_project_title=""; + $search_task_ref=""; + $search_task_label=""; + $search_task_description=""; + $search_task_user=-1; + $search_project_user=-1; + $search_sday=''; + $search_smonth=''; + $search_syear=''; + $search_eday=''; + $search_emonth=''; + $search_eyear=''; + $toselect=''; + $search_array_options=array(); + } - // Mass actions - $objectclass='Task'; - $objectlabel='Tasks'; - $permtoread = $user->rights->projet->lire; - $permtodelete = $user->rights->projet->supprimer; - $uploaddir = $conf->projet->dir_output.'/tasks'; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + // Mass actions + $objectclass='Task'; + $objectlabel='Tasks'; + $permtoread = $user->rights->projet->lire; + $permtodelete = $user->rights->projet->supprimer; + $uploaddir = $conf->projet->dir_output.'/tasks'; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } if (empty($search_projectstatus) && $search_projectstatus == '') $search_projectstatus=1; @@ -223,10 +223,10 @@ $sql.= " AND ctc.source = 'internal'"; $resql = $db->query($sql); if ($resql) { - while($obj = $db->fetch_object($resql)) - { - $listofprojectcontacttype[$obj->rowid]=$obj->code; - } + while($obj = $db->fetch_object($resql)) + { + $listofprojectcontacttype[$obj->rowid]=$obj->code; + } } else dol_print_error($db); if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid sql syntax error if not found @@ -238,10 +238,10 @@ $sql.= " AND ctc.source = 'internal'"; $resql = $db->query($sql); if ($resql) { - while($obj = $db->fetch_object($resql)) - { - $listoftaskcontacttype[$obj->rowid]=$obj->code; - } + while($obj = $db->fetch_object($resql)) + { + $listoftaskcontacttype[$obj->rowid]=$obj->code; + } } else dol_print_error($db); if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0]='0'; // To avoid sql syntax error if not found @@ -281,35 +281,35 @@ if ($search_task_label) $sql .= natural_search('t.label', $search_task_label) if ($search_societe) $sql .= natural_search('s.nom', $search_societe); if ($search_smonth > 0) { - if ($search_syear > 0 && empty($search_sday)) - $sql.= " AND t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,$search_smonth,false))."' AND '".$db->idate(dol_get_last_day($search_syear,$search_smonth,false))."'"; - else if ($search_syear > 0 && ! empty($search_sday)) - $sql.= " AND t.dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_smonth, $search_sday, $search_syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_smonth, $search_sday, $search_syear))."'"; - else - $sql.= " AND date_format(t.dateo, '%m') = '".$search_smonth."'"; + if ($search_syear > 0 && empty($search_sday)) + $sql.= " AND t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,$search_smonth,false))."' AND '".$db->idate(dol_get_last_day($search_syear,$search_smonth,false))."'"; + else if ($search_syear > 0 && ! empty($search_sday)) + $sql.= " AND t.dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_smonth, $search_sday, $search_syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_smonth, $search_sday, $search_syear))."'"; + else + $sql.= " AND date_format(t.dateo, '%m') = '".$search_smonth."'"; } else if ($search_syear > 0) { - $sql.= " AND t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,1,false))."' AND '".$db->idate(dol_get_last_day($search_syear,12,false))."'"; + $sql.= " AND t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,1,false))."' AND '".$db->idate(dol_get_last_day($search_syear,12,false))."'"; } if ($search_emonth > 0) { - if ($search_eyear > 0 && empty($search_eday)) - $sql.= " AND t.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,$search_emonth,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,$search_emonth,false))."'"; - else if ($search_eyear > 0 && ! empty($search_eday)) - $sql.= " AND t.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_emonth, $search_eday, $search_eyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_emonth, $search_eday, $search_eyear))."'"; - else - $sql.= " AND date_format(t.datee, '%m') = '".$search_emonth."'"; + if ($search_eyear > 0 && empty($search_eday)) + $sql.= " AND t.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,$search_emonth,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,$search_emonth,false))."'"; + else if ($search_eyear > 0 && ! empty($search_eday)) + $sql.= " AND t.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_emonth, $search_eday, $search_eyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_emonth, $search_eday, $search_eyear))."'"; + else + $sql.= " AND date_format(t.datee, '%m') = '".$search_emonth."'"; } else if ($search_eyear > 0) { - $sql.= " AND t.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,12,false))."'"; + $sql.= " AND t.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,12,false))."'"; } if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); if ($search_projectstatus >= 0) { - if ($search_projectstatus == 99) $sql .= " AND p.fk_statut <> 2"; - else $sql .= " AND p.fk_statut = ".$db->escape($search_projectstatus); + if ($search_projectstatus == 99) $sql .= " AND p.fk_statut <> 2"; + else $sql .= " AND p.fk_statut = ".$db->escape($search_projectstatus); } if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); if ($search_project_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user; @@ -317,16 +317,16 @@ if ($search_task_user > 0) $sql.= " AND ect.fk_c_type_contact IN (".join(',',arr // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } } // Add where from hooks $parameters=array(); @@ -337,8 +337,8 @@ $sql.= $db->order($sortfield,$sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); } $sql.= $db->plimit($limit + 1,$offset); @@ -349,8 +349,8 @@ dol_syslog("list allowed project", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { - dol_print_error($db); - exit; + dol_print_error($db); + exit; } $num = $db->num_rows($resql); @@ -359,10 +359,10 @@ $arrayofselected=is_array($toselect)?$toselect:array(); if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($resql); - $id = $obj->id; - header("Location: ".DOL_URL_ROOT.'/projet/tasks/task.php?id='.$id.'&withprojet=1'); - exit; + $obj = $db->fetch_object($resql); + $id = $obj->id; + header("Location: ".DOL_URL_ROOT.'/projet/tasks/task.php?id='.$id.'&withprojet=1'); + exit; } $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; @@ -393,9 +393,9 @@ if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } // List of mass actions available @@ -425,14 +425,14 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorde if ($search_task_user == $user->id) print $langs->trans("MyTasksDesc").'

        '; else { - if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("TasksOnProjectsDesc").'

        '; - else print $langs->trans("TasksOnProjectsPublicDesc").'

        '; + if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("TasksOnProjectsDesc").'

        '; + else print $langs->trans("TasksOnProjectsPublicDesc").'

        '; } if ($search_all) { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall); + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall); } $morehtmlfilter = ''; @@ -440,11 +440,11 @@ $morehtmlfilter = ''; // Filter on categories if (! empty($conf->categorie->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.='
        '; - $moreforfilter.=$langs->trans('ProjectCategories'). ': '; - $moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 'maxwidth300'); - $moreforfilter.='
        '; + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
        '; + $moreforfilter.=$langs->trans('ProjectCategories'). ': '; + $moreforfilter.=$formother->select_categories('project', $search_categ, 'search_categ', 1, 'maxwidth300'); + $moreforfilter.='
        '; } // If the user can view users @@ -483,60 +483,60 @@ print ''; if (! empty($arrayfields['t.ref']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['t.label']['checked'])) { - print ''; + print ''; } // Start date if (! empty($arrayfields['t.dateo']['checked'])) { - print ''; + print ''; } // End date if (! empty($arrayfields['t.datee']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['p.title']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['p.fk_statut']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['t.planned_workload']['checked'])) print ''; if (! empty($arrayfields['t.duration_effective']['checked'])) print ''; @@ -545,25 +545,25 @@ if (! empty($arrayfields['t.progress']['checked'])) print ''; - } - } + print ''; + } + } } // Fields from hook $parameters=array('arrayfields'=>$arrayfields); @@ -571,15 +571,15 @@ $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // N print $hookmanager->resPrint; if (! empty($arrayfields['t.datec']['checked'])) { - // Date creation - print ''; + // Date creation + print ''; } if (! empty($arrayfields['t.tms']['checked'])) { - // Date modification - print ''; + // Date modification + print ''; } // Action column print ''; - // Ref - if (! empty($arrayfields['t.ref']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Label - if (! empty($arrayfields['t.label']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date start - if (! empty($arrayfields['t.dateo']['checked'])) - { + // Ref + if (! empty($arrayfields['t.ref']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Label + if (! empty($arrayfields['t.label']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date start + if (! empty($arrayfields['t.dateo']['checked'])) + { print ''; - if (! $i) $totalarray['nbfield']++; - } + print dol_print_date($db->jdate($obj->date_start),'day'); + print ''; + if (! $i) $totalarray['nbfield']++; + } // Date end - if (! empty($arrayfields['t.datee']['checked'])) - { + if (! empty($arrayfields['t.datee']['checked'])) + { print ''; - if (! $i) $totalarray['nbfield']++; - } - // Project ref - if (! empty($arrayfields['p.ref']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Project title - if (! empty($arrayfields['p.title']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Third party - if (! empty($arrayfields['s.nom']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Project status - if (! empty($arrayfields['p.fk_statut']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + print dol_print_date($db->jdate($obj->date_end),'day'); + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Project ref + if (! empty($arrayfields['p.ref']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Project title + if (! empty($arrayfields['p.title']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Third party + if (! empty($arrayfields['s.nom']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Project status + if (! empty($arrayfields['p.fk_statut']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - // Planned workload - if (! empty($arrayfields['t.planned_workload']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalplannedworkloadfield']=$totalarray['nbfield']; - $totalarray['totalplannedworkload'] += $obj->planned_workload; - } - // Time spent - if (! empty($arrayfields['t.duration_effective']['checked'])) - { - $showlineingray=0;$showproject=1; - print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalplannedworkloadfield']=$totalarray['nbfield']; + $totalarray['totalplannedworkload'] += $obj->planned_workload; + } + // Time spent + if (! empty($arrayfields['t.duration_effective']['checked'])) + { + $showlineingray=0;$showproject=1; + print ''; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totaldurationeffectivefield']=$totalarray['nbfield']; - $totalarray['totaldurationeffective'] += $obj->duration_effective; - } - // Calculated progress - if (! empty($arrayfields['t.progress_calculated']['checked'])) - { + print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totaldurationeffectivefield']=$totalarray['nbfield']; + $totalarray['totaldurationeffective'] += $obj->duration_effective; + } + // Calculated progress + if (! empty($arrayfields['t.progress_calculated']['checked'])) + { print ''; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalprogress_calculated']=$totalarray['nbfield']; - } - // Declared progress - if (! empty($arrayfields['t.progress']['checked'])) - { + print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalprogress_calculated']=$totalarray['nbfield']; + } + // Declared progress + if (! empty($arrayfields['t.progress']['checked'])) + { print ''; - if (! $i) $totalarray['nbfield']++; - } - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - print 'getAlignFlag($key); - if ($align) print ' align="'.$align.'"'; - print '>'; - $tmpkey='options_'.$key; - print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); - print ''; - if (! $i) $totalarray['nbfield']++; - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + } + } } // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); @@ -815,18 +815,18 @@ while ($i < min($num,$limit)) // Date creation if (! empty($arrayfields['t.datec']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } // Date modification if (! empty($arrayfields['t.tms']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } // Status /*if (! empty($arrayfields['p.fk_statut']['checked'])) @@ -834,16 +834,16 @@ while ($i < min($num,$limit)) $projectstatic->statut = $obj->fk_statut; print ''; }*/ - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; print "\n"; @@ -856,22 +856,22 @@ while ($i < min($num,$limit)) // Show total line if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['totalplannedworkloadfield'])) { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalplannedworkloadfield'] == $i) print ''; - elseif ($totalarray['totaldurationeffectivefield'] == $i) print ''; - elseif ($totalarray['totalprogress_calculated'] == $i) print ''; - else print ''; - } - print ''; + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if ($i == 1) + { + if ($num < $limit && empty($offset)) print ''; + else print ''; + } + elseif ($totalarray['totalplannedworkloadfield'] == $i) print ''; + elseif ($totalarray['totaldurationeffectivefield'] == $i) print ''; + elseif ($totalarray['totalprogress_calculated'] == $i) print ''; + else print ''; + } + print ''; } $db->free($resql); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 5e3428019d6..175f3e1510e 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -71,21 +71,21 @@ $download = GETPOST('d','int')?GETPOST('d','int'):GETPOST('download','int'); if (! $action) { - if (! GETPOST("amount",'alpha') && ! $source) - { - print $langs->trans('ErrorBadParameters')." - amount or source"; - exit; - } - if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! $source) - { - print $langs->trans('ErrorBadParameters')." - tag or source"; - exit; - } - if ($source && ! GETPOST("ref",'alpha')) - { - print $langs->trans('ErrorBadParameters')." - ref"; - exit; - } + if (! GETPOST("amount",'alpha') && ! $source) + { + print $langs->trans('ErrorBadParameters')." - amount or source"; + exit; + } + if (is_numeric($amount) && ! GETPOST("tag",'alpha') && ! $source) + { + print $langs->trans('ErrorBadParameters')." - tag or source"; + exit; + } + if ($source && ! GETPOST("ref",'alpha')) + { + print $langs->trans('ErrorBadParameters')." - ref"; + exit; + } } @@ -95,11 +95,11 @@ $validpaymentmethod=array(); // Detect $paymentmethod foreach($_POST as $key => $val) { - if (preg_match('/^dopayment_(.*)$/', $key, $reg)) - { - $paymentmethod=$reg[1]; - break; - } + if (preg_match('/^dopayment_(.*)$/', $key, $reg)) + { + $paymentmethod=$reg[1]; + break; + } } @@ -125,28 +125,28 @@ if (! empty($suffix)) } if ($source) { - $urlok.='s='.urlencode($source).'&'; - $urlko.='s='.urlencode($source).'&'; + $urlok.='s='.urlencode($source).'&'; + $urlko.='s='.urlencode($source).'&'; } if (! empty($REF)) { - $urlok.='ref='.urlencode($REF).'&'; - $urlko.='ref='.urlencode($REF).'&'; + $urlok.='ref='.urlencode($REF).'&'; + $urlko.='ref='.urlencode($REF).'&'; } if (! empty($TAG)) { - $urlok.='tag='.urlencode($TAG).'&'; - $urlko.='tag='.urlencode($TAG).'&'; + $urlok.='tag='.urlencode($TAG).'&'; + $urlko.='tag='.urlencode($TAG).'&'; } if (! empty($FULLTAG)) { - $urlok.='fulltag='.urlencode($FULLTAG).'&'; - $urlko.='fulltag='.urlencode($FULLTAG).'&'; + $urlok.='fulltag='.urlencode($FULLTAG).'&'; + $urlko.='fulltag='.urlencode($FULLTAG).'&'; } if (! empty($SECUREKEY)) { - $urlok.='securekey='.urlencode($SECUREKEY).'&'; - $urlko.='securekey='.urlencode($SECUREKEY).'&'; + $urlok.='securekey='.urlencode($SECUREKEY).'&'; + $urlko.='securekey='.urlencode($SECUREKEY).'&'; } if (! empty($entity)) { @@ -174,21 +174,21 @@ if (! empty($conf->paypal->enabled)) if ($urlko) $PAYPAL_API_KO=$urlko; if (empty($PAYPAL_API_USER)) { - dol_print_error('',"Paypal setup param PAYPAL_API_USER not defined"); - return -1; + dol_print_error('',"Paypal setup param PAYPAL_API_USER not defined"); + return -1; } if (empty($PAYPAL_API_PASSWORD)) { - dol_print_error('',"Paypal setup param PAYPAL_API_PASSWORD not defined"); - return -1; + dol_print_error('',"Paypal setup param PAYPAL_API_PASSWORD not defined"); + return -1; } if (empty($PAYPAL_API_SIGNATURE)) { - dol_print_error('',"Paypal setup param PAYPAL_API_SIGNATURE not defined"); - return -1; + dol_print_error('',"Paypal setup param PAYPAL_API_SIGNATURE not defined"); + return -1; } - $validpaymentmethod['paypal']='valid'; + $validpaymentmethod['paypal']='valid'; } if (! empty($conf->paybox->enabled)) @@ -221,23 +221,23 @@ if (! empty($conf->stripe->enabled)) $valid=true; if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) - { - if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $source . $REF, 2); // Use the source in the hash to avoid duplicates if the references are identical - else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - } - else - { - $token = $conf->global->PAYMENT_SECURITY_TOKEN; - } - if ($SECUREKEY != $token) $valid=false; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + if ($source && $REF) $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $source . $REF, 2); // Use the source in the hash to avoid duplicates if the references are identical + else $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); + } + else + { + $token = $conf->global->PAYMENT_SECURITY_TOKEN; + } + if ($SECUREKEY != $token) $valid=false; - if (! $valid) - { - print '
        Bad value for key.
        '; - //print 'SECUREKEY='.$SECUREKEY.' token='.$token.' valid='.$valid; - exit; - } + if (! $valid) + { + print '
        Bad value for key.
        '; + //print 'SECUREKEY='.$SECUREKEY.' token='.$token.' valid='.$valid; + exit; + } } @@ -265,19 +265,19 @@ if ($action == 'dopayment') if ($paymentmethod == 'paypal') { $PAYPAL_API_PRICE=price2num(GETPOST("newamount"),'MT'); - $PAYPAL_PAYMENT_TYPE='Sale'; + $PAYPAL_PAYMENT_TYPE='Sale'; - $origfulltag=GETPOST("fulltag",'alpha'); - $shipToName=GETPOST("shipToName"); - $shipToStreet=GETPOST("shipToStreet"); - $shipToCity=GETPOST("shipToCity"); - $shipToState=GETPOST("shipToState"); - $shipToCountryCode=GETPOST("shipToCountryCode"); - $shipToZip=GETPOST("shipToZip"); - $shipToStreet2=GETPOST("shipToStreet2"); - $phoneNum=GETPOST("phoneNum"); - $email=GETPOST("email"); - $desc=GETPOST("desc",'alpha'); + $origfulltag=GETPOST("fulltag",'alpha'); + $shipToName=GETPOST("shipToName"); + $shipToStreet=GETPOST("shipToStreet"); + $shipToCity=GETPOST("shipToCity"); + $shipToState=GETPOST("shipToState"); + $shipToCountryCode=GETPOST("shipToCountryCode"); + $shipToZip=GETPOST("shipToZip"); + $shipToStreet2=GETPOST("shipToStreet2"); + $phoneNum=GETPOST("phoneNum"); + $email=GETPOST("email"); + $desc=GETPOST("desc",'alpha'); $mesg=''; if (empty($PAYPAL_API_PRICE) || ! is_numeric($PAYPAL_API_PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); @@ -285,7 +285,7 @@ if ($action == 'dopayment') //elseif (! isValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL); elseif (! $origfulltag) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode")); - //var_dump($_POST); + //var_dump($_POST); if (empty($mesg)) { dol_syslog("newpayment.php call paypal api and do redirect", LOG_DEBUG); @@ -294,35 +294,35 @@ if ($action == 'dopayment') $PAYPAL_API_DEVISE="USD"; //if ($currency == 'EUR') $PAYPAL_API_DEVISE="EUR"; //if ($currency == 'USD') $PAYPAL_API_DEVISE="USD"; - if (! empty($currency)) $PAYPAL_API_DEVISE=$currency; + if (! empty($currency)) $PAYPAL_API_DEVISE=$currency; - dol_syslog("Submit Paypal form", LOG_DEBUG); - dol_syslog("PAYPAL_API_USER: $PAYPAL_API_USER", LOG_DEBUG); - //dol_syslog("PAYPAL_API_PASSWORD: $PAYPAL_API_PASSWORD", LOG_DEBUG); // No password into log files - dol_syslog("PAYPAL_API_SIGNATURE: $PAYPAL_API_SIGNATURE", LOG_DEBUG); - dol_syslog("PAYPAL_API_SANDBOX: $PAYPAL_API_SANDBOX", LOG_DEBUG); - dol_syslog("PAYPAL_API_OK: $PAYPAL_API_OK", LOG_DEBUG); - dol_syslog("PAYPAL_API_KO: $PAYPAL_API_KO", LOG_DEBUG); - dol_syslog("PAYPAL_API_PRICE: $PAYPAL_API_PRICE", LOG_DEBUG); - dol_syslog("PAYPAL_API_DEVISE: $PAYPAL_API_DEVISE", LOG_DEBUG); - dol_syslog("shipToName: $shipToName", LOG_DEBUG); - dol_syslog("shipToStreet: $shipToStreet", LOG_DEBUG); - dol_syslog("shipToCity: $shipToCity", LOG_DEBUG); - dol_syslog("shipToState: $shipToState", LOG_DEBUG); - dol_syslog("shipToCountryCode: $shipToCountryCode", LOG_DEBUG); - dol_syslog("shipToZip: $shipToZip", LOG_DEBUG); - dol_syslog("shipToStreet2: $shipToStreet2", LOG_DEBUG); - dol_syslog("phoneNum: $phoneNum", LOG_DEBUG); - dol_syslog("email: $email", LOG_DEBUG); - dol_syslog("desc: $desc", LOG_DEBUG); + dol_syslog("Submit Paypal form", LOG_DEBUG); + dol_syslog("PAYPAL_API_USER: $PAYPAL_API_USER", LOG_DEBUG); + //dol_syslog("PAYPAL_API_PASSWORD: $PAYPAL_API_PASSWORD", LOG_DEBUG); // No password into log files + dol_syslog("PAYPAL_API_SIGNATURE: $PAYPAL_API_SIGNATURE", LOG_DEBUG); + dol_syslog("PAYPAL_API_SANDBOX: $PAYPAL_API_SANDBOX", LOG_DEBUG); + dol_syslog("PAYPAL_API_OK: $PAYPAL_API_OK", LOG_DEBUG); + dol_syslog("PAYPAL_API_KO: $PAYPAL_API_KO", LOG_DEBUG); + dol_syslog("PAYPAL_API_PRICE: $PAYPAL_API_PRICE", LOG_DEBUG); + dol_syslog("PAYPAL_API_DEVISE: $PAYPAL_API_DEVISE", LOG_DEBUG); + dol_syslog("shipToName: $shipToName", LOG_DEBUG); + dol_syslog("shipToStreet: $shipToStreet", LOG_DEBUG); + dol_syslog("shipToCity: $shipToCity", LOG_DEBUG); + dol_syslog("shipToState: $shipToState", LOG_DEBUG); + dol_syslog("shipToCountryCode: $shipToCountryCode", LOG_DEBUG); + dol_syslog("shipToZip: $shipToZip", LOG_DEBUG); + dol_syslog("shipToStreet2: $shipToStreet2", LOG_DEBUG); + dol_syslog("phoneNum: $phoneNum", LOG_DEBUG); + dol_syslog("email: $email", LOG_DEBUG); + dol_syslog("desc: $desc", LOG_DEBUG); - dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO - //$_SESSION["PaymentType"]=$PAYPAL_PAYMENT_TYPE; - //$_SESSION["currencyCodeType"]=$PAYPAL_API_DEVISE; - //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; + dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO + //$_SESSION["PaymentType"]=$PAYPAL_PAYMENT_TYPE; + //$_SESSION["currencyCodeType"]=$PAYPAL_API_DEVISE; + //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; - // A redirect is added if API call successfull - print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); + // A redirect is added if API call successfull + print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); exit; } @@ -506,11 +506,11 @@ llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'online // Check link validity if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) { - $langs->load("errors"); - dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref)); - llxFooter(); - $db->close(); - exit; + $langs->load("errors"); + dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref)); + llxFooter(); + $db->close(); + exit; } @@ -592,15 +592,15 @@ if ($urllogo) $text=''; if (! empty($conf->global->PAYMENT_NEWFORM_TEXT)) { - $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
        \n"; - else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
        \n"; - $text=''."\n"; + $langs->load("members"); + if (preg_match('/^\((.*)\)$/',$conf->global->PAYMENT_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
        \n"; + else $text.=$conf->global->PAYMENT_NEWFORM_TEXT."
        \n"; + $text=''."\n"; } if (empty($text)) { - $text.=''."\n"; - $text.=''."\n"; + $text.=''."\n"; + $text.=''."\n"; } print $text; @@ -626,9 +626,9 @@ if (! $source) // Creditor print ''."\n"; + print ''."\n"; // Amount @@ -637,12 +637,12 @@ if (! $source) print ''."\n"; - // We do not add fields shipToName, shipToStreet, shipToCity, shipToState, shipToCountryCode, shipToZip, shipToStreet2, phoneNum - // as they don't exists (buyer is unknown, tag is free). + // We do not add fields shipToName, shipToStreet, shipToCity, shipToState, shipToCountryCode, shipToZip, shipToStreet2, phoneNum + // as they don't exists (buyer is unknown, tag is free). } @@ -685,12 +685,12 @@ if ($source == 'order') $object = $order; } - if ($action != 'dopayment') // Do not change amount if we just click on first dopayment - { - $amount=$order->total_ttc; - if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); - $amount=price2num($amount); - } + if ($action != 'dopayment') // Do not change amount if we just click on first dopayment + { + $amount=$order->total_ttc; + if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); + $amount=price2num($amount); + } $fulltag='ORD='.$order->ref.'.CUS='.$order->thirdparty->id; //$fulltag.='.NAM='.strtr($order->thirdparty->name,"-"," "); @@ -700,9 +700,9 @@ if ($source == 'order') // Creditor print ''."\n"; + print ''."\n"; // Debitor @@ -726,12 +726,12 @@ if ($source == 'order') print ''."\n"; + print ''."\n"; // Debitor @@ -841,12 +841,12 @@ if ($source == 'invoice') print ''."\n"; } - // Shipping address - $shipToName=$invoice->thirdparty->name; - $shipToStreet=$invoice->thirdparty->address; - $shipToCity=$invoice->thirdparty->town; - $shipToState=$invoice->thirdparty->state_code; - $shipToCountryCode=$invoice->thirdparty->country_code; - $shipToZip=$invoice->thirdparty->zip; - $shipToStreet2=''; - $phoneNum=$invoice->thirdparty->phone; - if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - else - { - print ''."\n"; - } - print ''."\n"; - $labeldesc=$langs->trans("Invoice").' '.$invoice->ref; - if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); - print ''."\n"; + // Shipping address + $shipToName=$invoice->thirdparty->name; + $shipToStreet=$invoice->thirdparty->address; + $shipToCity=$invoice->thirdparty->town; + $shipToState=$invoice->thirdparty->state_code; + $shipToCountryCode=$invoice->thirdparty->country_code; + $shipToZip=$invoice->thirdparty->zip; + $shipToStreet2=''; + $phoneNum=$invoice->thirdparty->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + else + { + print ''."\n"; + } + print ''."\n"; + $labeldesc=$langs->trans("Invoice").' '.$invoice->ref; + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } // Payment on contract line @@ -941,40 +941,40 @@ if ($source == 'contractline') } } - if ($action != 'dopayment') // Do not change amount if we just click on first dopayment - { - $amount=$contractline->total_ttc; + if ($action != 'dopayment') // Do not change amount if we just click on first dopayment + { + $amount=$contractline->total_ttc; - if ($contractline->fk_product && ! empty($conf->global->PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES)) - { - $product=new Product($db); - $result=$product->fetch($contractline->fk_product); + if ($contractline->fk_product && ! empty($conf->global->PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES)) + { + $product=new Product($db); + $result=$product->fetch($contractline->fk_product); - // We define price for product (TODO Put this in a method in product class) - if (! empty($conf->global->PRODUIT_MULTIPRICES)) - { - $pu_ht = $product->multiprices[$contract->thirdparty->price_level]; - $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; - $price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level]; - } - else - { - $pu_ht = $product->price; - $pu_ttc = $product->price_ttc; - $price_base_type = $product->price_base_type; - } + // We define price for product (TODO Put this in a method in product class) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) + { + $pu_ht = $product->multiprices[$contract->thirdparty->price_level]; + $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; + $price_base_type = $product->multiprices_base_type[$contract->thirdparty->price_level]; + } + else + { + $pu_ht = $product->price; + $pu_ttc = $product->price_ttc; + $price_base_type = $product->price_base_type; + } - $amount=$pu_ttc; - if (empty($amount)) - { - dol_print_error('','ErrorNoPriceDefinedForThisProduct'); - exit; - } - } + $amount=$pu_ttc; + if (empty($amount)) + { + dol_print_error('','ErrorNoPriceDefinedForThisProduct'); + exit; + } + } - if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); - $amount=price2num($amount); - } + if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); + $amount=price2num($amount); + } $fulltag='COL='.$contractline->ref.'.CON='.$contract->ref.'.CUS='.$contract->thirdparty->id.'.DAT='.dol_print_date(dol_now(),'%Y%m%d%H%M'); //$fulltag.='.NAM='.strtr($contract->thirdparty->name,"-"," "); @@ -988,7 +988,7 @@ if ($source == 'contractline') print ''."\n"; // Debitor @@ -1054,12 +1054,12 @@ if ($source == 'contractline') print ''."\n"; - // Shipping address - $shipToName=$contract->thirdparty->name; - $shipToStreet=$contract->thirdparty->address; - $shipToCity=$contract->thirdparty->town; - $shipToState=$contract->thirdparty->state_code; - $shipToCountryCode=$contract->thirdparty->country_code; - $shipToZip=$contract->thirdparty->zip; - $shipToStreet2=''; - $phoneNum=$contract->thirdparty->phone; - if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - else - { - print ''."\n"; - } - print ''."\n"; - $labeldesc=$langs->trans("Contract").' '.$contract->ref; - if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); - print ''."\n"; + // Shipping address + $shipToName=$contract->thirdparty->name; + $shipToStreet=$contract->thirdparty->address; + $shipToCity=$contract->thirdparty->town; + $shipToState=$contract->thirdparty->state_code; + $shipToCountryCode=$contract->thirdparty->country_code; + $shipToZip=$contract->thirdparty->zip; + $shipToStreet2=''; + $phoneNum=$contract->thirdparty->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + else + { + print ''."\n"; + } + print ''."\n"; + $labeldesc=$langs->trans("Contract").' '.$contract->ref; + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } // Payment on member subscription @@ -1128,12 +1128,12 @@ if ($source == 'membersubscription') $subscription=new Subscription($db); } - if ($action != 'dopayment') // Do not change amount if we just click on first dopayment - { - $amount=$subscription->total_ttc; - if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); - $amount=price2num($amount); - } + if ($action != 'dopayment') // Do not change amount if we just click on first dopayment + { + $amount=$subscription->total_ttc; + if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); + $amount=price2num($amount); + } $fulltag='MEM='.$member->id.'.DAT='.dol_print_date(dol_now(),'%Y%m%d%H%M'); if (! empty($TAG)) { $tag=$TAG; $fulltag.='.TAG='.$TAG; } @@ -1142,9 +1142,9 @@ if ($source == 'membersubscription') // Creditor print ''."\n"; + print ''."\n"; // Debitor @@ -1195,7 +1195,7 @@ if ($source == 'membersubscription') { $valtoshow=GETPOST("newamount",'int'); // force default subscription amount to value defined into constant... - if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { $valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT; } @@ -1203,21 +1203,21 @@ if ($source == 'membersubscription') else { if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; - } - } + } + } } if (empty($amount) || ! is_numeric($amount)) { - //$valtoshow=GETPOST("newamount",'int'); - if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); - print ''; - print ''; + //$valtoshow=GETPOST("newamount",'int'); + if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); + print ''; + print ''; } else { - $valtoshow=$amount; - if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); - print ''.price($valtoshow).''; - print ''; + $valtoshow=$amount; + if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); + print ''.price($valtoshow).''; + print ''; print ''; } // Currency @@ -1233,34 +1233,34 @@ if ($source == 'membersubscription') print ''; print ''."\n"; - // Shipping address - $shipToName=$member->getFullName($langs); - $shipToStreet=$member->address; - $shipToCity=$member->town; - $shipToState=$member->state_code; - $shipToCountryCode=$member->country_code; - $shipToZip=$member->zip; - $shipToStreet2=''; - $phoneNum=$member->phone; - if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - else - { - print ''."\n"; - } - print ''."\n"; - $labeldesc = $langs->trans("PaymentSubscription"); - if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); - print ''."\n"; + // Shipping address + $shipToName=$member->getFullName($langs); + $shipToStreet=$member->address; + $shipToCity=$member->town; + $shipToState=$member->state_code; + $shipToCountryCode=$member->country_code; + $shipToZip=$member->zip; + $shipToStreet2=''; + $phoneNum=$member->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + else + { + print ''."\n"; + } + print ''."\n"; + $labeldesc = $langs->trans("PaymentSubscription"); + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } @@ -1275,44 +1275,44 @@ print "\n"; if ($action != 'dopayment') { - if ($found && ! $error) // We are in a management option and no error - { - // Buttons for all payments registration methods + if ($found && ! $error) // We are in a management option and no error + { + // Buttons for all payments registration methods - if (! empty($conf->paybox->enabled)) - { - // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox - print '
        '; - } + if (! empty($conf->paybox->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox + print '
        '; + } - if (! empty($conf->stripe->enabled)) - { - // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe - print '
        '; - } + if (! empty($conf->stripe->enabled)) + { + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe + print '
        '; + } - if (! empty($conf->paypal->enabled)) - { - if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; + if (! empty($conf->paypal->enabled)) + { + if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') - { - print '
        '; - } - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') - { - print '
        '; - } - } - } - else - { - dol_print_error_email('ERRORNEWPAYMENT'); - } + if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') + { + print '
        '; + } + if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') + { + print '
        '; + } + } + } + else + { + dol_print_error_email('ERRORNEWPAYMENT'); + } } else { - // Print + // Print } print ''."\n"; @@ -1495,7 +1495,7 @@ if (preg_match('/^dopayment/',$action)) } '; + print ''; } } diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 4853c54fdd9..428f5b96f42 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -33,65 +33,65 @@ require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; */ class CompanyBankAccount extends Account { - var $socid; + var $socid; - var $default_rib; - var $frstrecur; - var $rum; - var $date_rum; + var $default_rib; + var $frstrecur; + var $rum; + var $date_rum; - var $datec; - var $datem; + var $datec; + var $datem; - /** + /** * Constructor * * @param DoliDB $db Database handler - */ - public function __construct(DoliDB $db) - { - $this->db = $db; + */ + public function __construct(DoliDB $db) + { + $this->db = $db; - $this->socid = 0; - $this->solde = 0; - $this->error_number = 0; - $this->default_rib = 0; - } + $this->socid = 0; + $this->solde = 0; + $this->error_number = 0; + $this->default_rib = 0; + } - /** - * Create bank information record - * - * @param User $user User - * @param int $notrigger 1=Disable triggers - * @return int <0 if KO, >= 0 if OK - */ - function create(User $user = null, $notrigger=0) - { - $now = dol_now(); + /** + * Create bank information record + * + * @param User $user User + * @param int $notrigger 1=Disable triggers + * @return int <0 if KO, >= 0 if OK + */ + function create(User $user = null, $notrigger=0) + { + $now = dol_now(); $error = 0; - // Correct default_rib to be sure to have always one default + // Correct default_rib to be sure to have always one default $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".$this->socid." AND default_rib = 1"; $result = $this->db->query($sql); - if ($result) - { - $numrows=$this->db->num_rows($result); - if ($this->default_rib && $numrows > 0) $this->default_rib = 0; - if (empty($this->default_rib) && $numrows == 0) $this->default_rib = 1; - } + if ($result) + { + $numrows=$this->db->num_rows($result); + if ($this->default_rib && $numrows > 0) $this->default_rib = 0; + if (empty($this->default_rib) && $numrows == 0) $this->default_rib = 1; + } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, datec)"; - $sql.= " VALUES (".$this->socid.", '".$this->db->idate($now)."')"; - $resql=$this->db->query($sql); - if ($resql) - { - if ($this->db->affected_rows($resql)) - { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_rib"); + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, datec)"; + $sql.= " VALUES (".$this->socid.", '".$this->db->idate($now)."')"; + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->affected_rows($resql)) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_rib"); - if (! $notrigger) - { + if (! $notrigger) + { // Call trigger $result=$this->call_trigger('COMPANY_RIB_CREATE',$user); if ($result < 0) $error++; @@ -105,64 +105,64 @@ class CompanyBankAccount extends Account { return 0; } - } - else - { - return 1; - } - } - } - else - { - print $this->db->error(); - return 0; - } - } + } + else + { + return 1; + } + } + } + else + { + print $this->db->error(); + return 0; + } + } - /** - * Update bank account - * - * @param User $user Object user - * @param int $notrigger 1=Disable triggers - * @return int <=0 if KO, >0 if OK - */ - function update(User $user = null, $notrigger = 0) - { - global $conf; - $error = 0; + /** + * Update bank account + * + * @param User $user Object user + * @param int $notrigger 1=Disable triggers + * @return int <=0 if KO, >0 if OK + */ + function update(User $user = null, $notrigger = 0) + { + global $conf; + $error = 0; - if (! $this->id) return -1; + if (! $this->id) return -1; - if (dol_strlen($this->domiciliation) > 255) $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1); + if (dol_strlen($this->domiciliation) > 255) $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1); if (dol_strlen($this->owner_address) > 255) $this->owner_address = dol_trunc($this->owner_address, 254, 'right', 'UTF-8', 1); - $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET"; - $sql.= " bank = '" .$this->db->escape($this->bank)."'"; - $sql.= ",code_banque='".$this->db->escape($this->code_banque)."'"; - $sql.= ",code_guichet='".$this->db->escape($this->code_guichet)."'"; - $sql.= ",number='".$this->db->escape($this->number)."'"; - $sql.= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; - $sql.= ",bic='".$this->db->escape($this->bic)."'"; - $sql.= ",iban_prefix = '".$this->db->escape($this->iban)."'"; - $sql.= ",domiciliation='".$this->db->escape($this->domiciliation)."'"; - $sql.= ",proprio = '".$this->db->escape($this->proprio)."'"; - $sql.= ",owner_address = '".$this->db->escape($this->owner_address)."'"; - $sql.= ",default_rib = ".$this->default_rib; - if ($conf->prelevement->enabled) - { - $sql.= ",frstrecur = '".$this->db->escape($this->frstrecur)."'"; - $sql.= ",rum = '".$this->db->escape($this->rum)."'"; - $sql.= ",date_rum = ".($this->date_rum ? "'".$this->db->idate($this->date_rum)."'" : "null"); - } - if (trim($this->label) != '') - $sql.= ",label = '".$this->db->escape($this->label)."'"; - else - $sql.= ",label = NULL"; - $sql.= " WHERE rowid = ".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET"; + $sql.= " bank = '" .$this->db->escape($this->bank)."'"; + $sql.= ",code_banque='".$this->db->escape($this->code_banque)."'"; + $sql.= ",code_guichet='".$this->db->escape($this->code_guichet)."'"; + $sql.= ",number='".$this->db->escape($this->number)."'"; + $sql.= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; + $sql.= ",bic='".$this->db->escape($this->bic)."'"; + $sql.= ",iban_prefix = '".$this->db->escape($this->iban)."'"; + $sql.= ",domiciliation='".$this->db->escape($this->domiciliation)."'"; + $sql.= ",proprio = '".$this->db->escape($this->proprio)."'"; + $sql.= ",owner_address = '".$this->db->escape($this->owner_address)."'"; + $sql.= ",default_rib = ".$this->default_rib; + if ($conf->prelevement->enabled) + { + $sql.= ",frstrecur = '".$this->db->escape($this->frstrecur)."'"; + $sql.= ",rum = '".$this->db->escape($this->rum)."'"; + $sql.= ",date_rum = ".($this->date_rum ? "'".$this->db->idate($this->date_rum)."'" : "null"); + } + if (trim($this->label) != '') + $sql.= ",label = '".$this->db->escape($this->label)."'"; + else + $sql.= ",label = NULL"; + $sql.= " WHERE rowid = ".$this->id; - $result = $this->db->query($sql); - if ($result) - { + $result = $this->db->query($sql); + if ($result) + { if (! $notrigger) @@ -185,118 +185,118 @@ class CompanyBankAccount extends Account return 1; } - } - else - { - dol_print_error($this->db); - return -1; - } - } + } + else + { + dol_print_error($this->db); + return -1; + } + } - /** - * Load record from database - * - * @param int $id Id of record - * @param int $socid Id of company. If this is filled, function will return the default RIB of company - * @return int <0 if KO, >0 if OK - */ - function fetch($id, $socid=0) - { - if (empty($id) && empty($socid)) return -1; + /** + * Load record from database + * + * @param int $id Id of record + * @param int $socid Id of company. If this is filled, function will return the default RIB of company + * @return int <0 if KO, >0 if OK + */ + function fetch($id, $socid=0) + { + if (empty($id) && empty($socid)) return -1; - $sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; - $sql.= " owner_address, default_rib, label, datec, tms as datem, rum, frstrecur"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe_rib"; - if ($id) $sql.= " WHERE rowid = ".$id; - if ($socid) $sql.= " WHERE fk_soc = ".$socid." AND default_rib = 1"; + $sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,"; + $sql.= " owner_address, default_rib, label, datec, tms as datem, rum, frstrecur"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe_rib"; + if ($id) $sql.= " WHERE rowid = ".$id; + if ($socid) $sql.= " WHERE fk_soc = ".$socid." AND default_rib = 1"; - $resql = $this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); + $resql = $this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); - $this->ref = $obj->fk_soc.'-'.$obj->label; // Generate an artificial ref + $this->ref = $obj->fk_soc.'-'.$obj->label; // Generate an artificial ref - $this->id = $obj->rowid; - $this->socid = $obj->fk_soc; - $this->bank = $obj->bank; - $this->code_banque = $obj->code_banque; - $this->code_guichet = $obj->code_guichet; - $this->number = $obj->number; - $this->cle_rib = $obj->cle_rib; - $this->bic = $obj->bic; - $this->iban = $obj->iban; - $this->domiciliation = $obj->domiciliation; - $this->proprio = $obj->proprio; - $this->owner_address = $obj->owner_address; - $this->label = $obj->label; - $this->default_rib = $obj->default_rib; - $this->datec = $this->db->jdate($obj->datec); - $this->datem = $this->db->jdate($obj->datem); - $this->rum = $obj->rum; - $this->frstrecur = $obj->frstrecur; - } - $this->db->free($resql); + $this->id = $obj->rowid; + $this->socid = $obj->fk_soc; + $this->bank = $obj->bank; + $this->code_banque = $obj->code_banque; + $this->code_guichet = $obj->code_guichet; + $this->number = $obj->number; + $this->cle_rib = $obj->cle_rib; + $this->bic = $obj->bic; + $this->iban = $obj->iban; + $this->domiciliation = $obj->domiciliation; + $this->proprio = $obj->proprio; + $this->owner_address = $obj->owner_address; + $this->label = $obj->label; + $this->default_rib = $obj->default_rib; + $this->datec = $this->db->jdate($obj->datec); + $this->datem = $this->db->jdate($obj->datem); + $this->rum = $obj->rum; + $this->frstrecur = $obj->frstrecur; + } + $this->db->free($resql); - return 1; - } - else - { - dol_print_error($this->db); - return -1; - } - } + return 1; + } + else + { + dol_print_error($this->db); + return -1; + } + } - /** - * Delete a rib from database - * - * @param User $user User deleting - * @param int $notrigger 1=Disable triggers - * @return int <0 if KO, >0 if OK - */ - function delete(User $user = null, $notrigger=0) - { - global $conf; + /** + * Delete a rib from database + * + * @param User $user User deleting + * @param int $notrigger 1=Disable triggers + * @return int <0 if KO, >0 if OK + */ + function delete(User $user = null, $notrigger=0) + { + global $conf; - $error = 0; + $error = 0; - dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); + dol_syslog(get_class($this) . "::delete ".$this->id, LOG_DEBUG); - $this->db->begin(); + $this->db->begin(); - if (! $error && ! $notrigger) - { - // Call trigger - $result=$this->call_trigger('COMPANY_RIB_DELETE',$user); - if ($result < 0) $error++; - // End call triggers - } + if (! $error && ! $notrigger) + { + // Call trigger + $result=$this->call_trigger('COMPANY_RIB_DELETE',$user); + if ($result < 0) $error++; + // End call triggers + } - if (! $error) - { - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_rib"; - $sql .= " WHERE rowid = " . $this->id; + if (! $error) + { + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_rib"; + $sql .= " WHERE rowid = " . $this->id; - if (! $this->db->query($sql)) - { - $error++; - $this->errors[]=$this->db->lasterror(); - } - } + if (! $this->db->query($sql)) + { + $error++; + $this->errors[]=$this->db->lasterror(); + } + } - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1*$error; - } - } + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1*$error; + } + } /** * Return RIB @@ -320,93 +320,93 @@ class CompanyBankAccount extends Account return $rib; } - /** - * Set RIB as Default - * - * @param int $rib RIB id - * @return int 0 if KO, 1 if OK - */ - function setAsDefault($rib=0) - { - $sql1 = "SELECT rowid as id, fk_soc FROM ".MAIN_DB_PREFIX."societe_rib"; - $sql1.= " WHERE rowid = ".($rib?$rib:$this->id); + /** + * Set RIB as Default + * + * @param int $rib RIB id + * @return int 0 if KO, 1 if OK + */ + function setAsDefault($rib=0) + { + $sql1 = "SELECT rowid as id, fk_soc FROM ".MAIN_DB_PREFIX."societe_rib"; + $sql1.= " WHERE rowid = ".($rib?$rib:$this->id); - dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); - $result1 = $this->db->query($sql1); - if ($result1) - { - if ($this->db->num_rows($result1) == 0) - { - return 0; - } - else - { - $obj = $this->db->fetch_object($result1); + dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); + $result1 = $this->db->query($sql1); + if ($result1) + { + if ($this->db->num_rows($result1) == 0) + { + return 0; + } + else + { + $obj = $this->db->fetch_object($result1); - $this->db->begin(); + $this->db->begin(); - $sql2 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 0 "; - $sql2.= "WHERE fk_soc = ".$obj->fk_soc; - dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); - $result2 = $this->db->query($sql2); + $sql2 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 0 "; + $sql2.= "WHERE fk_soc = ".$obj->fk_soc; + dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); + $result2 = $this->db->query($sql2); - $sql3 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 1 "; - $sql3.= "WHERE rowid = ".$obj->id; - dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); - $result3 = $this->db->query($sql3); + $sql3 = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET default_rib = 1 "; + $sql3.= "WHERE rowid = ".$obj->id; + dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); + $result3 = $this->db->query($sql3); - if (!$result2 || !$result3) - { - dol_print_error($this->db); - $this->db->rollback(); - return -1; - } - else - { - $this->db->commit(); - return 1; - } - } - } - else - { - dol_print_error($this->db); - return -1; - } - } + if (!$result2 || !$result3) + { + dol_print_error($this->db); + $this->db->rollback(); + return -1; + } + else + { + $this->db->commit(); + return 1; + } + } + } + else + { + dol_print_error($this->db); + return -1; + } + } - /** - * Initialise an instance with random values. - * Used to build previews or test instances. - * id must be 0 if object instance is a specimen. - * - * @return void - */ - function initAsSpecimen() - { - $this->specimen = 1; - $this->ref = 'CBA'; - $this->label = 'CustomerCorp Bank account'; - $this->bank = 'CustomerCorp Bank'; - $this->courant = Account::TYPE_CURRENT; - $this->clos = Account::STATUS_OPEN; - $this->code_banque = '123'; - $this->code_guichet = '456'; - $this->number = 'CUST12345'; - $this->cle_rib = 50; - $this->bic = 'CC12'; - $this->iban = 'FR999999999'; - $this->domiciliation = 'Bank address of customer corp'; - $this->proprio = 'Owner'; - $this->owner_address = 'Owner address'; - $this->country_id = 1; + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void + */ + function initAsSpecimen() + { + $this->specimen = 1; + $this->ref = 'CBA'; + $this->label = 'CustomerCorp Bank account'; + $this->bank = 'CustomerCorp Bank'; + $this->courant = Account::TYPE_CURRENT; + $this->clos = Account::STATUS_OPEN; + $this->code_banque = '123'; + $this->code_guichet = '456'; + $this->number = 'CUST12345'; + $this->cle_rib = 50; + $this->bic = 'CC12'; + $this->iban = 'FR999999999'; + $this->domiciliation = 'Bank address of customer corp'; + $this->proprio = 'Owner'; + $this->owner_address = 'Owner address'; + $this->country_id = 1; - $this->rum = 'UMR-CU1212-0007-5-1475405262'; - $this->date_rum =dol_now() - 10000; - $this->frstrecur = 'FRST'; + $this->rum = 'UMR-CU1212-0007-5-1475405262'; + $this->date_rum =dol_now() - 10000; + $this->frstrecur = 'FRST'; - $this->socid = 0; - } + $this->socid = 0; + } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d1d218a0061..ed0cd57ba76 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -40,28 +40,28 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; */ class Societe extends CommonObject { - public $element='societe'; - public $table_element = 'societe'; + public $element='societe'; + public $table_element = 'societe'; public $fk_element='fk_soc'; - protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object + protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm"); /** - * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - * @var int - */ - protected $ismultientitymanaged = 1; + * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + * @var int + */ + protected $ismultientitymanaged = 1; - public $entity; + public $entity; - /** - * Thirdparty name - * @var string - * @deprecated Use $name instead - * @see name - */ - public $nom; + /** + * Thirdparty name + * @var string + * @deprecated Use $name instead + * @see name + */ + public $nom; /** * Alias names (commercial, trademark or alias names) @@ -69,46 +69,46 @@ class Societe extends CommonObject */ public $name_alias; - public $particulier; - public $address; - public $zip; - public $town; + public $particulier; + public $address; + public $zip; + public $town; - /** - * Thirdparty status : 0=activity ceased, 1= in activity - * @var int - */ - var $status; + /** + * Thirdparty status : 0=activity ceased, 1= in activity + * @var int + */ + var $status; - /** - * Id of department - * @var int - */ - var $state_id; - var $state_code; - var $state; + /** + * Id of department + * @var int + */ + var $state_id; + var $state_code; + var $state; - /** - * State code - * @var string - * @deprecated Use state_code instead - * @see state_code - */ - var $departement_code; + /** + * State code + * @var string + * @deprecated Use state_code instead + * @see state_code + */ + var $departement_code; - /** - * @var string - * @deprecated Use state instead - * @see state - */ - var $departement; + /** + * @var string + * @deprecated Use state instead + * @see state + */ + var $departement; - /** - * @var string - * @deprecated Use country instead - * @see country - */ - var $pays; + /** + * @var string + * @deprecated Use country instead + * @see country + */ + var $pays; /** * Phone number @@ -137,77 +137,77 @@ class Societe extends CommonObject var $url; //! barcode - /** - * Barcode value - * @var string - */ - var $barcode; + /** + * Barcode value + * @var string + */ + var $barcode; - // 6 professional id (usage depends on country) + // 6 professional id (usage depends on country) - /** - * Professional ID 1 (Ex: Siren in France) - * @var string - */ - var $idprof1; + /** + * Professional ID 1 (Ex: Siren in France) + * @var string + */ + var $idprof1; - /** - * Professional ID 2 (Ex: Siret in France) - * @var string - */ - var $idprof2; + /** + * Professional ID 2 (Ex: Siret in France) + * @var string + */ + var $idprof2; - /** - * Professional ID 3 (Ex: Ape in France) - * @var string - */ - var $idprof3; + /** + * Professional ID 3 (Ex: Ape in France) + * @var string + */ + var $idprof3; - /** - * Professional ID 4 (Ex: RCS in France) - * @var string - */ - var $idprof4; + /** + * Professional ID 4 (Ex: RCS in France) + * @var string + */ + var $idprof4; - /** - * Professional ID 5 - * @var string - */ - var $idprof5; + /** + * Professional ID 5 + * @var string + */ + var $idprof5; - /** - * Professional ID 6 - * @var string - */ - var $idprof6; + /** + * Professional ID 6 + * @var string + */ + var $idprof6; - var $prefix_comm; + var $prefix_comm; - var $tva_assuj; - /** - * Intracommunitary VAT ID - * @var string - */ - var $tva_intra; + var $tva_assuj; + /** + * Intracommunitary VAT ID + * @var string + */ + var $tva_intra; - // Local taxes - var $localtax1_assuj; - var $localtax1_value; - var $localtax2_assuj; - var $localtax2_value; + // Local taxes + var $localtax1_assuj; + var $localtax1_value; + var $localtax2_assuj; + var $localtax2_value; - var $managers; - var $capital; - var $typent_id; - var $typent_code; - var $effectif; - var $effectif_id; - var $forme_juridique_code; - var $forme_juridique; + var $managers; + var $capital; + var $typent_id; + var $typent_code; + var $effectif; + var $effectif_id; + var $forme_juridique_code; + var $forme_juridique; - var $remise_percent; - var $mode_reglement_supplier_id; - var $cond_reglement_supplier_id; + var $remise_percent; + var $mode_reglement_supplier_id; + var $cond_reglement_supplier_id; var $fk_prospectlevel; var $name_bis; @@ -215,149 +215,149 @@ class Societe extends CommonObject /** * Date of last update - * @var string + * @var string */ var $date_modification; /** * User that made last update - * @var string + * @var string */ var $user_modification; /** * Date of creation - * @var string + * @var string */ var $date_creation; /** * User that created the thirdparty - * @var User + * @var User */ var $user_creation; - var $specimen; + var $specimen; - /** - * 0=no customer, 1=customer, 2=prospect, 3=customer and prospect - * @var int - */ - var $client; - /** - * 0=no prospect, 1=prospect - * @var int - */ - var $prospect; - /** - * 0=no supplier, 1=supplier - * @var int - */ - var $fournisseur; + /** + * 0=no customer, 1=customer, 2=prospect, 3=customer and prospect + * @var int + */ + var $client; + /** + * 0=no prospect, 1=prospect + * @var int + */ + var $prospect; + /** + * 0=no supplier, 1=supplier + * @var int + */ + var $fournisseur; - /** - * Client code. E.g: CU2014-003 - * @var string - */ - var $code_client; + /** + * Client code. E.g: CU2014-003 + * @var string + */ + var $code_client; - /** - * Supplier code. E.g: SU2014-003 - * @var string - */ - var $code_fournisseur; + /** + * Supplier code. E.g: SU2014-003 + * @var string + */ + var $code_fournisseur; - /** - * Accounting code for client - * @var string - */ - var $code_compta; + /** + * Accounting code for client + * @var string + */ + var $code_compta; - /** - * Accounting code for suppliers - * @var string - */ - var $code_compta_fournisseur; + /** + * Accounting code for suppliers + * @var string + */ + var $code_compta_fournisseur; - /** - * @var string - * @deprecated Note is split in public and private notes - * @see note_public, note_private - */ - var $note; + /** + * @var string + * @deprecated Note is split in public and private notes + * @see note_public, note_private + */ + var $note; - /** - * Private note - * @var string - */ - var $note_private; + /** + * Private note + * @var string + */ + var $note_private; - /** - * Public note - * @var string - */ - var $note_public; + /** + * Public note + * @var string + */ + var $note_public; - //! code statut prospect - var $stcomm_id; - var $statut_commercial; + //! code statut prospect + var $stcomm_id; + var $statut_commercial; - /** - * Assigned price level - * @var int - */ - var $price_level; - var $outstanding_limit; + /** + * Assigned price level + * @var int + */ + var $price_level; + var $outstanding_limit; - /** - * Id of sales representative to link (used for thirdparty creation). Not filled by a fetch, because we can have several sales representatives. - * @var int - */ - var $commercial_id; - /** - * Id of parent thirdparty (if one) - * @var int - */ - var $parent; - /** - * Default language code of thirdparty (en_US, ...) - * @var string - */ - var $default_lang; + /** + * Id of sales representative to link (used for thirdparty creation). Not filled by a fetch, because we can have several sales representatives. + * @var int + */ + var $commercial_id; + /** + * Id of parent thirdparty (if one) + * @var int + */ + var $parent; + /** + * Default language code of thirdparty (en_US, ...) + * @var string + */ + var $default_lang; - var $ref; - var $ref_int; - /** - * External user reference. - * This is to allow external systems to store their id and make self-developed synchronizing functions easier to - * build. - * @var string - */ - var $ref_ext; + var $ref; + var $ref_int; + /** + * External user reference. + * This is to allow external systems to store their id and make self-developed synchronizing functions easier to + * build. + * @var string + */ + var $ref_ext; - /** - * Import key. - * Set when the thirdparty has been created through an import process. This is to relate those created thirdparties - * to an import process - * @var string - */ - var $import_key; + /** + * Import key. + * Set when the thirdparty has been created through an import process. This is to relate those created thirdparties + * to an import process + * @var string + */ + var $import_key; - /** - * Supplier WebServices URL - * @var string - */ - var $webservices_url; + /** + * Supplier WebServices URL + * @var string + */ + var $webservices_url; - /** - * Supplier WebServices Key - * @var string - */ - var $webservices_key; + /** + * Supplier WebServices Key + * @var string + */ + var $webservices_key; - var $logo; - var $logo_small; - var $logo_mini; + var $logo; + var $logo_small; + var $logo_mini; - var $array_options; + var $array_options; // Incoterms var $fk_incoterms; @@ -368,53 +368,53 @@ class Societe extends CommonObject var $fk_multicurrency; var $multicurrency_code; - /** - * To contains a clone of this when we need to save old properties of object - * @var Societe - */ - var $oldcopy; + /** + * To contains a clone of this when we need to save old properties of object + * @var Societe + */ + var $oldcopy; - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; - $this->client = 0; - $this->prospect = 0; - $this->fournisseur = 0; - $this->typent_id = 0; - $this->effectif_id = 0; - $this->forme_juridique_code = 0; - $this->tva_assuj = 1; - $this->status = 1; - } + $this->client = 0; + $this->prospect = 0; + $this->fournisseur = 0; + $this->typent_id = 0; + $this->effectif_id = 0; + $this->forme_juridique_code = 0; + $this->tva_assuj = 1; + $this->status = 1; + } - /** - * Create third party in database. - * $this->code_client = -1 and $this->code_fournisseur = -1 means automatic assignement. - * - * @param User $user Object of user that ask creation - * @return int >= 0 if OK, < 0 if KO - */ - function create($user) - { - global $langs,$conf,$mysoc; + /** + * Create third party in database. + * $this->code_client = -1 and $this->code_fournisseur = -1 means automatic assignement. + * + * @param User $user Object of user that ask creation + * @return int >= 0 if OK, < 0 if KO + */ + function create($user) + { + global $langs,$conf,$mysoc; $error=0; - // Clean parameters - if (empty($this->status)) $this->status=0; - $this->name=$this->name?trim($this->name):trim($this->nom); - if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name=ucwords($this->name); - $this->nom=$this->name; // For backward compatibility - if (empty($this->client)) $this->client=0; - if (empty($this->fournisseur)) $this->fournisseur=0; - $this->import_key = trim($this->import_key); + // Clean parameters + if (empty($this->status)) $this->status=0; + $this->name=$this->name?trim($this->name):trim($this->nom); + if (! empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->name=ucwords($this->name); + $this->nom=$this->name; // For backward compatibility + if (empty($this->client)) $this->client=0; + if (empty($this->fournisseur)) $this->fournisseur=0; + $this->import_key = trim($this->import_key); if (!empty($this->multicurrency_code)) $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) @@ -423,333 +423,333 @@ class Societe extends CommonObject $this->fk_multicurrency = 0; } - dol_syslog(get_class($this)."::create ".$this->name); + dol_syslog(get_class($this)."::create ".$this->name); - $now=dol_now(); + $now=dol_now(); - $this->db->begin(); + $this->db->begin(); - // For automatic creation during create action (not used by Dolibarr GUI, can be used by scripts) - if ($this->code_client == -1) $this->get_codeclient($this,0); - if ($this->code_fournisseur == -1) $this->get_codefournisseur($this,1); + // For automatic creation during create action (not used by Dolibarr GUI, can be used by scripts) + if ($this->code_client == -1) $this->get_codeclient($this,0); + if ($this->code_fournisseur == -1) $this->get_codefournisseur($this,1); - // Check more parameters (including mandatory setup - // If error, this->errors[] is filled - $result = $this->verify(); + // Check more parameters (including mandatory setup + // If error, this->errors[] is filled + $result = $this->verify(); - if ($result >= 0) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)"; - $sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$conf->entity.", '".$this->db->idate($now)."'"; - $sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null"); - $sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null"); - $sql.= ", ".$this->status; - $sql.= ", ".(! empty($this->ref_int) ? "'".$this->db->escape($this->ref_int)."'":"null"); - $sql.= ", ".(! empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'":"null"); - $sql.= ", 0"; + if ($result >= 0) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)"; + $sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$conf->entity.", '".$this->db->idate($now)."'"; + $sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null"); + $sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null"); + $sql.= ", ".$this->status; + $sql.= ", ".(! empty($this->ref_int) ? "'".$this->db->escape($this->ref_int)."'":"null"); + $sql.= ", ".(! empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'":"null"); + $sql.= ", 0"; $sql.= ", ".(int) $this->fk_incoterms; $sql.= ", '".$this->db->escape($this->location_incoterms)."'"; - $sql.= ", ".(! empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'":"null"); - $sql.= ", ".(int) $this->fk_multicurrency; - $sql.= ", '".$this->db->escape($this->multicurrency_code)."')"; + $sql.= ", ".(! empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'":"null"); + $sql.= ", ".(int) $this->fk_multicurrency; + $sql.= ", '".$this->db->escape($this->multicurrency_code)."')"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $result=$this->db->query($sql); - if ($result) - { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe"); + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $result=$this->db->query($sql); + if ($result) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe"); - $ret = $this->update($this->id,$user,0,1,1,'add'); + $ret = $this->update($this->id,$user,0,1,1,'add'); - // Ajout du commercial affecte - if ($this->commercial_id != '' && $this->commercial_id != -1) - { - $this->add_commercial($user, $this->commercial_id); - } - // si un commercial cree un client il lui est affecte automatiquement - else if (empty($user->rights->societe->client->voir)) - { - $this->add_commercial($user, $user->id); - } + // Ajout du commercial affecte + if ($this->commercial_id != '' && $this->commercial_id != -1) + { + $this->add_commercial($user, $this->commercial_id); + } + // si un commercial cree un client il lui est affecte automatiquement + else if (empty($user->rights->societe->client->voir)) + { + $this->add_commercial($user, $user->id); + } - if ($ret >= 0) - { - // Call trigger - $result=$this->call_trigger('COMPANY_CREATE',$user); - if ($result < 0) $error++; - // End call triggers - } - else $error++; + if ($ret >= 0) + { + // Call trigger + $result=$this->call_trigger('COMPANY_CREATE',$user); + if ($result < 0) $error++; + // End call triggers + } + else $error++; - if (! $error) - { - dol_syslog(get_class($this)."::Create success id=".$this->id); - $this->db->commit(); - return $this->id; - } - else - { - dol_syslog(get_class($this)."::Create echec update ".$this->error." ".join(',',$this->errors), LOG_ERR); - $this->db->rollback(); - return -4; - } - } - else - { - if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->name); // duplicate on a field (code or profid or ...) - $result=-1; - } - else - { - $this->error=$this->db->lasterror(); - $result=-2; - } - $this->db->rollback(); - return $result; - } + if (! $error) + { + dol_syslog(get_class($this)."::Create success id=".$this->id); + $this->db->commit(); + return $this->id; + } + else + { + dol_syslog(get_class($this)."::Create echec update ".$this->error." ".join(',',$this->errors), LOG_ERR); + $this->db->rollback(); + return -4; + } + } + else + { + if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->name); // duplicate on a field (code or profid or ...) + $result=-1; + } + else + { + $this->error=$this->db->lasterror(); + $result=-2; + } + $this->db->rollback(); + return $result; + } - } - else - { - $this->db->rollback(); - dol_syslog(get_class($this)."::Create fails verify ".join(',',$this->errors), LOG_WARNING); - return -3; - } - } + } + else + { + $this->db->rollback(); + dol_syslog(get_class($this)."::Create fails verify ".join(',',$this->errors), LOG_WARNING); + return -3; + } + } - /** - * Create a contact/address from thirdparty - * - * @param User $user Object user - * @return int <0 if KO, >0 if OK - */ - function create_individual(User $user) - { - require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; - $contact=new Contact($this->db); + /** + * Create a contact/address from thirdparty + * + * @param User $user Object user + * @return int <0 if KO, >0 if OK + */ + function create_individual(User $user) + { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $contact=new Contact($this->db); - $contact->name = $this->name_bis; - $contact->firstname = $this->firstname; - $contact->civility_id = $this->civility_id; - $contact->socid = $this->id; // fk_soc - $contact->statut = 1; - $contact->priv = 0; - $contact->country_id = $this->country_id; - $contact->state_id = $this->state_id; - $contact->address = $this->address; - $contact->email = $this->email; - $contact->zip = $this->zip; - $contact->town = $this->town; - $contact->phone_pro = $this->phone; + $contact->name = $this->name_bis; + $contact->firstname = $this->firstname; + $contact->civility_id = $this->civility_id; + $contact->socid = $this->id; // fk_soc + $contact->statut = 1; + $contact->priv = 0; + $contact->country_id = $this->country_id; + $contact->state_id = $this->state_id; + $contact->address = $this->address; + $contact->email = $this->email; + $contact->zip = $this->zip; + $contact->town = $this->town; + $contact->phone_pro = $this->phone; - $result = $contact->create($user); - if ($result < 0) - { - $this->error = $contact->error; - $this->errors = $contact->errors; - dol_syslog(get_class($this)."::create_individual ERROR:" . $this->error, LOG_ERR); - } + $result = $contact->create($user); + if ($result < 0) + { + $this->error = $contact->error; + $this->errors = $contact->errors; + dol_syslog(get_class($this)."::create_individual ERROR:" . $this->error, LOG_ERR); + } - return $result; - } + return $result; + } - /** - * Check properties of third party are ok (like name, third party codes, ...) - * Used before an add or update. - * - * @return int 0 if OK, <0 if KO - */ - function verify() - { - global $conf, $langs, $mysoc; + /** + * Check properties of third party are ok (like name, third party codes, ...) + * Used before an add or update. + * + * @return int 0 if OK, <0 if KO + */ + function verify() + { + global $conf, $langs, $mysoc; - $error = 0; - $this->errors=array(); + $error = 0; + $this->errors=array(); - $result = 0; - $this->name = trim($this->name); - $this->nom=$this->name; // For backward compatibility + $result = 0; + $this->name = trim($this->name); + $this->nom=$this->name; // For backward compatibility - if (! $this->name) - { - $this->errors[] = 'ErrorBadThirdPartyName'; - $result = -2; - } + if (! $this->name) + { + $this->errors[] = 'ErrorBadThirdPartyName'; + $result = -2; + } - if ($this->client) - { - $rescode = $this->check_codeclient(); - if ($rescode <> 0) - { - if ($rescode == -1) - { - $this->errors[] = 'ErrorBadCustomerCodeSyntax'; - } - if ($rescode == -2) - { - $this->errors[] = 'ErrorCustomerCodeRequired'; - } - if ($rescode == -3) - { - $this->errors[] = 'ErrorCustomerCodeAlreadyUsed'; - } - if ($rescode == -4) - { - $this->errors[] = 'ErrorPrefixRequired'; - } - $result = -3; - } - } + if ($this->client) + { + $rescode = $this->check_codeclient(); + if ($rescode <> 0) + { + if ($rescode == -1) + { + $this->errors[] = 'ErrorBadCustomerCodeSyntax'; + } + if ($rescode == -2) + { + $this->errors[] = 'ErrorCustomerCodeRequired'; + } + if ($rescode == -3) + { + $this->errors[] = 'ErrorCustomerCodeAlreadyUsed'; + } + if ($rescode == -4) + { + $this->errors[] = 'ErrorPrefixRequired'; + } + $result = -3; + } + } - if ($this->fournisseur) - { - $rescode = $this->check_codefournisseur(); - if ($rescode <> 0) - { - if ($rescode == -1) - { - $this->errors[] = 'ErrorBadSupplierCodeSyntax'; - } - if ($rescode == -2) - { - $this->errors[] = 'ErrorSupplierCodeRequired'; - } - if ($rescode == -3) - { - $this->errors[] = 'ErrorSupplierCodeAlreadyUsed'; - } - if ($rescode == -5) - { - $this->errors[] = 'ErrorprefixRequired'; - } - $result = -3; - } - } + if ($this->fournisseur) + { + $rescode = $this->check_codefournisseur(); + if ($rescode <> 0) + { + if ($rescode == -1) + { + $this->errors[] = 'ErrorBadSupplierCodeSyntax'; + } + if ($rescode == -2) + { + $this->errors[] = 'ErrorSupplierCodeRequired'; + } + if ($rescode == -3) + { + $this->errors[] = 'ErrorSupplierCodeAlreadyUsed'; + } + if ($rescode == -5) + { + $this->errors[] = 'ErrorprefixRequired'; + } + $result = -3; + } + } - // Check for duplicate or mandatory fields defined into setup - $array_to_check=array('IDPROF1','IDPROF2','IDPROF3','IDPROF4','IDPROF5','IDPROF6','EMAIL'); - foreach($array_to_check as $key) - { - $keymin=strtolower($key); - $i=(int) preg_replace('/[^0-9]/','',$key); - $vallabel=$this->$keymin; + // Check for duplicate or mandatory fields defined into setup + $array_to_check=array('IDPROF1','IDPROF2','IDPROF3','IDPROF4','IDPROF5','IDPROF6','EMAIL'); + foreach($array_to_check as $key) + { + $keymin=strtolower($key); + $i=(int) preg_replace('/[^0-9]/','',$key); + $vallabel=$this->$keymin; - if ($i > 0) - { - if ($this->isACompany()) - { - // Check for unicity - if ($vallabel && $this->id_prof_verifiable($i)) - { - if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) - { - $langs->load("errors"); - $error++; $this->errors[] = $langs->transcountry('ProfId'.$i, $this->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; - } - } + if ($i > 0) + { + if ($this->isACompany()) + { + // Check for unicity + if ($vallabel && $this->id_prof_verifiable($i)) + { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) + { + $langs->load("errors"); + $error++; $this->errors[] = $langs->transcountry('ProfId'.$i, $this->country_code)." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } - // Check for mandatory prof id (but only if country is other than ours) - if ($mysoc->country_id > 0 && $this->country_id == $mysoc->country_id) - { - $idprof_mandatory ='SOCIETE_'.$key.'_MANDATORY'; - if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) - { - $langs->load("errors"); - $error++; - $this->errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $this->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')'; - } - } - } - } - else - { - //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); - if ($key == 'EMAIL') - { - // Check for unicity - if ($vallabel) - { - if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) - { - $langs->load("errors"); - $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; - } - } + // Check for mandatory prof id (but only if country is other than ours) + if ($mysoc->country_id > 0 && $this->country_id == $mysoc->country_id) + { + $idprof_mandatory ='SOCIETE_'.$key.'_MANDATORY'; + if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) + { + $langs->load("errors"); + $error++; + $this->errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $this->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } + } + } + else + { + //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); + if ($key == 'EMAIL') + { + // Check for unicity + if ($vallabel) + { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) + { + $langs->load("errors"); + $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } - // Check for mandatory - if (! empty($conf->global->SOCIETE_EMAIL_MANDATORY) && ! isValidEMail($this->email)) - { - $langs->load("errors"); - $error++; - $this->errors[] = $langs->trans("ErrorBadEMail", $this->email).' ('.$langs->trans("ForbiddenBySetupRules").')'; - } - } - } - } + // Check for mandatory + if (! empty($conf->global->SOCIETE_EMAIL_MANDATORY) && ! isValidEMail($this->email)) + { + $langs->load("errors"); + $error++; + $this->errors[] = $langs->trans("ErrorBadEMail", $this->email).' ('.$langs->trans("ForbiddenBySetupRules").')'; + } + } + } + } - if ($error) $result = -4; + if ($error) $result = -4; - return $result; - } + return $result; + } - /** - * Update parameters of third party - * - * @param int $id id societe - * @param User $user Utilisateur qui demande la mise a jour - * @param int $call_trigger 0=non, 1=oui - * @param int $allowmodcodeclient Inclut modif code client et code compta - * @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur - * @param string $action 'add' or 'update' - * @param int $nosyncmember Do not synchronize info of linked member - * @return int <0 if KO, >=0 if OK - */ - function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0, $action='update', $nosyncmember=1) - { - global $langs,$conf,$hookmanager; - require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + /** + * Update parameters of third party + * + * @param int $id id societe + * @param User $user Utilisateur qui demande la mise a jour + * @param int $call_trigger 0=non, 1=oui + * @param int $allowmodcodeclient Inclut modif code client et code compta + * @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur + * @param string $action 'add' or 'update' + * @param int $nosyncmember Do not synchronize info of linked member + * @return int <0 if KO, >=0 if OK + */ + function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0, $action='update', $nosyncmember=1) + { + global $langs,$conf,$hookmanager; + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $error=0; - dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); + dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur); - $now=dol_now(); + $now=dol_now(); - // Clean parameters - $this->id = $id; - $this->name = $this->name?trim($this->name):trim($this->nom); - $this->nom = $this->name; // For backward compatibility - $this->name_alias = trim($this->name_alias); - $this->ref_ext = trim($this->ref_ext); - $this->address = $this->address?trim($this->address):trim($this->address); - $this->zip = $this->zip?trim($this->zip):trim($this->zip); - $this->town = $this->town?trim($this->town):trim($this->town); - $this->state_id = trim($this->state_id); - $this->country_id = ($this->country_id > 0)?$this->country_id:0; - $this->phone = trim($this->phone); - $this->phone = preg_replace("/\s/","",$this->phone); - $this->phone = preg_replace("/\./","",$this->phone); - $this->fax = trim($this->fax); - $this->fax = preg_replace("/\s/","",$this->fax); - $this->fax = preg_replace("/\./","",$this->fax); - $this->email = trim($this->email); - $this->skype = trim($this->skype); - $this->url = $this->url?clean_url($this->url,0):''; - $this->idprof1 = trim($this->idprof1); - $this->idprof2 = trim($this->idprof2); - $this->idprof3 = trim($this->idprof3); - $this->idprof4 = trim($this->idprof4); - $this->idprof5 = (! empty($this->idprof5)?trim($this->idprof5):''); - $this->idprof6 = (! empty($this->idprof6)?trim($this->idprof6):''); - $this->prefix_comm = trim($this->prefix_comm); - $this->outstanding_limit = price2num($this->outstanding_limit); + // Clean parameters + $this->id = $id; + $this->name = $this->name?trim($this->name):trim($this->nom); + $this->nom = $this->name; // For backward compatibility + $this->name_alias = trim($this->name_alias); + $this->ref_ext = trim($this->ref_ext); + $this->address = $this->address?trim($this->address):trim($this->address); + $this->zip = $this->zip?trim($this->zip):trim($this->zip); + $this->town = $this->town?trim($this->town):trim($this->town); + $this->state_id = trim($this->state_id); + $this->country_id = ($this->country_id > 0)?$this->country_id:0; + $this->phone = trim($this->phone); + $this->phone = preg_replace("/\s/","",$this->phone); + $this->phone = preg_replace("/\./","",$this->phone); + $this->fax = trim($this->fax); + $this->fax = preg_replace("/\s/","",$this->fax); + $this->fax = preg_replace("/\./","",$this->fax); + $this->email = trim($this->email); + $this->skype = trim($this->skype); + $this->url = $this->url?clean_url($this->url,0):''; + $this->idprof1 = trim($this->idprof1); + $this->idprof2 = trim($this->idprof2); + $this->idprof3 = trim($this->idprof3); + $this->idprof4 = trim($this->idprof4); + $this->idprof5 = (! empty($this->idprof5)?trim($this->idprof5):''); + $this->idprof6 = (! empty($this->idprof6)?trim($this->idprof6):''); + $this->prefix_comm = trim($this->prefix_comm); + $this->outstanding_limit = price2num($this->outstanding_limit); - $this->tva_assuj = trim($this->tva_assuj); - $this->tva_intra = dol_sanitizeFileName($this->tva_intra,''); - if (empty($this->status)) $this->status = 0; + $this->tva_assuj = trim($this->tva_assuj); + $this->tva_intra = dol_sanitizeFileName($this->tva_intra,''); + if (empty($this->status)) $this->status = 0; if (!empty($this->multicurrency_code)) $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) @@ -758,490 +758,490 @@ class Societe extends CommonObject $this->fk_multicurrency = 0; } - // Local taxes - $this->localtax1_assuj=trim($this->localtax1_assuj); - $this->localtax2_assuj=trim($this->localtax2_assuj); + // Local taxes + $this->localtax1_assuj=trim($this->localtax1_assuj); + $this->localtax2_assuj=trim($this->localtax2_assuj); - $this->localtax1_value=trim($this->localtax1_value); - $this->localtax2_value=trim($this->localtax2_value); + $this->localtax1_value=trim($this->localtax1_value); + $this->localtax2_value=trim($this->localtax2_value); - if ($this->capital != '') $this->capital=price2num(trim($this->capital)); - if (! is_numeric($this->capital)) $this->capital = ''; // '' = undef + if ($this->capital != '') $this->capital=price2num(trim($this->capital)); + if (! is_numeric($this->capital)) $this->capital = ''; // '' = undef - $this->effectif_id=trim($this->effectif_id); - $this->forme_juridique_code=trim($this->forme_juridique_code); + $this->effectif_id=trim($this->effectif_id); + $this->forme_juridique_code=trim($this->forme_juridique_code); - //Gencod - $this->barcode=trim($this->barcode); + //Gencod + $this->barcode=trim($this->barcode); - // For automatic creation - if ($this->code_client == -1) $this->get_codeclient($this,0); - if ($this->code_fournisseur == -1) $this->get_codefournisseur($this,1); + // For automatic creation + if ($this->code_client == -1) $this->get_codeclient($this,0); + if ($this->code_fournisseur == -1) $this->get_codefournisseur($this,1); - $this->code_compta=trim($this->code_compta); - $this->code_compta_fournisseur=trim($this->code_compta_fournisseur); + $this->code_compta=trim($this->code_compta); + $this->code_compta_fournisseur=trim($this->code_compta_fournisseur); - // Check parameters. More tests are done later in the ->verify() - if (! is_numeric($this->client) && ! is_numeric($this->fournisseur)) - { - $langs->load("errors"); - $this->error = $langs->trans("BadValueForParameterClientOrSupplier"); - return -1; - } + // Check parameters. More tests are done later in the ->verify() + if (! is_numeric($this->client) && ! is_numeric($this->fournisseur)) + { + $langs->load("errors"); + $this->error = $langs->trans("BadValueForParameterClientOrSupplier"); + return -1; + } - $customer=false; - if (! empty($allowmodcodeclient) && ! empty($this->client)) - { - // Attention get_codecompta peut modifier le code suivant le module utilise - if (empty($this->code_compta)) - { - $ret=$this->get_codecompta('customer'); - if ($ret < 0) return -1; - } + $customer=false; + if (! empty($allowmodcodeclient) && ! empty($this->client)) + { + // Attention get_codecompta peut modifier le code suivant le module utilise + if (empty($this->code_compta)) + { + $ret=$this->get_codecompta('customer'); + if ($ret < 0) return -1; + } - $customer=true; - } + $customer=true; + } - $supplier=false; - if (! empty($allowmodcodefournisseur) && ! empty($this->fournisseur)) - { - // Attention get_codecompta peut modifier le code suivant le module utilise - if (empty($this->code_compta_fournisseur)) - { - $ret=$this->get_codecompta('supplier'); - if ($ret < 0) return -1; - } + $supplier=false; + if (! empty($allowmodcodefournisseur) && ! empty($this->fournisseur)) + { + // Attention get_codecompta peut modifier le code suivant le module utilise + if (empty($this->code_compta_fournisseur)) + { + $ret=$this->get_codecompta('supplier'); + if ($ret < 0) return -1; + } - $supplier=true; - } + $supplier=true; + } - //Web services - $this->webservices_url = $this->webservices_url?clean_url($this->webservices_url,0):''; - $this->webservices_key = trim($this->webservices_key); + //Web services + $this->webservices_url = $this->webservices_url?clean_url($this->webservices_url,0):''; + $this->webservices_key = trim($this->webservices_key); - //Incoterms - $this->fk_incoterms = (int) $this->fk_incoterms; + //Incoterms + $this->fk_incoterms = (int) $this->fk_incoterms; $this->location_incoterms = trim($this->location_incoterms); - $this->db->begin(); + $this->db->begin(); - // Check name is required and codes are ok or unique. - // If error, this->errors[] is filled - $result = 0; - if ($action != 'add') $result = $this->verify(); // We don't check when update called during a create because verify was already done + // Check name is required and codes are ok or unique. + // If error, this->errors[] is filled + $result = 0; + if ($action != 'add') $result = $this->verify(); // We don't check when update called during a create because verify was already done - if ($result >= 0) - { - dol_syslog(get_class($this)."::update verify ok or not done"); + if ($result >= 0) + { + dol_syslog(get_class($this)."::update verify ok or not done"); - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET "; - $sql .= "nom = '" . $this->db->escape($this->name) ."'"; // Required - $sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'"; - $sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null"); - $sql .= ",address = '" . $this->db->escape($this->address) ."'"; + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET "; + $sql .= "nom = '" . $this->db->escape($this->name) ."'"; // Required + $sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'"; + $sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null"); + $sql .= ",address = '" . $this->db->escape($this->address) ."'"; - $sql .= ",zip = ".(! empty($this->zip)?"'".$this->db->escape($this->zip)."'":"null"); - $sql .= ",town = ".(! empty($this->town)?"'".$this->db->escape($this->town)."'":"null"); + $sql .= ",zip = ".(! empty($this->zip)?"'".$this->db->escape($this->zip)."'":"null"); + $sql .= ",town = ".(! empty($this->town)?"'".$this->db->escape($this->town)."'":"null"); - $sql .= ",fk_departement = '" . (! empty($this->state_id)?$this->state_id:'0') ."'"; - $sql .= ",fk_pays = '" . (! empty($this->country_id)?$this->country_id:'0') ."'"; + $sql .= ",fk_departement = '" . (! empty($this->state_id)?$this->state_id:'0') ."'"; + $sql .= ",fk_pays = '" . (! empty($this->country_id)?$this->country_id:'0') ."'"; - $sql .= ",phone = ".(! empty($this->phone)?"'".$this->db->escape($this->phone)."'":"null"); - $sql .= ",fax = ".(! empty($this->fax)?"'".$this->db->escape($this->fax)."'":"null"); - $sql .= ",email = ".(! empty($this->email)?"'".$this->db->escape($this->email)."'":"null"); - $sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null"); - $sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null"); + $sql .= ",phone = ".(! empty($this->phone)?"'".$this->db->escape($this->phone)."'":"null"); + $sql .= ",fax = ".(! empty($this->fax)?"'".$this->db->escape($this->fax)."'":"null"); + $sql .= ",email = ".(! empty($this->email)?"'".$this->db->escape($this->email)."'":"null"); + $sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null"); + $sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null"); - $sql .= ",siren = '". $this->db->escape($this->idprof1) ."'"; - $sql .= ",siret = '". $this->db->escape($this->idprof2) ."'"; - $sql .= ",ape = '". $this->db->escape($this->idprof3) ."'"; - $sql .= ",idprof4 = '". $this->db->escape($this->idprof4) ."'"; - $sql .= ",idprof5 = '". $this->db->escape($this->idprof5) ."'"; - $sql .= ",idprof6 = '". $this->db->escape($this->idprof6) ."'"; + $sql .= ",siren = '". $this->db->escape($this->idprof1) ."'"; + $sql .= ",siret = '". $this->db->escape($this->idprof2) ."'"; + $sql .= ",ape = '". $this->db->escape($this->idprof3) ."'"; + $sql .= ",idprof4 = '". $this->db->escape($this->idprof4) ."'"; + $sql .= ",idprof5 = '". $this->db->escape($this->idprof5) ."'"; + $sql .= ",idprof6 = '". $this->db->escape($this->idprof6) ."'"; - $sql .= ",tva_assuj = ".($this->tva_assuj!=''?"'".$this->db->escape($this->tva_assuj)."'":"null"); - $sql .= ",tva_intra = '" . $this->db->escape($this->tva_intra) ."'"; - $sql .= ",status = " .$this->status; + $sql .= ",tva_assuj = ".($this->tva_assuj!=''?"'".$this->db->escape($this->tva_assuj)."'":"null"); + $sql .= ",tva_intra = '" . $this->db->escape($this->tva_intra) ."'"; + $sql .= ",status = " .$this->status; - // Local taxes - $sql .= ",localtax1_assuj = ".($this->localtax1_assuj!=''?"'".$this->db->escape($this->localtax1_assuj)."'":"null"); - $sql .= ",localtax2_assuj = ".($this->localtax2_assuj!=''?"'".$this->db->escape($this->localtax2_assuj)."'":"null"); - if($this->localtax1_assuj==1) - { - if($this->localtax1_value!='') - { - $sql .=",localtax1_value =".$this->localtax1_value; - } - else $sql .=",localtax1_value =0.000"; + // Local taxes + $sql .= ",localtax1_assuj = ".($this->localtax1_assuj!=''?"'".$this->db->escape($this->localtax1_assuj)."'":"null"); + $sql .= ",localtax2_assuj = ".($this->localtax2_assuj!=''?"'".$this->db->escape($this->localtax2_assuj)."'":"null"); + if($this->localtax1_assuj==1) + { + if($this->localtax1_value!='') + { + $sql .=",localtax1_value =".$this->localtax1_value; + } + else $sql .=",localtax1_value =0.000"; - } - else $sql .=",localtax1_value =0.000"; + } + else $sql .=",localtax1_value =0.000"; - if($this->localtax2_assuj==1) - { - if($this->localtax2_value!='') - { - $sql .=",localtax2_value =".$this->localtax2_value; - } - else $sql .=",localtax2_value =0.000"; + if($this->localtax2_assuj==1) + { + if($this->localtax2_value!='') + { + $sql .=",localtax2_value =".$this->localtax2_value; + } + else $sql .=",localtax2_value =0.000"; - } - else $sql .=",localtax2_value =0.000"; + } + else $sql .=",localtax2_value =0.000"; - $sql .= ",capital = ".($this->capital == '' ? "null" : $this->capital); + $sql .= ",capital = ".($this->capital == '' ? "null" : $this->capital); - $sql .= ",prefix_comm = ".(! empty($this->prefix_comm)?"'".$this->db->escape($this->prefix_comm)."'":"null"); + $sql .= ",prefix_comm = ".(! empty($this->prefix_comm)?"'".$this->db->escape($this->prefix_comm)."'":"null"); - $sql .= ",fk_effectif = ".(! empty($this->effectif_id)?"'".$this->db->escape($this->effectif_id)."'":"null"); - if (isset($this->stcomm_id)) - { - $sql .= ",fk_stcomm=".($this->stcomm_id > 0 ? $this->stcomm_id : "0"); - } - $sql .= ",fk_typent = ".(! empty($this->typent_id)?"'".$this->db->escape($this->typent_id)."'":"0"); + $sql .= ",fk_effectif = ".(! empty($this->effectif_id)?"'".$this->db->escape($this->effectif_id)."'":"null"); + if (isset($this->stcomm_id)) + { + $sql .= ",fk_stcomm=".($this->stcomm_id > 0 ? $this->stcomm_id : "0"); + } + $sql .= ",fk_typent = ".(! empty($this->typent_id)?"'".$this->db->escape($this->typent_id)."'":"0"); - $sql .= ",fk_forme_juridique = ".(! empty($this->forme_juridique_code)?"'".$this->db->escape($this->forme_juridique_code)."'":"null"); + $sql .= ",fk_forme_juridique = ".(! empty($this->forme_juridique_code)?"'".$this->db->escape($this->forme_juridique_code)."'":"null"); - $sql .= ",mode_reglement = ".(! empty($this->mode_reglement_id)?"'".$this->db->escape($this->mode_reglement_id)."'":"null"); - $sql .= ",cond_reglement = ".(! empty($this->cond_reglement_id)?"'".$this->db->escape($this->cond_reglement_id)."'":"null"); - $sql .= ",mode_reglement_supplier = ".(! empty($this->mode_reglement_supplier_id)?"'".$this->db->escape($this->mode_reglement_supplier_id)."'":"null"); - $sql .= ",cond_reglement_supplier = ".(! empty($this->cond_reglement_supplier_id)?"'".$this->db->escape($this->cond_reglement_supplier_id)."'":"null"); - $sql .= ",fk_shipping_method = ".(! empty($this->shipping_method_id)?"'".$this->db->escape($this->shipping_method_id)."'":"null"); + $sql .= ",mode_reglement = ".(! empty($this->mode_reglement_id)?"'".$this->db->escape($this->mode_reglement_id)."'":"null"); + $sql .= ",cond_reglement = ".(! empty($this->cond_reglement_id)?"'".$this->db->escape($this->cond_reglement_id)."'":"null"); + $sql .= ",mode_reglement_supplier = ".(! empty($this->mode_reglement_supplier_id)?"'".$this->db->escape($this->mode_reglement_supplier_id)."'":"null"); + $sql .= ",cond_reglement_supplier = ".(! empty($this->cond_reglement_supplier_id)?"'".$this->db->escape($this->cond_reglement_supplier_id)."'":"null"); + $sql .= ",fk_shipping_method = ".(! empty($this->shipping_method_id)?"'".$this->db->escape($this->shipping_method_id)."'":"null"); - $sql .= ",client = " . (! empty($this->client)?$this->client:0); - $sql .= ",fournisseur = " . (! empty($this->fournisseur)?$this->fournisseur:0); - $sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null"); - $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->db->escape($this->default_lang)."'":"null"); - $sql .= ",logo = ".(! empty($this->logo)?"'".$this->db->escape($this->logo)."'":"null"); - $sql .= ",outstanding_limit= ".($this->outstanding_limit!=''?$this->outstanding_limit:'null'); - $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; + $sql .= ",client = " . (! empty($this->client)?$this->client:0); + $sql .= ",fournisseur = " . (! empty($this->fournisseur)?$this->fournisseur:0); + $sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null"); + $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->db->escape($this->default_lang)."'":"null"); + $sql .= ",logo = ".(! empty($this->logo)?"'".$this->db->escape($this->logo)."'":"null"); + $sql .= ",outstanding_limit= ".($this->outstanding_limit!=''?$this->outstanding_limit:'null'); + $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; - $sql .= ",webservices_url = ".(! empty($this->webservices_url)?"'".$this->db->escape($this->webservices_url)."'":"null"); - $sql .= ",webservices_key = ".(! empty($this->webservices_key)?"'".$this->db->escape($this->webservices_key)."'":"null"); + $sql .= ",webservices_url = ".(! empty($this->webservices_url)?"'".$this->db->escape($this->webservices_url)."'":"null"); + $sql .= ",webservices_key = ".(! empty($this->webservices_key)?"'".$this->db->escape($this->webservices_key)."'":"null"); //Incoterms $sql.= ", fk_incoterms = ".$this->fk_incoterms; $sql.= ", location_incoterms = ".(! empty($this->location_incoterms)?"'".$this->db->escape($this->location_incoterms)."'":"null"); - if ($customer) - { - $sql .= ", code_client = ".(! empty($this->code_client)?"'".$this->db->escape($this->code_client)."'":"null"); - $sql .= ", code_compta = ".(! empty($this->code_compta)?"'".$this->db->escape($this->code_compta)."'":"null"); - } + if ($customer) + { + $sql .= ", code_client = ".(! empty($this->code_client)?"'".$this->db->escape($this->code_client)."'":"null"); + $sql .= ", code_compta = ".(! empty($this->code_compta)?"'".$this->db->escape($this->code_compta)."'":"null"); + } - if ($supplier) - { - $sql .= ", code_fournisseur = ".(! empty($this->code_fournisseur)?"'".$this->db->escape($this->code_fournisseur)."'":"null"); - $sql .= ", code_compta_fournisseur = ".(! empty($this->code_compta_fournisseur)?"'".$this->db->escape($this->code_compta_fournisseur)."'":"null"); - } - $sql .= ", fk_user_modif = ".(! empty($user->id)?"'".$user->id."'":"null"); + if ($supplier) + { + $sql .= ", code_fournisseur = ".(! empty($this->code_fournisseur)?"'".$this->db->escape($this->code_fournisseur)."'":"null"); + $sql .= ", code_compta_fournisseur = ".(! empty($this->code_compta_fournisseur)?"'".$this->db->escape($this->code_compta_fournisseur)."'":"null"); + } + $sql .= ", fk_user_modif = ".(! empty($user->id)?"'".$user->id."'":"null"); $sql .= ", fk_multicurrency = ".(int) $this->fk_multicurrency; $sql .= ', multicurrency_code = \''.$this->db->escape($this->multicurrency_code)."'"; - $sql .= " WHERE rowid = '" . $id ."'"; + $sql .= " WHERE rowid = '" . $id ."'"; - $resql=$this->db->query($sql); - if ($resql) - { - unset($this->country_code); // We clean this because it may have been changed after an update of country_id - unset($this->country); - unset($this->state_code); - unset($this->state); - - $nbrowsaffected = $this->db->affected_rows($resql); - - if (! $error && $nbrowsaffected) - { - // Update information on linked member if it is an update - if (! $nosyncmember && ! empty($conf->adherent->enabled)) - { - require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - - dol_syslog(get_class($this)."::update update linked member"); - - $lmember=new Adherent($this->db); - $result=$lmember->fetch(0, 0, $this->id); - - if ($result > 0) - { - $lmember->societe=$this->name; - //$lmember->firstname=$this->firstname?$this->firstname:$lmember->firstname; // We keep firstname and lastname of member unchanged - //$lmember->lastname=$this->lastname?$this->lastname:$lmember->lastname; // We keep firstname and lastname of member unchanged - $lmember->address=$this->address; - $lmember->email=$this->email; - $lmember->skype=$this->skype; - $lmember->phone=$this->phone; - - $result=$lmember->update($user,0,1,1,1); // Use nosync to 1 to avoid cyclic updates - if ($result < 0) - { - $this->error=$lmember->error; - dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); - $error++; - } - } - else if ($result < 0) - { - $this->error=$lmember->error; - $error++; - } - } - } - - $action='update'; - - // Actions on extra fields (by external module or standard code) - // TODO le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('thirdpartydao')); - $parameters=array('socid'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - - if (! $error && $call_trigger) - { - // Call trigger - $result=$this->call_trigger('COMPANY_MODIFY',$user); - if ($result < 0) $error++; - // End call triggers - } - - if (! $error) - { - dol_syslog(get_class($this)."::Update success"); - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - else + $resql=$this->db->query($sql); + if ($resql) { - if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - // Doublon - $this->error = $langs->trans("ErrorDuplicateField"); - $result = -1; - } - else - { - $this->error = $this->db->lasterror(); - $result = -2; - } - $this->db->rollback(); - return $result; - } - } - else - { - $this->db->rollback(); - dol_syslog(get_class($this)."::Update fails verify ".join(',',$this->errors), LOG_WARNING); - return -3; - } - } + unset($this->country_code); // We clean this because it may have been changed after an update of country_id + unset($this->country); + unset($this->state_code); + unset($this->state); - /** - * Load a third party from database into memory - * - * @param int $rowid Id of third party to load - * @param string $ref Reference of third party, name (Warning, this can return several records) - * @param string $ref_ext External reference of third party (Warning, this information is a free field not provided by Dolibarr) - * @param string $ref_int Internal reference of third party (not used by dolibarr) - * @param string $idprof1 Prof id 1 of third party (Warning, this can return several records) - * @param string $idprof2 Prof id 2 of third party (Warning, this can return several records) - * @param string $idprof3 Prof id 3 of third party (Warning, this can return several records) - * @param string $idprof4 Prof id 4 of third party (Warning, this can return several records) - * @param string $idprof5 Prof id 5 of third party (Warning, this can return several records) - * @param string $idprof6 Prof id 6 of third party (Warning, this can return several records) - * @param string $email Email (Warning, this can return several records) - * @return int >0 if OK, <0 if KO or if two records found for same ref or idprof, 0 if not found. - */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $idprof1='',$idprof2='',$idprof3='',$idprof4='',$idprof5='',$idprof6='', $email='') - { - global $langs; - global $conf; + $nbrowsaffected = $this->db->affected_rows($resql); - if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email)) return -1; + if (! $error && $nbrowsaffected) + { + // Update information on linked member if it is an update + if (! $nosyncmember && ! empty($conf->adherent->enabled)) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $sql = 'SELECT s.rowid, s.nom as name, s.name_alias, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm'; - $sql .= ', s.status'; - $sql .= ', s.price_level'; - $sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif'; - $sql .= ', s.phone, s.fax, s.email, s.skype, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur'; - $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; - $sql .= ', s.capital, s.tva_intra'; - $sql .= ', s.fk_typent as typent_id'; - $sql .= ', s.fk_effectif as effectif_id'; - $sql .= ', s.fk_forme_juridique as forme_juridique_code'; - $sql .= ', s.webservices_url, s.webservices_key'; - $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; - $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; - $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; - $sql .= ', s.fk_shipping_method'; - $sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms'; + dol_syslog(get_class($this)."::update update linked member"); + + $lmember=new Adherent($this->db); + $result=$lmember->fetch(0, 0, $this->id); + + if ($result > 0) + { + $lmember->societe=$this->name; + //$lmember->firstname=$this->firstname?$this->firstname:$lmember->firstname; // We keep firstname and lastname of member unchanged + //$lmember->lastname=$this->lastname?$this->lastname:$lmember->lastname; // We keep firstname and lastname of member unchanged + $lmember->address=$this->address; + $lmember->email=$this->email; + $lmember->skype=$this->skype; + $lmember->phone=$this->phone; + + $result=$lmember->update($user,0,1,1,1); // Use nosync to 1 to avoid cyclic updates + if ($result < 0) + { + $this->error=$lmember->error; + dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR); + $error++; + } + } + else if ($result < 0) + { + $this->error=$lmember->error; + $error++; + } + } + } + + $action='update'; + + // Actions on extra fields (by external module or standard code) + // TODO le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('thirdpartydao')); + $parameters=array('socid'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + + if (! $error && $call_trigger) + { + // Call trigger + $result=$this->call_trigger('COMPANY_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + + if (! $error) + { + dol_syslog(get_class($this)."::Update success"); + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + else + { + if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + // Doublon + $this->error = $langs->trans("ErrorDuplicateField"); + $result = -1; + } + else + { + $this->error = $this->db->lasterror(); + $result = -2; + } + $this->db->rollback(); + return $result; + } + } + else + { + $this->db->rollback(); + dol_syslog(get_class($this)."::Update fails verify ".join(',',$this->errors), LOG_WARNING); + return -3; + } + } + + /** + * Load a third party from database into memory + * + * @param int $rowid Id of third party to load + * @param string $ref Reference of third party, name (Warning, this can return several records) + * @param string $ref_ext External reference of third party (Warning, this information is a free field not provided by Dolibarr) + * @param string $ref_int Internal reference of third party (not used by dolibarr) + * @param string $idprof1 Prof id 1 of third party (Warning, this can return several records) + * @param string $idprof2 Prof id 2 of third party (Warning, this can return several records) + * @param string $idprof3 Prof id 3 of third party (Warning, this can return several records) + * @param string $idprof4 Prof id 4 of third party (Warning, this can return several records) + * @param string $idprof5 Prof id 5 of third party (Warning, this can return several records) + * @param string $idprof6 Prof id 6 of third party (Warning, this can return several records) + * @param string $email Email (Warning, this can return several records) + * @return int >0 if OK, <0 if KO or if two records found for same ref or idprof, 0 if not found. + */ + function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $idprof1='',$idprof2='',$idprof3='',$idprof4='',$idprof5='',$idprof6='', $email='') + { + global $langs; + global $conf; + + if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int) && empty($idprof1) && empty($idprof2) && empty($idprof3) && empty($idprof4) && empty($idprof5) && empty($idprof6) && empty($email)) return -1; + + $sql = 'SELECT s.rowid, s.nom as name, s.name_alias, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm'; + $sql .= ', s.status'; + $sql .= ', s.price_level'; + $sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif'; + $sql .= ', s.phone, s.fax, s.email, s.skype, s.url, s.zip, s.town, s.note_private, s.note_public, s.model_pdf, s.client, s.fournisseur'; + $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; + $sql .= ', s.capital, s.tva_intra'; + $sql .= ', s.fk_typent as typent_id'; + $sql .= ', s.fk_effectif as effectif_id'; + $sql .= ', s.fk_forme_juridique as forme_juridique_code'; + $sql .= ', s.webservices_url, s.webservices_key'; + $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; + $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; + $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; + $sql .= ', s.fk_shipping_method'; + $sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms'; $sql .= ', s.fk_multicurrency, s.multicurrency_code'; - $sql .= ', fj.libelle as forme_juridique'; - $sql .= ', e.libelle as effectif'; - $sql .= ', c.code as country_code, c.label as country'; - $sql .= ', d.code_departement as state_code, d.nom as state'; - $sql .= ', st.libelle as stcomm'; - $sql .= ', te.code as typent_code'; + $sql .= ', fj.libelle as forme_juridique'; + $sql .= ', e.libelle as effectif'; + $sql .= ', c.code as country_code, c.label as country'; + $sql .= ', d.code_departement as state_code, d.nom as state'; + $sql .= ', st.libelle as stcomm'; + $sql .= ', te.code as typent_code'; $sql .= ', i.libelle as libelle_incoterms'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as fj ON s.fk_forme_juridique = fj.code'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as fj ON s.fk_forme_juridique = fj.code'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid'; $sql .= ' WHERE s.entity IN ('.getEntity($this->element, 1).')'; - if ($rowid) $sql .= ' AND s.rowid = '.$rowid; - if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'"; - if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'"; - if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'"; - if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'"; - if ($idprof2) $sql .= " AND s.siret = '".$this->db->escape($idprof2)."'"; - if ($idprof3) $sql .= " AND s.ape = '".$this->db->escape($idprof3)."'"; - if ($idprof4) $sql .= " AND s.idprof4 = '".$this->db->escape($idprof4)."'"; - if ($idprof5) $sql .= " AND s.idprof5 = '".$this->db->escape($idprof5)."'"; - if ($idprof6) $sql .= " AND s.idprof6 = '".$this->db->escape($idprof6)."'"; - if ($email) $sql .= " AND email = '".$this->db->escape($email)."'"; + if ($rowid) $sql .= ' AND s.rowid = '.$rowid; + if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'"; + if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'"; + if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'"; + if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'"; + if ($idprof2) $sql .= " AND s.siret = '".$this->db->escape($idprof2)."'"; + if ($idprof3) $sql .= " AND s.ape = '".$this->db->escape($idprof3)."'"; + if ($idprof4) $sql .= " AND s.idprof4 = '".$this->db->escape($idprof4)."'"; + if ($idprof5) $sql .= " AND s.idprof5 = '".$this->db->escape($idprof5)."'"; + if ($idprof6) $sql .= " AND s.idprof6 = '".$this->db->escape($idprof6)."'"; + if ($email) $sql .= " AND email = '".$this->db->escape($email)."'"; - $resql=$this->db->query($sql); - if ($resql) - { - $num=$this->db->num_rows($resql); - if ($num > 1) - { - $this->error='Fetch found several records. Rename one of tirdparties to avoid duplicate.'; - dol_syslog($this->error, LOG_ERR); - $result = -2; - } - elseif ($num) // $num = 1 - { - $obj = $this->db->fetch_object($resql); + $resql=$this->db->query($sql); + if ($resql) + { + $num=$this->db->num_rows($resql); + if ($num > 1) + { + $this->error='Fetch found several records. Rename one of tirdparties to avoid duplicate.'; + dol_syslog($this->error, LOG_ERR); + $result = -2; + } + elseif ($num) // $num = 1 + { + $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->entity = $obj->entity; - $this->canvas = $obj->canvas; + $this->id = $obj->rowid; + $this->entity = $obj->entity; + $this->canvas = $obj->canvas; - $this->ref = $obj->rowid; - $this->name = $obj->name; - $this->nom = $obj->name; // deprecated - $this->name_alias = $obj->name_alias; - $this->ref_ext = $obj->ref_ext; - $this->ref_int = $obj->ref_int; + $this->ref = $obj->rowid; + $this->name = $obj->name; + $this->nom = $obj->name; // deprecated + $this->name_alias = $obj->name_alias; + $this->ref_ext = $obj->ref_ext; + $this->ref_int = $obj->ref_int; - $this->date_creation = $this->db->jdate($obj->date_creation); - $this->date_modification = $this->db->jdate($obj->date_modification); - $this->user_creation = $obj->fk_user_creat; - $this->user_modification = $obj->fk_user_modif; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->user_creation = $obj->fk_user_creat; + $this->user_modification = $obj->fk_user_modif; - $this->address = $obj->address; - $this->zip = $obj->zip; - $this->town = $obj->town; + $this->address = $obj->address; + $this->zip = $obj->zip; + $this->town = $obj->town; - $this->country_id = $obj->country_id; - $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; + $this->country_id = $obj->country_id; + $this->country_code = $obj->country_id?$obj->country_code:''; + $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; - $this->state_id = $obj->fk_departement; - $this->state_code = $obj->state_code; - $this->state = ($obj->state!='-'?$obj->state:''); + $this->state_id = $obj->fk_departement; + $this->state_code = $obj->state_code; + $this->state = ($obj->state!='-'?$obj->state:''); - $transcode=$langs->trans('StatusProspect'.$obj->fk_stcomm); - $libelle=($transcode!='StatusProspect'.$obj->fk_stcomm?$transcode:$obj->stcomm); - $this->stcomm_id = $obj->fk_stcomm; // id statut commercial - $this->statut_commercial = $libelle; // libelle statut commercial + $transcode=$langs->trans('StatusProspect'.$obj->fk_stcomm); + $libelle=($transcode!='StatusProspect'.$obj->fk_stcomm?$transcode:$obj->stcomm); + $this->stcomm_id = $obj->fk_stcomm; // id statut commercial + $this->statut_commercial = $libelle; // libelle statut commercial - $this->email = $obj->email; - $this->skype = $obj->skype; - $this->url = $obj->url; - $this->phone = $obj->phone; - $this->fax = $obj->fax; + $this->email = $obj->email; + $this->skype = $obj->skype; + $this->url = $obj->url; + $this->phone = $obj->phone; + $this->fax = $obj->fax; - $this->parent = $obj->parent; + $this->parent = $obj->parent; - $this->idprof1 = $obj->idprof1; - $this->idprof2 = $obj->idprof2; - $this->idprof3 = $obj->idprof3; - $this->idprof4 = $obj->idprof4; - $this->idprof5 = $obj->idprof5; - $this->idprof6 = $obj->idprof6; + $this->idprof1 = $obj->idprof1; + $this->idprof2 = $obj->idprof2; + $this->idprof3 = $obj->idprof3; + $this->idprof4 = $obj->idprof4; + $this->idprof5 = $obj->idprof5; + $this->idprof6 = $obj->idprof6; - $this->capital = $obj->capital; + $this->capital = $obj->capital; - $this->code_client = $obj->code_client; - $this->code_fournisseur = $obj->code_fournisseur; + $this->code_client = $obj->code_client; + $this->code_fournisseur = $obj->code_fournisseur; - $this->code_compta = $obj->code_compta; - $this->code_compta_fournisseur = $obj->code_compta_fournisseur; + $this->code_compta = $obj->code_compta; + $this->code_compta_fournisseur = $obj->code_compta_fournisseur; - $this->barcode = $obj->barcode; + $this->barcode = $obj->barcode; - $this->tva_assuj = $obj->tva_assuj; - $this->tva_intra = $obj->tva_intra; - $this->status = $obj->status; + $this->tva_assuj = $obj->tva_assuj; + $this->tva_intra = $obj->tva_intra; + $this->status = $obj->status; - // Local Taxes - $this->localtax1_assuj = $obj->localtax1_assuj; - $this->localtax2_assuj = $obj->localtax2_assuj; + // Local Taxes + $this->localtax1_assuj = $obj->localtax1_assuj; + $this->localtax2_assuj = $obj->localtax2_assuj; - $this->localtax1_value = $obj->localtax1_value; - $this->localtax2_value = $obj->localtax2_value; + $this->localtax1_value = $obj->localtax1_value; + $this->localtax2_value = $obj->localtax2_value; - $this->typent_id = $obj->typent_id; - $this->typent_code = $obj->typent_code; + $this->typent_id = $obj->typent_id; + $this->typent_code = $obj->typent_code; - $this->effectif_id = $obj->effectif_id; - $this->effectif = $obj->effectif_id?$obj->effectif:''; + $this->effectif_id = $obj->effectif_id; + $this->effectif = $obj->effectif_id?$obj->effectif:''; - $this->forme_juridique_code= $obj->forme_juridique_code; - $this->forme_juridique = $obj->forme_juridique_code?$obj->forme_juridique:''; + $this->forme_juridique_code= $obj->forme_juridique_code; + $this->forme_juridique = $obj->forme_juridique_code?$obj->forme_juridique:''; - $this->fk_prospectlevel = $obj->fk_prospectlevel; + $this->fk_prospectlevel = $obj->fk_prospectlevel; - $this->prefix_comm = $obj->prefix_comm; + $this->prefix_comm = $obj->prefix_comm; - $this->remise_percent = $obj->remise_client; - $this->mode_reglement_id = $obj->mode_reglement; - $this->cond_reglement_id = $obj->cond_reglement; - $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; - $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; - $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; + $this->remise_percent = $obj->remise_client; + $this->mode_reglement_id = $obj->mode_reglement; + $this->cond_reglement_id = $obj->cond_reglement; + $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; + $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; + $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; $this->fk_account = $obj->fk_account; - $this->client = $obj->client; - $this->fournisseur = $obj->fournisseur; + $this->client = $obj->client; + $this->fournisseur = $obj->fournisseur; - $this->note = $obj->note_private; // TODO Deprecated for backward comtability - $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; - $this->modelpdf = $obj->model_pdf; - $this->default_lang = $obj->default_lang; - $this->logo = $obj->logo; + $this->note = $obj->note_private; // TODO Deprecated for backward comtability + $this->note_private = $obj->note_private; + $this->note_public = $obj->note_public; + $this->modelpdf = $obj->model_pdf; + $this->default_lang = $obj->default_lang; + $this->logo = $obj->logo; - $this->webservices_url = $obj->webservices_url; - $this->webservices_key = $obj->webservices_key; + $this->webservices_url = $obj->webservices_url; + $this->webservices_key = $obj->webservices_key; - $this->outstanding_limit = $obj->outstanding_limit; + $this->outstanding_limit = $obj->outstanding_limit; - // multiprix - $this->price_level = $obj->price_level; + // multiprix + $this->price_level = $obj->price_level; - $this->import_key = $obj->import_key; + $this->import_key = $obj->import_key; //Incoterms $this->fk_incoterms = $obj->fk_incoterms; @@ -1252,198 +1252,198 @@ class Societe extends CommonObject $this->fk_multicurrency = $obj->fk_multicurrency; $this->multicurrency_code = $obj->multicurrency_code; - $result = 1; + $result = 1; - // Retreive all extrafield for thirdparty - $this->fetch_optionals(); - } - else + // Retreive all extrafield for thirdparty + $this->fetch_optionals(); + } + else { - $result = 0; - } + $result = 0; + } - $this->db->free($resql); - } - else + $this->db->free($resql); + } + else { - $this->error=$this->db->lasterror(); - $result = -3; - } + $this->error=$this->db->lasterror(); + $result = -3; + } - // Use first price level if level not defined for third party - if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->price_level)) $this->price_level=1; + // Use first price level if level not defined for third party + if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->price_level)) $this->price_level=1; - return $result; - } + return $result; + } - /** - * Search and fetch thirparties by name - * - * @param string $name Name - * @param int $type Type of thirdparties (0=any, 1=customer, 2=prospect, 3=supplier) - * @param array $filters Array of couple field name/value to filter the companies with the same name - * @param boolean $exact Exact string search (true/false) - * @param boolean $case Case sensitive (true/false) - * @param boolean $similar Add test if string inside name into database, or name into database inside string. Do not use this: Not compatible with other database. - * @param string $clause Clause for filters - * @return array|int <0 if KO, array of thirdparties object if OK - */ - function searchByName($name, $type='0', $filters = array(), $exact = false, $case = false, $similar = false, $clause = 'AND') - { - $thirdparties = array(); + /** + * Search and fetch thirparties by name + * + * @param string $name Name + * @param int $type Type of thirdparties (0=any, 1=customer, 2=prospect, 3=supplier) + * @param array $filters Array of couple field name/value to filter the companies with the same name + * @param boolean $exact Exact string search (true/false) + * @param boolean $case Case sensitive (true/false) + * @param boolean $similar Add test if string inside name into database, or name into database inside string. Do not use this: Not compatible with other database. + * @param string $clause Clause for filters + * @return array|int <0 if KO, array of thirdparties object if OK + */ + function searchByName($name, $type='0', $filters = array(), $exact = false, $case = false, $similar = false, $clause = 'AND') + { + $thirdparties = array(); - dol_syslog("searchByName name=".$name." type=".$type." exact=".$exact); + dol_syslog("searchByName name=".$name." type=".$type." exact=".$exact); - // Check parameter - if (empty($name)) - { - $this->errors[]='ErrorBadValueForParameter'; - return -1; - } + // Check parameter + if (empty($name)) + { + $this->errors[]='ErrorBadValueForParameter'; + return -1; + } - // Generation requete recherche - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; - $sql.= " WHERE entity IN (".getEntity('category').")"; - if (! empty($type)) - { - if ($type == 1 || $type == 2) - $sql.= " AND client = ".$type; - elseif ($type == 3) - $sql.= " AND fournisseur = 1"; - } - if (! empty($name)) - { - if (! $exact) - { - if (preg_match('/^([\*])?[^*]+([\*])?$/', $name, $regs) && count($regs) > 1) - { - $name = str_replace('*', '%', $name); - } - else - { - $name = '%'.$name.'%'; - } - } - $sql.= " AND "; - if (is_array($filters) && ! empty($filters)) - $sql.= "("; - if ($similar) - { - // For test similitude (string inside name into database, or name into database inside string) - // Do not use this. Not compatible with other database. - $sql.= "(LOCATE('".$this->db->escape($name)."', nom) > 0 OR LOCATE(nom, '".$this->db->escape($name)."') > 0)"; - } - else - { - if (! $case) - $sql.= "nom LIKE '".$this->db->escape($name)."'"; - else - $sql.= "nom LIKE BINARY '".$this->db->escape($name)."'"; - } - } - if (is_array($filters) && ! empty($filters)) - { - foreach($filters as $field => $value) - { - if (! $exact) - { - if (preg_match('/^([\*])?[^*]+([\*])?$/', $value, $regs) && count($regs) > 1) - { - $value = str_replace('*', '%', $value); - } - else - { - $value = '%'.$value.'%'; - } - } - if (! $case) - $sql.= " ".$clause." ".$field." LIKE '".$this->db->escape($value)."'"; - else - $sql.= " ".$clause." ".$field." LIKE BINARY '".$this->db->escape($value)."'"; - } - if (! empty($name)) - $sql.= ")"; - } + // Generation requete recherche + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; + $sql.= " WHERE entity IN (".getEntity('category').")"; + if (! empty($type)) + { + if ($type == 1 || $type == 2) + $sql.= " AND client = ".$type; + elseif ($type == 3) + $sql.= " AND fournisseur = 1"; + } + if (! empty($name)) + { + if (! $exact) + { + if (preg_match('/^([\*])?[^*]+([\*])?$/', $name, $regs) && count($regs) > 1) + { + $name = str_replace('*', '%', $name); + } + else + { + $name = '%'.$name.'%'; + } + } + $sql.= " AND "; + if (is_array($filters) && ! empty($filters)) + $sql.= "("; + if ($similar) + { + // For test similitude (string inside name into database, or name into database inside string) + // Do not use this. Not compatible with other database. + $sql.= "(LOCATE('".$this->db->escape($name)."', nom) > 0 OR LOCATE(nom, '".$this->db->escape($name)."') > 0)"; + } + else + { + if (! $case) + $sql.= "nom LIKE '".$this->db->escape($name)."'"; + else + $sql.= "nom LIKE BINARY '".$this->db->escape($name)."'"; + } + } + if (is_array($filters) && ! empty($filters)) + { + foreach($filters as $field => $value) + { + if (! $exact) + { + if (preg_match('/^([\*])?[^*]+([\*])?$/', $value, $regs) && count($regs) > 1) + { + $value = str_replace('*', '%', $value); + } + else + { + $value = '%'.$value.'%'; + } + } + if (! $case) + $sql.= " ".$clause." ".$field." LIKE '".$this->db->escape($value)."'"; + else + $sql.= " ".$clause." ".$field." LIKE BINARY '".$this->db->escape($value)."'"; + } + if (! empty($name)) + $sql.= ")"; + } - $res = $this->db->query($sql); - if ($res) - { - while ($rec = $this->db->fetch_array($res)) - { - $soc = new Societe($this->db); - $soc->fetch($rec['rowid']); - $thirdparties[] = $soc; - } + $res = $this->db->query($sql); + if ($res) + { + while ($rec = $this->db->fetch_array($res)) + { + $soc = new Societe($this->db); + $soc->fetch($rec['rowid']); + $thirdparties[] = $soc; + } - return $thirdparties; - } - else - { - $this->error=$this->db->lasterror(); - return -1; - } - } + return $thirdparties; + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } + } - /** - * Delete a third party from database and all its dependencies (contacts, rib...) - * - * @param int $id Id of third party to delete - * @param User $fuser User who ask to delete thirparty - * @param int $call_trigger 0=No, 1=yes - * @return int <0 if KO, 0 if nothing done, >0 if OK - */ - function delete($id, User $fuser=null, $call_trigger=1) - { - global $langs, $conf, $user; + /** + * Delete a third party from database and all its dependencies (contacts, rib...) + * + * @param int $id Id of third party to delete + * @param User $fuser User who ask to delete thirparty + * @param int $call_trigger 0=No, 1=yes + * @return int <0 if KO, 0 if nothing done, >0 if OK + */ + function delete($id, User $fuser=null, $call_trigger=1) + { + global $langs, $conf, $user; - if (empty($fuser)) $fuser=$user; + if (empty($fuser)) $fuser=$user; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $entity=isset($this->entity)?$this->entity:$conf->entity; + $entity=isset($this->entity)?$this->entity:$conf->entity; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $error = 0; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $error = 0; - // Test if child exists - $objectisused = $this->isObjectUsed($id); + // Test if child exists + $objectisused = $this->isObjectUsed($id); if (empty($objectisused)) { - $this->db->begin(); + $this->db->begin(); - // User is mandatory for trigger call - if (! $error && $call_trigger) - { - // Call trigger - $result=$this->call_trigger('COMPANY_DELETE',$fuser); - if ($result < 0) $error++; - // End call triggers - } + // User is mandatory for trigger call + if (! $error && $call_trigger) + { + // Call trigger + $result=$this->call_trigger('COMPANY_DELETE',$fuser); + if ($result < 0) $error++; + // End call triggers + } if (! $error) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $static_cat = new Categorie($this->db); - $toute_categs = array(); + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $static_cat = new Categorie($this->db); + $toute_categs = array(); - // Fill $toute_categs array with an array of (type => array of ("Categorie" instance)) - if ($this->client || $this->prospect) - { - $toute_categs['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER); - } - if ($this->fournisseur) - { - $toute_categs['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER); - } + // Fill $toute_categs array with an array of (type => array of ("Categorie" instance)) + if ($this->client || $this->prospect) + { + $toute_categs['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER); + } + if ($this->fournisseur) + { + $toute_categs['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER); + } - // Remove each "Categorie" - foreach ($toute_categs as $type => $categs_type) - { - foreach ($categs_type as $cat) - { - $cat->del_type($this, $type); - } - } + // Remove each "Categorie" + foreach ($toute_categs as $type => $categs_type) + { + foreach ($categs_type as $cat) + { + $cat->del_type($this, $type); + } + } } foreach ($this->childtablesoncascade as $tabletodelete) @@ -1460,1619 +1460,1619 @@ class Societe extends CommonObject } } - // Removed extrafields - if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used - { - $result=$this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); - } - } + // Removed extrafields + if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); + } + } - // Remove third party - if (! $error) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe"; - $sql.= " WHERE rowid = " . $id; - if (! $this->db->query($sql)) - { - $error++; - $this->errors[] = $this->db->lasterror(); - } - } + // Remove third party + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe"; + $sql.= " WHERE rowid = " . $id; + if (! $this->db->query($sql)) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } - if (! $error) - { - $this->db->commit(); + if (! $error) + { + $this->db->commit(); - // Delete directory - if (! empty($conf->societe->multidir_output[$entity])) - { - $docdir = $conf->societe->multidir_output[$entity] . "/" . $id; - if (dol_is_dir($docdir)) - { - dol_delete_dir_recursive($docdir); - } - } + // Delete directory + if (! empty($conf->societe->multidir_output[$entity])) + { + $docdir = $conf->societe->multidir_output[$entity] . "/" . $id; + if (dol_is_dir($docdir)) + { + dol_delete_dir_recursive($docdir); + } + } - return 1; - } - else + return 1; + } + else { dol_syslog($this->error, LOG_ERR); - $this->db->rollback(); - return -1; - } - } + $this->db->rollback(); + return -1; + } + } else dol_syslog("Can't remove thirdparty with id ".$id.". There is ".$objectisused." childs", LOG_WARNING); - return 0; - } + return 0; + } - /** - * Define third party as a customer - * - * @return int <0 if KO, >0 if OK - */ - function set_as_client() - { - if ($this->id) - { - $newclient=1; - if ($this->client == 2 || $this->client == 3) $newclient=3; //If prospect, we keep prospect tag - $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; - $sql.= " SET client = ".$newclient; - $sql.= " WHERE rowid = " . $this->id; + /** + * Define third party as a customer + * + * @return int <0 if KO, >0 if OK + */ + function set_as_client() + { + if ($this->id) + { + $newclient=1; + if ($this->client == 2 || $this->client == 3) $newclient=3; //If prospect, we keep prospect tag + $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; + $sql.= " SET client = ".$newclient; + $sql.= " WHERE rowid = " . $this->id; - $resql=$this->db->query($sql); - if ($resql) - { - $this->client = $newclient; - return 1; - } - else return -1; - } - return 0; - } + $resql=$this->db->query($sql); + if ($resql) + { + $this->client = $newclient; + return 1; + } + else return -1; + } + return 0; + } - /** - * Definit la societe comme un client - * - * @param float $remise Valeur en % de la remise - * @param string $note Note/Motif de modification de la remise - * @param User $user Utilisateur qui definie la remise - * @return int <0 if KO, >0 if OK - */ - function set_remise_client($remise, $note, User $user) - { - global $conf, $langs; + /** + * Definit la societe comme un client + * + * @param float $remise Valeur en % de la remise + * @param string $note Note/Motif de modification de la remise + * @param User $user Utilisateur qui definie la remise + * @return int <0 if KO, >0 if OK + */ + function set_remise_client($remise, $note, User $user) + { + global $conf, $langs; - // Nettoyage parametres - $note=trim($note); - if (! $note) - { - $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("NoteReason")); - return -2; - } + // Nettoyage parametres + $note=trim($note); + if (! $note) + { + $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("NoteReason")); + return -2; + } - dol_syslog(get_class($this)."::set_remise_client ".$remise.", ".$note.", ".$user->id); + dol_syslog(get_class($this)."::set_remise_client ".$remise.", ".$note.", ".$user->id); - if ($this->id) - { - $this->db->begin(); + if ($this->id) + { + $this->db->begin(); - $now=dol_now(); + $now=dol_now(); - // Positionne remise courante - $sql = "UPDATE ".MAIN_DB_PREFIX."societe "; - $sql.= " SET remise_client = '".$this->db->escape($remise)."'"; - $sql.= " WHERE rowid = " . $this->id; - $resql=$this->db->query($sql); - if (! $resql) - { - $this->db->rollback(); - $this->error=$this->db->error(); - return -1; - } + // Positionne remise courante + $sql = "UPDATE ".MAIN_DB_PREFIX."societe "; + $sql.= " SET remise_client = '".$this->db->escape($remise)."'"; + $sql.= " WHERE rowid = " . $this->id; + $resql=$this->db->query($sql); + if (! $resql) + { + $this->db->rollback(); + $this->error=$this->db->error(); + return -1; + } - // Ecrit trace dans historique des remises - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise"; - $sql.= " (entity, datec, fk_soc, remise_client, note, fk_user_author)"; - $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', ".$this->id.", '".$this->db->escape($remise)."',"; - $sql.= " '".$this->db->escape($note)."',"; - $sql.= " ".$user->id; - $sql.= ")"; + // Ecrit trace dans historique des remises + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise"; + $sql.= " (entity, datec, fk_soc, remise_client, note, fk_user_author)"; + $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', ".$this->id.", '".$this->db->escape($remise)."',"; + $sql.= " '".$this->db->escape($note)."',"; + $sql.= " ".$user->id; + $sql.= ")"; - $resql=$this->db->query($sql); - if (! $resql) - { - $this->db->rollback(); - $this->error=$this->db->lasterror(); - return -1; - } + $resql=$this->db->query($sql); + if (! $resql) + { + $this->db->rollback(); + $this->error=$this->db->lasterror(); + return -1; + } - $this->db->commit(); - return 1; - } - } + $this->db->commit(); + return 1; + } + } - /** - * Add a discount for third party - * - * @param float $remise Amount of discount - * @param User $user User adding discount - * @param string $desc Reason of discount - * @param float $tva_tx VAT rate - * @return int <0 if KO, id of discount record if OK - */ - function set_remise_except($remise, User $user, $desc, $tva_tx=0) - { - global $langs; + /** + * Add a discount for third party + * + * @param float $remise Amount of discount + * @param User $user User adding discount + * @param string $desc Reason of discount + * @param float $tva_tx VAT rate + * @return int <0 if KO, id of discount record if OK + */ + function set_remise_except($remise, User $user, $desc, $tva_tx=0) + { + global $langs; - // Clean parameters - $remise = price2num($remise); - $desc = trim($desc); + // Clean parameters + $remise = price2num($remise); + $desc = trim($desc); - // Check parameters - if (! $remise > 0) - { - $this->error=$langs->trans("ErrorWrongValueForParameter","1"); - return -1; - } - if (! $desc) - { - $this->error=$langs->trans("ErrorWrongValueForParameter","3"); - return -2; - } + // Check parameters + if (! $remise > 0) + { + $this->error=$langs->trans("ErrorWrongValueForParameter","1"); + return -1; + } + if (! $desc) + { + $this->error=$langs->trans("ErrorWrongValueForParameter","3"); + return -2; + } - if ($this->id) - { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + if ($this->id) + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $discount = new DiscountAbsolute($this->db); - $discount->fk_soc=$this->id; - $discount->amount_ht=price2num($remise,'MT'); - $discount->amount_tva=price2num($remise*$tva_tx/100,'MT'); - $discount->amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT'); - $discount->tva_tx=price2num($tva_tx,'MT'); - $discount->description=$desc; - $result=$discount->create($user); - if ($result > 0) - { - return $result; - } - else - { - $this->error=$discount->error; - return -3; - } - } - else return 0; - } + $discount = new DiscountAbsolute($this->db); + $discount->fk_soc=$this->id; + $discount->amount_ht=price2num($remise,'MT'); + $discount->amount_tva=price2num($remise*$tva_tx/100,'MT'); + $discount->amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT'); + $discount->tva_tx=price2num($tva_tx,'MT'); + $discount->description=$desc; + $result=$discount->create($user); + if ($result > 0) + { + return $result; + } + else + { + $this->error=$discount->error; + return -3; + } + } + else return 0; + } - /** - * Renvoie montant TTC des reductions/avoirs en cours disponibles de la societe - * - * @param User $user Filtre sur un user auteur des remises - * @param string $filter Filtre autre - * @param integer $maxvalue Filter on max value for discount - * @return int <0 if KO, Credit note amount otherwise - */ - function getAvailableDiscounts($user='',$filter='',$maxvalue=0) - { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + /** + * Renvoie montant TTC des reductions/avoirs en cours disponibles de la societe + * + * @param User $user Filtre sur un user auteur des remises + * @param string $filter Filtre autre + * @param integer $maxvalue Filter on max value for discount + * @return int <0 if KO, Credit note amount otherwise + */ + function getAvailableDiscounts($user='',$filter='',$maxvalue=0) + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $discountstatic=new DiscountAbsolute($this->db); - $result=$discountstatic->getAvailableDiscounts($this,$user,$filter,$maxvalue); - if ($result >= 0) - { - return $result; - } - else - { - $this->error=$discountstatic->error; - return -1; - } - } + $discountstatic=new DiscountAbsolute($this->db); + $result=$discountstatic->getAvailableDiscounts($this,$user,$filter,$maxvalue); + if ($result >= 0) + { + return $result; + } + else + { + $this->error=$discountstatic->error; + return -1; + } + } - /** - * Return array of sales representatives - * - * @param User $user Object user - * @return array Array of sales representatives of third party - */ - function getSalesRepresentatives(User $user) - { - global $conf; + /** + * Return array of sales representatives + * + * @param User $user Object user + * @return array Array of sales representatives of third party + */ + function getSalesRepresentatives(User $user) + { + global $conf; - $reparray=array(); + $reparray=array(); - $sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."user as u"; - if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) - { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE ((ug.fk_user = sc.fk_user"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1)"; - } - else - $sql.= " WHERE entity in (0, ".$conf->entity.")"; + $sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."user as u"; + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + { + $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; + $sql.= " WHERE ((ug.fk_user = sc.fk_user"; + $sql.= " AND ug.entity = ".$conf->entity.")"; + $sql.= " OR u.admin = 1)"; + } + else + $sql.= " WHERE entity in (0, ".$conf->entity.")"; - $sql.= " AND u.rowid = sc.fk_user AND sc.fk_soc = ".$this->id; + $sql.= " AND u.rowid = sc.fk_user AND sc.fk_soc = ".$this->id; - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - $reparray[$i]['id']=$obj->rowid; - $reparray[$i]['lastname']=$obj->lastname; - $reparray[$i]['firstname']=$obj->firstname; - $reparray[$i]['email']=$obj->email; - $reparray[$i]['statut']=$obj->statut; - $reparray[$i]['entity']=$obj->entity; - $reparray[$i]['login']=$obj->login; - $reparray[$i]['photo']=$obj->photo; - $i++; - } - return $reparray; - } - else { - dol_print_error($this->db); - return -1; - } - } + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $reparray[$i]['id']=$obj->rowid; + $reparray[$i]['lastname']=$obj->lastname; + $reparray[$i]['firstname']=$obj->firstname; + $reparray[$i]['email']=$obj->email; + $reparray[$i]['statut']=$obj->statut; + $reparray[$i]['entity']=$obj->entity; + $reparray[$i]['login']=$obj->login; + $reparray[$i]['photo']=$obj->photo; + $i++; + } + return $reparray; + } + else { + dol_print_error($this->db); + return -1; + } + } - /** - * Set the price level - * - * @param int $price_level Level of price - * @param User $user Use making change - * @return int <0 if KO, >0 if OK - */ - function set_price_level($price_level, User $user) - { - if ($this->id) - { - $now=dol_now(); + /** + * Set the price level + * + * @param int $price_level Level of price + * @param User $user Use making change + * @return int <0 if KO, >0 if OK + */ + function set_price_level($price_level, User $user) + { + if ($this->id) + { + $now=dol_now(); - $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; - $sql .= " SET price_level = '".$this->db->escape($price_level)."'"; - $sql .= " WHERE rowid = " . $this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; + $sql .= " SET price_level = '".$this->db->escape($price_level)."'"; + $sql .= " WHERE rowid = " . $this->id; - if (! $this->db->query($sql)) - { - dol_print_error($this->db); - return -1; - } + if (! $this->db->query($sql)) + { + dol_print_error($this->db); + return -1; + } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_prices"; - $sql .= " (datec, fk_soc, price_level, fk_user_author)"; - $sql .= " VALUES ('".$this->db->idate($now)."', ".$this->id.", '".$this->db->escape($price_level)."', ".$user->id.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_prices"; + $sql .= " (datec, fk_soc, price_level, fk_user_author)"; + $sql .= " VALUES ('".$this->db->idate($now)."', ".$this->id.", '".$this->db->escape($price_level)."', ".$user->id.")"; - if (! $this->db->query($sql)) - { - dol_print_error($this->db); - return -1; - } - return 1; - } - return -1; - } + if (! $this->db->query($sql)) + { + dol_print_error($this->db); + return -1; + } + return 1; + } + return -1; + } - /** - * Add link to sales representative - * - * @param User $user Object user - * @param int $commid Id of user - * @return void - */ - function add_commercial(User $user, $commid) - { - if ($this->id > 0 && $commid > 0) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; - $sql.= " WHERE fk_soc = ".$this->id." AND fk_user =".$commid; + /** + * Add link to sales representative + * + * @param User $user Object user + * @param int $commid Id of user + * @return void + */ + function add_commercial(User $user, $commid) + { + if ($this->id > 0 && $commid > 0) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; + $sql.= " WHERE fk_soc = ".$this->id." AND fk_user =".$commid; - $this->db->query($sql); + $this->db->query($sql); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_commerciaux"; - $sql.= " ( fk_soc, fk_user )"; - $sql.= " VALUES (".$this->id.",".$commid.")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_commerciaux"; + $sql.= " ( fk_soc, fk_user )"; + $sql.= " VALUES (".$this->id.",".$commid.")"; - if (! $this->db->query($sql) ) - { - dol_syslog(get_class($this)."::add_commercial Erreur"); - } - } - } + if (! $this->db->query($sql) ) + { + dol_syslog(get_class($this)."::add_commercial Erreur"); + } + } + } - /** - * Add link to sales representative - * - * @param User $user Object user - * @param int $commid Id of user - * @return void - */ - function del_commercial(User $user, $commid) - { - if ($this->id > 0 && $commid > 0) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux "; - $sql .= " WHERE fk_soc = ".$this->id." AND fk_user =".$commid; + /** + * Add link to sales representative + * + * @param User $user Object user + * @param int $commid Id of user + * @return void + */ + function del_commercial(User $user, $commid) + { + if ($this->id > 0 && $commid > 0) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux "; + $sql .= " WHERE fk_soc = ".$this->id." AND fk_user =".$commid; - if (! $this->db->query($sql) ) - { - dol_syslog(get_class($this)."::del_commercial Erreur"); - } - } - } + if (! $this->db->query($sql) ) + { + dol_syslog(get_class($this)."::del_commercial Erreur"); + } + } + } - /** - * Return a link on thirdparty (with picto) - * - * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) - * @param string $option Target of link ('', 'customer', 'prospect', 'supplier', 'project') - * @param int $maxlen Max length of name - * @param int $notooltip 1=Disable tooltip - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @return string String with URL - */ - function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0, $save_lastsearch_value=-1) - { - global $conf, $langs, $hookmanager; + /** + * Return a link on thirdparty (with picto) + * + * @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only) + * @param string $option Target of link ('', 'customer', 'prospect', 'supplier', 'project') + * @param int $maxlen Max length of name + * @param int $notooltip 1=Disable tooltip + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0, $save_lastsearch_value=-1) + { + global $conf, $langs, $hookmanager; - if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - $name=$this->name?$this->name:$this->nom; + $name=$this->name?$this->name:$this->nom; - if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) - { - if (($this->client) && (! empty ( $this->code_client )) - && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 - || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 - ) - ) - $code = $this->code_client . ' - '; + if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) + { + if (($this->client) && (! empty ( $this->code_client )) + && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 + || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 + ) + ) + $code = $this->code_client . ' - '; - if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) - && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 - || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 - ) - ) - $code .= $this->code_fournisseur . ' - '; + if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) + && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 + || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 + ) + ) + $code .= $this->code_fournisseur . ' - '; - if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) - $name =$code.' '.$name; - else - $name =$code; - } + if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) + $name =$code.' '.$name; + else + $name =$code; + } - if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')'; + if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')'; - $result=''; $label=''; - $linkstart=''; $linkend=''; + $result=''; $label=''; + $linkstart=''; $linkend=''; - if (! empty($this->logo) && class_exists('Form')) - { - $label.= '
        '; - $label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini'); - $label.= '
        '; - } + if (! empty($this->logo) && class_exists('Form')) + { + $label.= '
        '; + $label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini'); + $label.= '
        '; + } - $label.= '
        '; + $label.= '
        '; - if ($option == 'customer' || $option == 'compta' || $option == 'category' || $option == 'category_supplier') - { - $label.= '' . $langs->trans("ShowCustomer") . ''; - $linkstart = ''; - $linkstart = ''; - $linkstart = ''; - $linkstart = ''; - $linkstart = ''; - $linkstart = ''; - $linkstart = ''; - $linkstart = ''; + $linkstart = ''; + $linkstart = ''; + $linkstart = ''; + $linkstart = ''; + $linkstart = ''; + $linkstart = ''; + $linkstart = ''; + $linkstart = ''; - $linkstart = ''; + $linkstart = 'canvas)?'&canvas='.$this->canvas:''); + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $linkstart.='&save_lastsearch_values=1'; + $linkstart.='"'; - $linkclose=''; - if (empty($notooltip)) - { - if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - $label=$langs->trans("ShowCompany"); - $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; - } - $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose.=' class="classfortooltip"'; + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowCompany"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip"'; - if (! is_object($hookmanager)) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager=new HookManager($this->db); - } - $hookmanager->initHooks(array('societedao')); - $parameters=array('id'=>$this->id); - $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) $linkclose = $hookmanager->resPrint; - } - $linkstart.=$linkclose.'>'; - $linkend=''; + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('societedao')); + $parameters=array('id'=>$this->id); + $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $linkclose = $hookmanager->resPrint; + } + $linkstart.=$linkclose.'>'; + $linkend=''; - global $user; - if (! $user->rights->societe->client->voir && $user->societe_id > 0 && $this->id != $user->societe_id) - { - $linkstart=''; - $linkend=''; - } + global $user; + if (! $user->rights->societe->client->voir && $user->societe_id > 0 && $this->id != $user->societe_id) + { + $linkstart=''; + $linkend=''; + } - if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip valigntextbottom"'), 0, 0, $notooltip?0:1).$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$linkstart.($maxlen?dol_trunc($name,$maxlen):$name).$linkend; + if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip valigntextbottom"'), 0, 0, $notooltip?0:1).$linkend); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$linkstart.($maxlen?dol_trunc($name,$maxlen):$name).$linkend; - return $result; - } + return $result; + } - /** - * Return label of status (activity, closed) - * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long - * @return string Libelle - */ - function getLibStatut($mode=0) - { - return $this->LibStatut($this->status,$mode); - } + /** + * Return label of status (activity, closed) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long + * @return string Libelle + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->status,$mode); + } - /** - * Renvoi le libelle d'un statut donne - * - * @param int $statut Id statut - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @return string Libelle du statut - */ - function LibStatut($statut,$mode=0) - { - global $langs; - $langs->load('companies'); + /** + * Renvoi le libelle d'un statut donne + * + * @param int $statut Id statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Libelle du statut + */ + function LibStatut($statut,$mode=0) + { + global $langs; + $langs->load('companies'); - if ($mode == 0) - { - if ($statut==0) return $langs->trans("ActivityCeased"); - if ($statut==1) return $langs->trans("InActivity"); - } - if ($mode == 1) - { - if ($statut==0) return $langs->trans("ActivityCeased"); - if ($statut==1) return $langs->trans("InActivity"); - } - if ($mode == 2) - { - if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased"); - if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity"); - } - if ($mode == 3) - { - if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"'); - if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"'); - } - if ($mode == 4) - { - if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased"); - if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity"); - } - if ($mode == 5) - { - if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"'); - if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"'); - } - } + if ($mode == 0) + { + if ($statut==0) return $langs->trans("ActivityCeased"); + if ($statut==1) return $langs->trans("InActivity"); + } + if ($mode == 1) + { + if ($statut==0) return $langs->trans("ActivityCeased"); + if ($statut==1) return $langs->trans("InActivity"); + } + if ($mode == 2) + { + if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased"); + if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity"); + } + if ($mode == 3) + { + if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"'); + if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"'); + } + if ($mode == 4) + { + if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"').' '.$langs->trans("ActivityCeased"); + if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"').' '.$langs->trans("InActivity"); + } + if ($mode == 5) + { + if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"'); + if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"'); + } + } - /** - * Return list of contacts emails existing for third party - * - * @param int $addthirdparty 1=Add also a record for thirdparty email - * @return array Array of contacts emails - */ - function thirdparty_and_contact_email_array($addthirdparty=0) - { - global $langs; + /** + * Return list of contacts emails existing for third party + * + * @param int $addthirdparty 1=Add also a record for thirdparty email + * @return array Array of contacts emails + */ + function thirdparty_and_contact_email_array($addthirdparty=0) + { + global $langs; - $contact_emails = $this->contact_property_array('email',1); - if ($this->email && $addthirdparty) - { - if (empty($this->name)) $this->name=$this->nom; - $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; - } - //var_dump($contact_emails) - return $contact_emails; - } + $contact_emails = $this->contact_property_array('email',1); + if ($this->email && $addthirdparty) + { + if (empty($this->name)) $this->name=$this->nom; + $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; + } + //var_dump($contact_emails) + return $contact_emails; + } - /** - * Return list of contacts mobile phone existing for third party - * - * @return array Array of contacts emails - */ - function thirdparty_and_contact_phone_array() - { - global $langs; + /** + * Return list of contacts mobile phone existing for third party + * + * @return array Array of contacts emails + */ + function thirdparty_and_contact_phone_array() + { + global $langs; - $contact_phone = $this->contact_property_array('mobile'); + $contact_phone = $this->contact_property_array('mobile'); - if (! empty($this->phone)) // If a phone of thirdparty is defined, we add it ot mobile of contacts - { - if (empty($this->name)) $this->name=$this->nom; - // TODO: Tester si tel non deja present dans tableau contact - $contact_phone['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->phone.">"; - } - return $contact_phone; - } + if (! empty($this->phone)) // If a phone of thirdparty is defined, we add it ot mobile of contacts + { + if (empty($this->name)) $this->name=$this->nom; + // TODO: Tester si tel non deja present dans tableau contact + $contact_phone['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->phone.">"; + } + return $contact_phone; + } - /** - * Return list of contacts emails or mobile existing for third party - * - * @param string $mode 'email' or 'mobile' + /** + * Return list of contacts emails or mobile existing for third party + * + * @param string $mode 'email' or 'mobile' * @param int $hidedisabled 1=Hide contact if disabled - * @return array Array of contacts emails or mobile array(id=>'Name ') - */ - function contact_property_array($mode='email', $hidedisabled=0) - { - global $langs; + * @return array Array of contacts emails or mobile array(id=>'Name ') + */ + function contact_property_array($mode='email', $hidedisabled=0) + { + global $langs; - $contact_property = array(); + $contact_property = array(); - $sql = "SELECT rowid, email, statut, phone_mobile, lastname, poste, firstname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople"; - $sql.= " WHERE fk_soc = ".$this->id; + $sql = "SELECT rowid, email, statut, phone_mobile, lastname, poste, firstname"; + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople"; + $sql.= " WHERE fk_soc = ".$this->id; - $resql=$this->db->query($sql); - if ($resql) - { - $nump = $this->db->num_rows($resql); - if ($nump) - { - $sepa="("; $sepb=")"; - if ($mode == 'email') - { - $sepa="<"; $sepb=">"; - } - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object($resql); - if ($mode == 'email') $property=$obj->email; - else if ($mode == 'mobile') $property=$obj->phone_mobile; - else $property=$obj->$mode; + $resql=$this->db->query($sql); + if ($resql) + { + $nump = $this->db->num_rows($resql); + if ($nump) + { + $sepa="("; $sepb=")"; + if ($mode == 'email') + { + $sepa="<"; $sepb=">"; + } + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($resql); + if ($mode == 'email') $property=$obj->email; + else if ($mode == 'mobile') $property=$obj->phone_mobile; + else $property=$obj->$mode; // Show all contact. If hidedisabled is 1, showonly contacts with status = 1 - if ($obj->statut == 1 || empty($hidedisabled)) - { - if (empty($property)) - { - if ($mode == 'email') $property=$langs->trans("NoEMail"); - else if ($mode == 'mobile') $property=$langs->trans("NoMobilePhone"); - } + if ($obj->statut == 1 || empty($hidedisabled)) + { + if (empty($property)) + { + if ($mode == 'email') $property=$langs->trans("NoEMail"); + else if ($mode == 'mobile') $property=$langs->trans("NoMobilePhone"); + } - if (!empty($obj->poste)) - { + if (!empty($obj->poste)) + { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname)).($obj->poste?" - ".$obj->poste:"").(($mode != 'poste' && $property)?" ".$sepa.$property.$sepb:''); } else { $contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname)).(($mode != 'poste' && $property)?" ".$sepa.$property.$sepb:''); } - } - $i++; - } - } - } - else - { - dol_print_error($this->db); - } - return $contact_property; - } + } + $i++; + } + } + } + else + { + dol_print_error($this->db); + } + return $contact_property; + } - /** - * Renvoie la liste des contacts de cette societe - * - * @return array tableau des contacts - */ - function contact_array() - { - $contacts = array(); + /** + * Renvoie la liste des contacts de cette societe + * + * @return array tableau des contacts + */ + function contact_array() + { + $contacts = array(); - $sql = "SELECT rowid, lastname, firstname FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id; - $resql=$this->db->query($sql); - if ($resql) - { - $nump = $this->db->num_rows($resql); - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object($resql); - $contacts[$obj->rowid] = dolGetFirstLastname($obj->firstname,$obj->lastname); - $i++; - } - } - } - else - { - dol_print_error($this->db); - } - return $contacts; - } + $sql = "SELECT rowid, lastname, firstname FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id; + $resql=$this->db->query($sql); + if ($resql) + { + $nump = $this->db->num_rows($resql); + if ($nump) + { + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($resql); + $contacts[$obj->rowid] = dolGetFirstLastname($obj->firstname,$obj->lastname); + $i++; + } + } + } + else + { + dol_print_error($this->db); + } + return $contacts; + } - /** - * Renvoie la liste des contacts de cette societe - * - * @return array $contacts tableau des contacts - */ - function contact_array_objects() - { - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; - $contacts = array(); + /** + * Renvoie la liste des contacts de cette societe + * + * @return array $contacts tableau des contacts + */ + function contact_array_objects() + { + require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; + $contacts = array(); - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id; - $resql=$this->db->query($sql); - if ($resql) - { - $nump = $this->db->num_rows($resql); - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object($resql); - $contact = new Contact($this->db); - $contact->fetch($obj->rowid); - $contacts[] = $contact; - $i++; - } - } - } - else - { - dol_print_error($this->db); - } - return $contacts; - } + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id; + $resql=$this->db->query($sql); + if ($resql) + { + $nump = $this->db->num_rows($resql); + if ($nump) + { + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($resql); + $contact = new Contact($this->db); + $contact->fetch($obj->rowid); + $contacts[] = $contact; + $i++; + } + } + } + else + { + dol_print_error($this->db); + } + return $contacts; + } - /** - * Return property of contact from its id - * - * @param int $rowid id of contact - * @param string $mode 'email' or 'mobile' - * @return string Email of contact with format: "Full name " - */ - function contact_get_property($rowid,$mode) - { - $contact_property=''; + /** + * Return property of contact from its id + * + * @param int $rowid id of contact + * @param string $mode 'email' or 'mobile' + * @return string Email of contact with format: "Full name " + */ + function contact_get_property($rowid,$mode) + { + $contact_property=''; - if (empty($rowid)) return ''; + if (empty($rowid)) return ''; - $sql = "SELECT rowid, email, phone_mobile, lastname, firstname"; - $sql.= " FROM ".MAIN_DB_PREFIX."socpeople"; - $sql.= " WHERE rowid = '".$rowid."'"; + $sql = "SELECT rowid, email, phone_mobile, lastname, firstname"; + $sql.= " FROM ".MAIN_DB_PREFIX."socpeople"; + $sql.= " WHERE rowid = '".$rowid."'"; - $resql=$this->db->query($sql); - if ($resql) - { - $nump = $this->db->num_rows($resql); + $resql=$this->db->query($sql); + if ($resql) + { + $nump = $this->db->num_rows($resql); - if ($nump) - { - $obj = $this->db->fetch_object($resql); + if ($nump) + { + $obj = $this->db->fetch_object($resql); - if ($mode == 'email') $contact_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">"; - else if ($mode == 'mobile') $contact_property = $obj->phone_mobile; - } - return $contact_property; - } - else - { - dol_print_error($this->db); - } + if ($mode == 'email') $contact_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">"; + else if ($mode == 'mobile') $contact_property = $obj->phone_mobile; + } + return $contact_property; + } + else + { + dol_print_error($this->db); + } - } + } - /** - * Return bank number property of thirdparty (label or rum) - * - * @param string $mode 'label' or 'rum' or 'format' - * @return string Bank number - */ - function display_rib($mode='label') - { - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + /** + * Return bank number property of thirdparty (label or rum) + * + * @param string $mode 'label' or 'rum' or 'format' + * @return string Bank number + */ + function display_rib($mode='label') + { + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; - $bac = new CompanyBankAccount($this->db); - $bac->fetch(0,$this->id); + $bac = new CompanyBankAccount($this->db); + $bac->fetch(0,$this->id); - if ($mode == 'label') - { - return $bac->getRibLabel(true); - } - elseif ($mode == 'rum') - { - if (empty($bac->rum)) - { - require_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php'; - $prelevement = new BonPrelevement($this->db); - $bac->fetch_thirdparty(); - $bac->rum = $prelevement->buildRumNumber($bac->thirdparty->code_client, $bac->datec, $bac->id); - } - return $bac->rum; - } - elseif ($mode == 'format') - { - return $bac->frstrecur; - } + if ($mode == 'label') + { + return $bac->getRibLabel(true); + } + elseif ($mode == 'rum') + { + if (empty($bac->rum)) + { + require_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php'; + $prelevement = new BonPrelevement($this->db); + $bac->fetch_thirdparty(); + $bac->rum = $prelevement->buildRumNumber($bac->thirdparty->code_client, $bac->datec, $bac->id); + } + return $bac->rum; + } + elseif ($mode == 'format') + { + return $bac->frstrecur; + } - return 'BadParameterToFunctionDisplayRib'; - } + return 'BadParameterToFunctionDisplayRib'; + } - /** - * Return Array of RIB - * - * @return array|int 0 if KO, Array of CompanyBanckAccount if OK - */ - function get_all_rib() - { - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE fk_soc = ".$this->id; - $result = $this->db->query($sql); - if (!$result) { - $this->error++; - $this->errors[] = $this->db->lasterror; - return 0; - } else { - $num_rows = $this->db->num_rows($result); - $rib_array = array(); - if ($num_rows) { - while ($obj = $this->db->fetch_object($result)) { - $rib = new CompanyBankAccount($this->db); - $rib->fetch($obj->rowid); - $rib_array[] = $rib; - } - } - return $rib_array; - } - } + /** + * Return Array of RIB + * + * @return array|int 0 if KO, Array of CompanyBanckAccount if OK + */ + function get_all_rib() + { + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE fk_soc = ".$this->id; + $result = $this->db->query($sql); + if (!$result) { + $this->error++; + $this->errors[] = $this->db->lasterror; + return 0; + } else { + $num_rows = $this->db->num_rows($result); + $rib_array = array(); + if ($num_rows) { + while ($obj = $this->db->fetch_object($result)) { + $rib = new CompanyBankAccount($this->db); + $rib->fetch($obj->rowid); + $rib_array[] = $rib; + } + } + return $rib_array; + } + } - /** - * Attribut un code client a partir du module de controle des codes. - * Return value is stored into this->code_client - * - * @param Societe $objsoc Object thirdparty - * @param int $type Should be 0 to say customer - * @return void - */ - function get_codeclient($objsoc=0,$type=0) - { - global $conf; - if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) - { - $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - - $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - $mod = new $module(); - - $this->code_client = $mod->getNextValue($objsoc,$type); - $this->prefixCustomerIsRequired = $mod->prefixIsRequired; - - dol_syslog(get_class($this)."::get_codeclient code_client=".$this->code_client." module=".$module); - } - } - - /** - * Attribut un code fournisseur a partir du module de controle des codes. - * Return value is stored into this->code_fournisseur - * - * @param Societe $objsoc Object thirdparty - * @param int $type Should be 1 to say supplier - * @return void - */ - function get_codefournisseur($objsoc=0,$type=1) - { - global $conf; - if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) - { + /** + * Attribut un code client a partir du module de controle des codes. + * Return value is stored into this->code_client + * + * @param Societe $objsoc Object thirdparty + * @param int $type Should be 0 to say customer + * @return void + */ + function get_codeclient($objsoc=0,$type=0) + { + global $conf; + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) + { $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - $mod = new $module(); - - $this->code_fournisseur = $mod->getNextValue($objsoc,$type); - - dol_syslog(get_class($this)."::get_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$module); - } - } - - /** - * Verifie si un code client est modifiable en fonction des parametres - * du module de controle des codes. - * - * @return int 0=No, 1=Yes - */ - function codeclient_modifiable() - { - global $conf; - if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) - { - $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - - $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - - $mod = new $module(); - - dol_syslog(get_class($this)."::codeclient_modifiable code_client=".$this->code_client." module=".$module); - if ($mod->code_modifiable_null && ! $this->code_client) return 1; - if ($mod->code_modifiable_invalide && $this->check_codeclient() < 0) return 1; - if ($mod->code_modifiable) return 1; // A mettre en dernier - return 0; - } - else - { - return 0; - } - } - - - /** - * Verifie si un code fournisseur est modifiable dans configuration du module de controle des codes - * - * @return int 0=No, 1=Yes - */ - function codefournisseur_modifiable() - { - global $conf; - if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) - { - $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - - $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - - $mod = new $module(); - - dol_syslog(get_class($this)."::codefournisseur_modifiable code_founisseur=".$this->code_fournisseur." module=".$module); - if ($mod->code_modifiable_null && ! $this->code_fournisseur) return 1; - if ($mod->code_modifiable_invalide && $this->check_codefournisseur() < 0) return 1; - if ($mod->code_modifiable) return 1; // A mettre en dernier - return 0; - } - else - { - return 0; - } - } - - - /** - * Check customer code - * - * @return int 0 if OK - * -1 ErrorBadCustomerCodeSyntax - * -2 ErrorCustomerCodeRequired - * -3 ErrorCustomerCodeAlreadyUsed - * -4 ErrorPrefixRequired - */ - function check_codeclient() - { - global $conf; - if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) - { - $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - - $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - - $mod = new $module(); - - dol_syslog(get_class($this)."::check_codeclient code_client=".$this->code_client." module=".$module); - $result = $mod->verif($this->db, $this->code_client, $this, 0); - return $result; - } - else - { - return 0; - } - } - - /** - * Check supplier code - * - * @return int 0 if OK - * -1 ErrorBadCustomerCodeSyntax - * -2 ErrorCustomerCodeRequired - * -3 ErrorCustomerCodeAlreadyUsed - * -4 ErrorPrefixRequired - */ - function check_codefournisseur() - { - global $conf; - if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) - { - $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - - $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - $res=dol_include_once($dirroot.$module.'.php'); - if ($res) break; - } - - $mod = new $module(); - - dol_syslog(get_class($this)."::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$module); - $result = $mod->verif($this->db, $this->code_fournisseur, $this, 1); - return $result; - } - else - { - return 0; - } - } - - /** - * Renvoie un code compta, suivant le module de code compta. - * Peut etre identique a celui saisit ou genere automatiquement. - * A ce jour seule la generation automatique est implementee - * - * @param string $type Type of thirdparty ('customer' or 'supplier') - * @return string Code compta si ok, 0 si aucun, <0 si ko - */ - function get_codecompta($type) - { - global $conf; - - if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON)) - { - $file=''; - $dirsociete=array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) - { - if (file_exists(DOL_DOCUMENT_ROOT.'/'.$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php")) - { - $file=$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php"; - break; - } - } - - if (! empty($file)) - { - dol_include_once($file); - - $classname = $conf->global->SOCIETE_CODECOMPTA_ADDON; - $mod = new $classname; - - // Defini code compta dans $mod->code - $result = $mod->get_code($this->db, $this, $type); - - if ($type == 'customer') $this->code_compta = $mod->code; - else if ($type == 'supplier') $this->code_compta_fournisseur = $mod->code; - - return $result; - } - else - { - $this->error = 'ErrorAccountancyCodeNotDefined'; - return -1; - } - } - else - { - if ($type == 'customer') $this->code_compta = ''; - else if ($type == 'supplier') $this->code_compta_fournisseur = ''; - - return 0; - } - } - - /** - * Define parent commany of current company - * - * @param int $id Id of thirdparty to set or '' to remove - * @return int <0 if KO, >0 if OK - */ - function set_parent($id) - { - if ($this->id) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; - $sql.= " SET parent = ".($id > 0 ? $id : "null"); - $sql.= " WHERE rowid = " . $this->id; - dol_syslog(get_class($this).'::set_parent', LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->parent = $id; - return 1; - } - else + $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { - return -1; - } - } - else return -1; - } + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } + $mod = new $module(); + + $this->code_client = $mod->getNextValue($objsoc,$type); + $this->prefixCustomerIsRequired = $mod->prefixIsRequired; + + dol_syslog(get_class($this)."::get_codeclient code_client=".$this->code_client." module=".$module); + } + } /** - * Returns if a profid sould be verified - * - * @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6) - * @return boolean true , false - */ - function id_prof_verifiable($idprof) - { - global $conf; + * Attribut un code fournisseur a partir du module de controle des codes. + * Return value is stored into this->code_fournisseur + * + * @param Societe $objsoc Object thirdparty + * @param int $type Should be 1 to say supplier + * @return void + */ + function get_codefournisseur($objsoc=0,$type=1) + { + global $conf; + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) + { + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - switch($idprof) - { - case 1: - $ret=(!$conf->global->SOCIETE_IDPROF1_UNIQUE?false:true); - break; - case 2: - $ret=(!$conf->global->SOCIETE_IDPROF2_UNIQUE?false:true); - break; - case 3: - $ret=(!$conf->global->SOCIETE_IDPROF3_UNIQUE?false:true); - break; - case 4: - $ret=(!$conf->global->SOCIETE_IDPROF4_UNIQUE?false:true); - break; - case 5: - $ret=(!$conf->global->SOCIETE_IDPROF5_UNIQUE?false:true); - break; - case 6: - $ret=(!$conf->global->SOCIETE_IDPROF6_UNIQUE?false:true); - break; - default: - $ret=false; - } + $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) + { + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } + $mod = new $module(); - return $ret; - } + $this->code_fournisseur = $mod->getNextValue($objsoc,$type); + + dol_syslog(get_class($this)."::get_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$module); + } + } /** - * Verify if a profid exists into database for others thirds - * - * @param string $idprof 'idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','email' (Example: idprof1=siren, idprof2=siret, idprof3=naf, idprof4=rcs/rm) - * @param string $value Value of profid - * @param int $socid Id of thirdparty to exclude (if update) - * @return boolean True if exists, False if not - */ - function id_prof_exists($idprof, $value, $socid=0) - { - $field = $idprof; + * Verifie si un code client est modifiable en fonction des parametres + * du module de controle des codes. + * + * @return int 0=No, 1=Yes + */ + function codeclient_modifiable() + { + global $conf; + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) + { + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; - switch($idprof) // For backward compatibility - { - case '1': - case 'idprof1': - $field="siren"; - break; - case '2': - case 'idprof2': - $field="siret"; - break; - case '3': - case 'idprof3': - $field="ape"; - break; - case '4': - case 'idprof4': - $field="idprof4"; - break; - case '5': - $field="idprof5"; - break; - case '6': - $field="idprof6"; - break; - } + $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) + { + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } - //Verify duplicate entries - $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."' AND entity IN (".getEntity('societe').")"; - if($socid) $sql .= " AND rowid <> ".$socid; - $resql = $this->db->query($sql); - if ($resql) - { - $obj = $this->db->fetch_object($resql); - $count = $obj->idprof; - } - else - { - $count = 0; - print $this->db->error(); - } - $this->db->free($resql); + $mod = new $module(); + + dol_syslog(get_class($this)."::codeclient_modifiable code_client=".$this->code_client." module=".$module); + if ($mod->code_modifiable_null && ! $this->code_client) return 1; + if ($mod->code_modifiable_invalide && $this->check_codeclient() < 0) return 1; + if ($mod->code_modifiable) return 1; // A mettre en dernier + return 0; + } + else + { + return 0; + } + } + + + /** + * Verifie si un code fournisseur est modifiable dans configuration du module de controle des codes + * + * @return int 0=No, 1=Yes + */ + function codefournisseur_modifiable() + { + global $conf; + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) + { + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; + + $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) + { + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } + + $mod = new $module(); + + dol_syslog(get_class($this)."::codefournisseur_modifiable code_founisseur=".$this->code_fournisseur." module=".$module); + if ($mod->code_modifiable_null && ! $this->code_fournisseur) return 1; + if ($mod->code_modifiable_invalide && $this->check_codefournisseur() < 0) return 1; + if ($mod->code_modifiable) return 1; // A mettre en dernier + return 0; + } + else + { + return 0; + } + } + + + /** + * Check customer code + * + * @return int 0 if OK + * -1 ErrorBadCustomerCodeSyntax + * -2 ErrorCustomerCodeRequired + * -3 ErrorCustomerCodeAlreadyUsed + * -4 ErrorPrefixRequired + */ + function check_codeclient() + { + global $conf; + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) + { + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; + + $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) + { + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } + + $mod = new $module(); + + dol_syslog(get_class($this)."::check_codeclient code_client=".$this->code_client." module=".$module); + $result = $mod->verif($this->db, $this->code_client, $this, 0); + return $result; + } + else + { + return 0; + } + } + + /** + * Check supplier code + * + * @return int 0 if OK + * -1 ErrorBadCustomerCodeSyntax + * -2 ErrorCustomerCodeRequired + * -3 ErrorCustomerCodeAlreadyUsed + * -4 ErrorPrefixRequired + */ + function check_codefournisseur() + { + global $conf; + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) + { + $module=$conf->global->SOCIETE_CODECLIENT_ADDON; + + $dirsociete=array_merge(array('/core/modules/societe/'),$conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) + { + $res=dol_include_once($dirroot.$module.'.php'); + if ($res) break; + } + + $mod = new $module(); + + dol_syslog(get_class($this)."::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$module); + $result = $mod->verif($this->db, $this->code_fournisseur, $this, 1); + return $result; + } + else + { + return 0; + } + } + + /** + * Renvoie un code compta, suivant le module de code compta. + * Peut etre identique a celui saisit ou genere automatiquement. + * A ce jour seule la generation automatique est implementee + * + * @param string $type Type of thirdparty ('customer' or 'supplier') + * @return string Code compta si ok, 0 si aucun, <0 si ko + */ + function get_codecompta($type) + { + global $conf; + + if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON)) + { + $file=''; + $dirsociete=array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) + { + if (file_exists(DOL_DOCUMENT_ROOT.'/'.$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php")) + { + $file=$dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.".php"; + break; + } + } + + if (! empty($file)) + { + dol_include_once($file); + + $classname = $conf->global->SOCIETE_CODECOMPTA_ADDON; + $mod = new $classname; + + // Defini code compta dans $mod->code + $result = $mod->get_code($this->db, $this, $type); + + if ($type == 'customer') $this->code_compta = $mod->code; + else if ($type == 'supplier') $this->code_compta_fournisseur = $mod->code; + + return $result; + } + else + { + $this->error = 'ErrorAccountancyCodeNotDefined'; + return -1; + } + } + else + { + if ($type == 'customer') $this->code_compta = ''; + else if ($type == 'supplier') $this->code_compta_fournisseur = ''; + + return 0; + } + } + + /** + * Define parent commany of current company + * + * @param int $id Id of thirdparty to set or '' to remove + * @return int <0 if KO, >0 if OK + */ + function set_parent($id) + { + if ($this->id) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; + $sql.= " SET parent = ".($id > 0 ? $id : "null"); + $sql.= " WHERE rowid = " . $this->id; + dol_syslog(get_class($this).'::set_parent', LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->parent = $id; + return 1; + } + else + { + return -1; + } + } + else return -1; + } + + /** + * Returns if a profid sould be verified + * + * @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6) + * @return boolean true , false + */ + function id_prof_verifiable($idprof) + { + global $conf; + + switch($idprof) + { + case 1: + $ret=(!$conf->global->SOCIETE_IDPROF1_UNIQUE?false:true); + break; + case 2: + $ret=(!$conf->global->SOCIETE_IDPROF2_UNIQUE?false:true); + break; + case 3: + $ret=(!$conf->global->SOCIETE_IDPROF3_UNIQUE?false:true); + break; + case 4: + $ret=(!$conf->global->SOCIETE_IDPROF4_UNIQUE?false:true); + break; + case 5: + $ret=(!$conf->global->SOCIETE_IDPROF5_UNIQUE?false:true); + break; + case 6: + $ret=(!$conf->global->SOCIETE_IDPROF6_UNIQUE?false:true); + break; + default: + $ret=false; + } + + return $ret; + } + + /** + * Verify if a profid exists into database for others thirds + * + * @param string $idprof 'idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','email' (Example: idprof1=siren, idprof2=siret, idprof3=naf, idprof4=rcs/rm) + * @param string $value Value of profid + * @param int $socid Id of thirdparty to exclude (if update) + * @return boolean True if exists, False if not + */ + function id_prof_exists($idprof, $value, $socid=0) + { + $field = $idprof; + + switch($idprof) // For backward compatibility + { + case '1': + case 'idprof1': + $field="siren"; + break; + case '2': + case 'idprof2': + $field="siret"; + break; + case '3': + case 'idprof3': + $field="ape"; + break; + case '4': + case 'idprof4': + $field="idprof4"; + break; + case '5': + $field="idprof5"; + break; + case '6': + $field="idprof6"; + break; + } + + //Verify duplicate entries + $sql = "SELECT COUNT(*) as idprof FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$value."' AND entity IN (".getEntity('societe').")"; + if($socid) $sql .= " AND rowid <> ".$socid; + $resql = $this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + $count = $obj->idprof; + } + else + { + $count = 0; + print $this->db->error(); + } + $this->db->free($resql); if ($count > 0) return true; else return false; - } + } - /** - * Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...) - * - * @param int $idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm) - * @param Societe $soc Objet societe - * @return int <=0 if KO, >0 if OK - * TODO better to have this in a lib than into a business class - */ - function id_prof_check($idprof,$soc) - { - global $conf; + /** + * Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...) + * + * @param int $idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm) + * @param Societe $soc Objet societe + * @return int <=0 if KO, >0 if OK + * TODO better to have this in a lib than into a business class + */ + function id_prof_check($idprof,$soc) + { + global $conf; - $ok=1; + $ok=1; - if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return 1; + if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return 1; - // Verifie SIREN si pays FR - if ($idprof == 1 && $soc->country_code == 'FR') - { - $chaine=trim($this->idprof1); - $chaine=preg_replace('/(\s)/','',$chaine); - - if (dol_strlen($chaine) != 9) return -1; - - $sum = 0; - - for ($i = 0 ; $i < 10 ; $i = $i+2) - { - $sum = $sum + substr($this->idprof1, (8 - $i), 1); - } - - for ($i = 1 ; $i < 9 ; $i = $i+2) - { - $ps = 2 * substr($this->idprof1, (8 - $i), 1); - - if ($ps > 9) - { - $ps = substr($ps, 0,1) + substr($ps, 1, 1); - } - $sum = $sum + $ps; - } - - if (substr($sum, -1) != 0) return -1; - } - - // Verifie SIRET si pays FR - if ($idprof == 2 && $soc->country_code == 'FR') - { - $chaine=trim($this->idprof2); - $chaine=preg_replace('/(\s)/','',$chaine); - - if (dol_strlen($chaine) != 14) return -1; - } - - //Verify CIF/NIF/NIE if pays ES - //Returns: 1 if NIF ok, 2 if CIF ok, 3 if NIE ok, -1 if NIF bad, -2 if CIF bad, -3 if NIE bad, 0 if unexpected bad - if ($idprof == 1 && $soc->country_code == 'ES') - { - $string=trim($this->idprof1); - $string=preg_replace('/(\s)/','',$string); - $string = strtoupper($string); - - for ($i = 0; $i < 9; $i ++) - $num[$i] = substr($string, $i, 1); - - //Check format - if (!preg_match('/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/', $string)) - return 0; - - //Check NIF - if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string)) - if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1)) - return 1; - else - return -1; - - //algorithm checking type code CIF - $sum = $num[2] + $num[4] + $num[6]; - for ($i = 1; $i < 8; $i += 2) - $sum += substr((2 * $num[$i]),0,1) + substr((2 * $num[$i]),1,1); - $n = 10 - substr($sum, strlen($sum) - 1, 1); - - //Chek special NIF - if (preg_match('/^[KLM]{1}/', $string)) - if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1)) - return 1; - else - return -1; - - //Check CIF - if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string)) - if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1)) - return 2; - else - return -2; - - //Check NIE T - if (preg_match('/^[T]{1}/', $string)) - if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string)) - return 3; - else - return -3; - - //Check NIE XYZ - if (preg_match('/^[XYZ]{1}/', $string)) - if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $string), 0, 8) % 23, 1)) - return 3; - else - return -3; - - //Can not be verified - return -4; - } - - return $ok; - } - - /** - * Return an url to check online a professional id or empty string - * - * @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm) - * @param Societe $thirdparty Object thirdparty - * @return string Url or empty string if no URL known - * TODO better in a lib than into business class - */ - function id_prof_url($idprof,$thirdparty) - { - global $conf,$langs,$hookmanager; - - $url=''; - $action = ''; - - $hookmanager->initHooks(array('idprofurl')); - $parameters=array('idprof'=>$idprof, 'company'=>$thirdparty); - $reshook=$hookmanager->executeHooks('getIdProfUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return ''; - - // TODO Move links to validate professional ID into a dictionary table "country" + "link" - if ($idprof == 1 && $thirdparty->country_code == 'FR') $url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/ - //if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; // Link no more valid - if ($idprof == 1 && $thirdparty->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1; - if ($idprof == 1 && $thirdparty->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; - - if ($url) return ''.$langs->trans("Check").''; - } - else - { - return $hookmanager->resPrint; - } - - return ''; - } - - /** - * Indique si la societe a des projets - * - * @return bool true si la societe a des projets, false sinon - */ - function has_projects() - { - $sql = 'SELECT COUNT(*) as numproj FROM '.MAIN_DB_PREFIX.'projet WHERE fk_soc = ' . $this->id; - $resql = $this->db->query($sql); - if ($resql) - { - $obj = $this->db->fetch_object($resql); - $count = $obj->numproj; - } - else - { - $count = 0; - print $this->db->error(); - } - $this->db->free($resql); - return ($count > 0); - } - - - /** - * Load information for tab info - * - * @param int $id Id of thirdparty to load - * @return void - */ - function info($id) - { - $sql = "SELECT s.rowid, s.nom as name, s.datec as date_creation, tms as date_modification,"; - $sql.= " fk_user_creat, fk_user_modif"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= " WHERE s.rowid = ".$id; - - $result=$this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); - - $this->id = $obj->rowid; - - if ($obj->fk_user_creat) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_creat); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_modif) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_modif); - $this->user_modification = $muser; - } - - $this->ref = $obj->name; - $this->date_creation = $this->db->jdate($obj->date_creation); - $this->date_modification = $this->db->jdate($obj->date_modification); - } - - $this->db->free($result); - - } - else + // Verifie SIREN si pays FR + if ($idprof == 1 && $soc->country_code == 'FR') { - dol_print_error($this->db); - } - } + $chaine=trim($this->idprof1); + $chaine=preg_replace('/(\s)/','',$chaine); - /** - * Return if third party is a company (Business) or an end user (Consumer) - * - * @return boolean true=is a company, false=a and user - */ - function isACompany() - { - global $conf; + if (dol_strlen($chaine) != 9) return -1; - // Define if third party is treated as company (or not) when nature is unknown - $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default - if (! empty($this->tva_intra)) $isacompany=1; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_SMALL','TE_MEDIUM','TE_LARGE','TE_GROUP'))) $isacompany=1; + $sum = 0; - return $isacompany; - } + for ($i = 0 ; $i < 10 ; $i = $i+2) + { + $sum = $sum + substr($this->idprof1, (8 - $i), 1); + } - /** - * Charge la liste des categories fournisseurs - * - * @return int 0 if success, <> 0 if error - */ - function LoadSupplierCateg() - { - $this->SupplierCategories = array(); - $sql = "SELECT rowid, label"; - $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; - $sql.= " WHERE type = ".Categorie::TYPE_SUPPLIER; + for ($i = 1 ; $i < 9 ; $i = $i+2) + { + $ps = 2 * substr($this->idprof1, (8 - $i), 1); - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj = $this->db->fetch_object($resql) ) - { - $this->SupplierCategories[$obj->rowid] = $obj->label; - } - return 0; - } - else - { - return -1; - } - } + if ($ps > 9) + { + $ps = substr($ps, 0,1) + substr($ps, 1, 1); + } + $sum = $sum + $ps; + } - /** - * Insert link supplier - category - * - * @param int $categorie_id Id of category - * @return int 0 if success, <> 0 if error - */ - function AddFournisseurInCategory($categorie_id) - { - if ($categorie_id > 0 && $this->id > 0) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_fournisseur (fk_categorie, fk_soc) "; - $sql.= " VALUES (".$categorie_id.", ".$this->id.")"; + if (substr($sum, -1) != 0) return -1; + } - if ($resql=$this->db->query($sql)) return 0; - } - else - { - return 0; - } - return -1; - } + // Verifie SIRET si pays FR + if ($idprof == 2 && $soc->country_code == 'FR') + { + $chaine=trim($this->idprof2); + $chaine=preg_replace('/(\s)/','',$chaine); + + if (dol_strlen($chaine) != 14) return -1; + } + + //Verify CIF/NIF/NIE if pays ES + //Returns: 1 if NIF ok, 2 if CIF ok, 3 if NIE ok, -1 if NIF bad, -2 if CIF bad, -3 if NIE bad, 0 if unexpected bad + if ($idprof == 1 && $soc->country_code == 'ES') + { + $string=trim($this->idprof1); + $string=preg_replace('/(\s)/','',$string); + $string = strtoupper($string); + + for ($i = 0; $i < 9; $i ++) + $num[$i] = substr($string, $i, 1); + + //Check format + if (!preg_match('/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/', $string)) + return 0; + + //Check NIF + if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string)) + if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1)) + return 1; + else + return -1; + + //algorithm checking type code CIF + $sum = $num[2] + $num[4] + $num[6]; + for ($i = 1; $i < 8; $i += 2) + $sum += substr((2 * $num[$i]),0,1) + substr((2 * $num[$i]),1,1); + $n = 10 - substr($sum, strlen($sum) - 1, 1); + + //Chek special NIF + if (preg_match('/^[KLM]{1}/', $string)) + if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1)) + return 1; + else + return -1; + + //Check CIF + if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string)) + if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1)) + return 2; + else + return -2; + + //Check NIE T + if (preg_match('/^[T]{1}/', $string)) + if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string)) + return 3; + else + return -3; + + //Check NIE XYZ + if (preg_match('/^[XYZ]{1}/', $string)) + if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $string), 0, 8) % 23, 1)) + return 3; + else + return -3; + + //Can not be verified + return -4; + } + + return $ok; + } + + /** + * Return an url to check online a professional id or empty string + * + * @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm) + * @param Societe $thirdparty Object thirdparty + * @return string Url or empty string if no URL known + * TODO better in a lib than into business class + */ + function id_prof_url($idprof,$thirdparty) + { + global $conf,$langs,$hookmanager; + + $url=''; + $action = ''; + + $hookmanager->initHooks(array('idprofurl')); + $parameters=array('idprof'=>$idprof, 'company'=>$thirdparty); + $reshook=$hookmanager->executeHooks('getIdProfUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return ''; + + // TODO Move links to validate professional ID into a dictionary table "country" + "link" + if ($idprof == 1 && $thirdparty->country_code == 'FR') $url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/ + //if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; // Link no more valid + if ($idprof == 1 && $thirdparty->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1; + if ($idprof == 1 && $thirdparty->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; + + if ($url) return ''.$langs->trans("Check").''; + } + else + { + return $hookmanager->resPrint; + } + + return ''; + } + + /** + * Indique si la societe a des projets + * + * @return bool true si la societe a des projets, false sinon + */ + function has_projects() + { + $sql = 'SELECT COUNT(*) as numproj FROM '.MAIN_DB_PREFIX.'projet WHERE fk_soc = ' . $this->id; + $resql = $this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + $count = $obj->numproj; + } + else + { + $count = 0; + print $this->db->error(); + } + $this->db->free($resql); + return ($count > 0); + } - /** - * Create a third party into database from a member object - * - * @param Adherent $member Object member - * @param string $socname Name of third party to force - * @param string $socalias Alias name of third party to force - * @return int <0 if KO, id of created account if OK - */ - function create_from_member(Adherent $member, $socname='', $socalias='') - { - global $user,$langs; + /** + * Load information for tab info + * + * @param int $id Id of thirdparty to load + * @return void + */ + function info($id) + { + $sql = "SELECT s.rowid, s.nom as name, s.datec as date_creation, tms as date_modification,"; + $sql.= " fk_user_creat, fk_user_modif"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= " WHERE s.rowid = ".$id; - $name = $socname?$socname:$member->societe; - if (empty($name)) $name=$member->getFullName($langs); + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); - $alias = $socalias?$socalias:''; + $this->id = $obj->rowid; - // Positionne parametres - $this->nom=$name; // TODO deprecated - $this->name=$name; - $this->name_alias=$alias; - $this->address=$member->address; - $this->zip=$member->zip; - $this->town=$member->town; - $this->country_code=$member->country_code; - $this->country_id=$member->country_id; - $this->phone=$member->phone; // Prof phone - $this->email=$member->email; - $this->skype=$member->skype; + if ($obj->fk_user_creat) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_creat); + $this->user_creation = $cuser; + } - $this->client = 1; // A member is a customer by default - $this->code_client = -1; - $this->code_fournisseur = -1; + if ($obj->fk_user_modif) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_modification = $muser; + } - $this->db->begin(); + $this->ref = $obj->name; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + } - // Cree et positionne $this->id - $result=$this->create($user); - if ($result >= 0) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; - $sql.= " SET fk_soc=".$this->id; - $sql.= " WHERE rowid=".$member->id; + $this->db->free($result); - dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->error=$this->db->error(); + } + else + { + dol_print_error($this->db); + } + } - $this->db->rollback(); - return -1; - } - } - else - { - // $this->error deja positionne - dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".join(',',$this->errors), LOG_ERR); + /** + * Return if third party is a company (Business) or an end user (Consumer) + * + * @return boolean true=is a company, false=a and user + */ + function isACompany() + { + global $conf; - $this->db->rollback(); - return $result; - } - } + // Define if third party is treated as company (or not) when nature is unknown + $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default + if (! empty($this->tva_intra)) $isacompany=1; + else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0; + else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_SMALL','TE_MEDIUM','TE_LARGE','TE_GROUP'))) $isacompany=1; - /** - * Set properties with value into $conf - * - * @param Conf $conf Conf object (possibility to use another entity) - * @return void - */ - function setMysoc(Conf $conf) - { - global $langs; + return $isacompany; + } - $this->id=0; - $this->name=empty($conf->global->MAIN_INFO_SOCIETE_NOM)?'':$conf->global->MAIN_INFO_SOCIETE_NOM; - $this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS; - $this->zip=empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP; - $this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN; + /** + * Charge la liste des categories fournisseurs + * + * @return int 0 if success, <> 0 if error + */ + function LoadSupplierCateg() + { + $this->SupplierCategories = array(); + $sql = "SELECT rowid, label"; + $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; + $sql.= " WHERE type = ".Categorie::TYPE_SUPPLIER; + + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj = $this->db->fetch_object($resql) ) + { + $this->SupplierCategories[$obj->rowid] = $obj->label; + } + return 0; + } + else + { + return -1; + } + } + + /** + * Insert link supplier - category + * + * @param int $categorie_id Id of category + * @return int 0 if success, <> 0 if error + */ + function AddFournisseurInCategory($categorie_id) + { + if ($categorie_id > 0 && $this->id > 0) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_fournisseur (fk_categorie, fk_soc) "; + $sql.= " VALUES (".$categorie_id.", ".$this->id.")"; + + if ($resql=$this->db->query($sql)) return 0; + } + else + { + return 0; + } + return -1; + } + + + /** + * Create a third party into database from a member object + * + * @param Adherent $member Object member + * @param string $socname Name of third party to force + * @param string $socalias Alias name of third party to force + * @return int <0 if KO, id of created account if OK + */ + function create_from_member(Adherent $member, $socname='', $socalias='') + { + global $user,$langs; + + $name = $socname?$socname:$member->societe; + if (empty($name)) $name=$member->getFullName($langs); + + $alias = $socalias?$socalias:''; + + // Positionne parametres + $this->nom=$name; // TODO deprecated + $this->name=$name; + $this->name_alias=$alias; + $this->address=$member->address; + $this->zip=$member->zip; + $this->town=$member->town; + $this->country_code=$member->country_code; + $this->country_id=$member->country_id; + $this->phone=$member->phone; // Prof phone + $this->email=$member->email; + $this->skype=$member->skype; + + $this->client = 1; // A member is a customer by default + $this->code_client = -1; + $this->code_fournisseur = -1; + + $this->db->begin(); + + // Cree et positionne $this->id + $result=$this->create($user); + if ($result >= 0) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; + $sql.= " SET fk_soc=".$this->id; + $sql.= " WHERE rowid=".$member->id; + + dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->error=$this->db->error(); + + $this->db->rollback(); + return -1; + } + } + else + { + // $this->error deja positionne + dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".join(',',$this->errors), LOG_ERR); + + $this->db->rollback(); + return $result; + } + } + + /** + * Set properties with value into $conf + * + * @param Conf $conf Conf object (possibility to use another entity) + * @return void + */ + function setMysoc(Conf $conf) + { + global $langs; + + $this->id=0; + $this->name=empty($conf->global->MAIN_INFO_SOCIETE_NOM)?'':$conf->global->MAIN_INFO_SOCIETE_NOM; + $this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS; + $this->zip=empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP; + $this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN; $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_STATE)?'':$conf->global->MAIN_INFO_SOCIETE_STATE; - /* Disabled: we don't want any SQL request into method setMySoc. This method set object from env only. + /* Disabled: we don't want any SQL request into method setMySoc. This method set object from env only. If we need label, label must be loaded by output that need it from id (label depends on output language) require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) { @@ -3081,165 +3081,165 @@ class Societe extends CommonObject } */ - $this->note_private=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; + $this->note_private=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; - $this->nom=$this->name; // deprecated + $this->nom=$this->name; // deprecated - // We define country_id, country_code and country - $country_id=$country_code=$country_label=''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) - { - $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_COUNTRY); - $country_id=$tmp[0]; - if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label" - { - $country_code=$tmp[1]; - $country_label=$tmp[2]; - } - else // For backward compatibility - { - dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_ERR); - include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - $country_code=getCountry($country_id,2,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore - $country_label=getCountry($country_id,0,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore - } - } - $this->country_id=$country_id; - $this->country_code=$country_code; - $this->country=$country_label; - if (is_object($langs)) $this->country=($langs->trans('Country'.$country_code)!='Country'.$country_code)?$langs->trans('Country'.$country_code):$country_label; + // We define country_id, country_code and country + $country_id=$country_code=$country_label=''; + if (! empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) + { + $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_COUNTRY); + $country_id=$tmp[0]; + if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label" + { + $country_code=$tmp[1]; + $country_label=$tmp[2]; + } + else // For backward compatibility + { + dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_ERR); + include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + $country_code=getCountry($country_id,2,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore + $country_label=getCountry($country_id,0,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore + } + } + $this->country_id=$country_id; + $this->country_code=$country_code; + $this->country=$country_label; + if (is_object($langs)) $this->country=($langs->trans('Country'.$country_code)!='Country'.$country_code)?$langs->trans('Country'.$country_code):$country_label; - $this->phone=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL; - $this->fax=empty($conf->global->MAIN_INFO_SOCIETE_FAX)?'':$conf->global->MAIN_INFO_SOCIETE_FAX; - $this->url=empty($conf->global->MAIN_INFO_SOCIETE_WEB)?'':$conf->global->MAIN_INFO_SOCIETE_WEB; - // Id prof generiques - $this->idprof1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN; - $this->idprof2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET; - $this->idprof3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE; - $this->idprof4=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS; - $this->idprof5=empty($conf->global->MAIN_INFO_PROFID5)?'':$conf->global->MAIN_INFO_PROFID5; - $this->idprof6=empty($conf->global->MAIN_INFO_PROFID6)?'':$conf->global->MAIN_INFO_PROFID6; - $this->tva_intra=empty($conf->global->MAIN_INFO_TVAINTRA)?'':$conf->global->MAIN_INFO_TVAINTRA; // VAT number, not necessarly INTRA. - $this->managers=empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS)?'':$conf->global->MAIN_INFO_SOCIETE_MANAGERS; - $this->capital=empty($conf->global->MAIN_INFO_CAPITAL)?'':$conf->global->MAIN_INFO_CAPITAL; - $this->forme_juridique_code=empty($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)?'':$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; - $this->email=empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?'':$conf->global->MAIN_INFO_SOCIETE_MAIL; - $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; - $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; - $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + $this->phone=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL; + $this->fax=empty($conf->global->MAIN_INFO_SOCIETE_FAX)?'':$conf->global->MAIN_INFO_SOCIETE_FAX; + $this->url=empty($conf->global->MAIN_INFO_SOCIETE_WEB)?'':$conf->global->MAIN_INFO_SOCIETE_WEB; + // Id prof generiques + $this->idprof1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN; + $this->idprof2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET; + $this->idprof3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE; + $this->idprof4=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS; + $this->idprof5=empty($conf->global->MAIN_INFO_PROFID5)?'':$conf->global->MAIN_INFO_PROFID5; + $this->idprof6=empty($conf->global->MAIN_INFO_PROFID6)?'':$conf->global->MAIN_INFO_PROFID6; + $this->tva_intra=empty($conf->global->MAIN_INFO_TVAINTRA)?'':$conf->global->MAIN_INFO_TVAINTRA; // VAT number, not necessarly INTRA. + $this->managers=empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS)?'':$conf->global->MAIN_INFO_SOCIETE_MANAGERS; + $this->capital=empty($conf->global->MAIN_INFO_CAPITAL)?'':$conf->global->MAIN_INFO_CAPITAL; + $this->forme_juridique_code=empty($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)?'':$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; + $this->email=empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?'':$conf->global->MAIN_INFO_SOCIETE_MAIL; + $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; + $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; + $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; - // Define if company use vat or not - $this->tva_assuj=$conf->global->FACTURE_TVAOPTION; + // Define if company use vat or not + $this->tva_assuj=$conf->global->FACTURE_TVAOPTION; - // Define if company use local taxes - $this->localtax1_assuj=((isset($conf->global->FACTURE_LOCAL_TAX1_OPTION) && ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on'))?1:0); - $this->localtax2_assuj=((isset($conf->global->FACTURE_LOCAL_TAX2_OPTION) && ($conf->global->FACTURE_LOCAL_TAX2_OPTION=='1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on'))?1:0); - } + // Define if company use local taxes + $this->localtax1_assuj=((isset($conf->global->FACTURE_LOCAL_TAX1_OPTION) && ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on'))?1:0); + $this->localtax2_assuj=((isset($conf->global->FACTURE_LOCAL_TAX2_OPTION) && ($conf->global->FACTURE_LOCAL_TAX2_OPTION=='1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on'))?1:0); + } - /** - * Initialise an instance with random values. - * Used to build previews or test instances. - * id must be 0 if object instance is a specimen. - * - * @return void - */ - function initAsSpecimen() - { - $now=dol_now(); + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void + */ + function initAsSpecimen() + { + $now=dol_now(); - // Initialize parameters - $this->id=0; - $this->name = 'THIRDPARTY SPECIMEN '.dol_print_date($now,'dayhourlog'); - $this->nom = $this->name; // For backward compatibility - $this->ref_ext = 'Ref ext'; - $this->specimen=1; - $this->address='21 jump street'; - $this->zip='99999'; - $this->town='MyTown'; - $this->state_id=1; - $this->state_code='AA'; - $this->state='MyState'; - $this->country_id=1; - $this->country_code='FR'; - $this->email='specimen@specimen.com'; - $this->skype='tom.hanson'; - $this->url='http://www.specimen.com'; + // Initialize parameters + $this->id=0; + $this->name = 'THIRDPARTY SPECIMEN '.dol_print_date($now,'dayhourlog'); + $this->nom = $this->name; // For backward compatibility + $this->ref_ext = 'Ref ext'; + $this->specimen=1; + $this->address='21 jump street'; + $this->zip='99999'; + $this->town='MyTown'; + $this->state_id=1; + $this->state_code='AA'; + $this->state='MyState'; + $this->country_id=1; + $this->country_code='FR'; + $this->email='specimen@specimen.com'; + $this->skype='tom.hanson'; + $this->url='http://www.specimen.com'; - $this->phone='0909090901'; - $this->fax='0909090909'; + $this->phone='0909090901'; + $this->fax='0909090909'; - $this->code_client='CC-'.dol_print_date($now,'dayhourlog'); - $this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog'); - $this->capital=10000; - $this->client=1; - $this->prospect=1; - $this->fournisseur=1; - $this->tva_assuj=1; - $this->tva_intra='EU1234567'; - $this->note_public='This is a comment (public)'; - $this->note_private='This is a comment (private)'; + $this->code_client='CC-'.dol_print_date($now,'dayhourlog'); + $this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog'); + $this->capital=10000; + $this->client=1; + $this->prospect=1; + $this->fournisseur=1; + $this->tva_assuj=1; + $this->tva_intra='EU1234567'; + $this->note_public='This is a comment (public)'; + $this->note_private='This is a comment (private)'; - $this->idprof1='idprof1'; - $this->idprof2='idprof2'; - $this->idprof3='idprof3'; - $this->idprof4='idprof4'; - $this->idprof5='idprof5'; - $this->idprof6='idprof6'; - } + $this->idprof1='idprof1'; + $this->idprof2='idprof2'; + $this->idprof3='idprof3'; + $this->idprof4='idprof4'; + $this->idprof5='idprof5'; + $this->idprof6='idprof6'; + } - /** - * Check if we must use localtax feature or not according to country (country of $mysoc in most cases). - * - * @param int $localTaxNum To get info for only localtax1 or localtax2 - * @return boolean true or false - */ - function useLocalTax($localTaxNum=0) - { - $sql = "SELECT t.localtax1, t.localtax2"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$this->db->escape($this->country_code)."'"; - $sql .= " AND t.active = 1"; - if (empty($localTaxNum)) $sql .= " AND (t.localtax1_type <> '0' OR t.localtax2_type <> '0')"; - elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; - elseif ($localTaxNum == 2) $sql .= " AND t.localtax2_type <> '0'"; + /** + * Check if we must use localtax feature or not according to country (country of $mysoc in most cases). + * + * @param int $localTaxNum To get info for only localtax1 or localtax2 + * @return boolean true or false + */ + function useLocalTax($localTaxNum=0) + { + $sql = "SELECT t.localtax1, t.localtax2"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$this->db->escape($this->country_code)."'"; + $sql .= " AND t.active = 1"; + if (empty($localTaxNum)) $sql .= " AND (t.localtax1_type <> '0' OR t.localtax2_type <> '0')"; + elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; + elseif ($localTaxNum == 2) $sql .= " AND t.localtax2_type <> '0'"; - dol_syslog("useLocalTax", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { + dol_syslog("useLocalTax", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { return ($this->db->num_rows($resql) > 0); - } - else return false; - } + } + else return false; + } - /** - * Check if we must use NPR Vat (french stupid rule) or not according to country (country of $mysoc in most cases). - * - * @return boolean true or false - */ - function useNPR() - { - $sql = "SELECT t.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; - $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$this->db->escape($this->country_code)."'"; - $sql .= " AND t.active = 1 AND t.recuperableonly = 1"; + /** + * Check if we must use NPR Vat (french stupid rule) or not according to country (country of $mysoc in most cases). + * + * @return boolean true or false + */ + function useNPR() + { + $sql = "SELECT t.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$this->db->escape($this->country_code)."'"; + $sql .= " AND t.active = 1 AND t.recuperableonly = 1"; - dol_syslog("useNPR", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - return ($this->db->num_rows($resql) > 0); - } - else return false; - } + dol_syslog("useNPR", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + return ($this->db->num_rows($resql) > 0); + } + else return false; + } - /** - * Check if we must use revenue stamps feature or not according to country (country of $mysocin most cases). - * - * @return boolean true or false - */ - function useRevenueStamp() - { + /** + * Check if we must use revenue stamps feature or not according to country (country of $mysocin most cases). + * + * @return boolean true or false + */ + function useRevenueStamp() + { $sql = "SELECT COUNT(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r, ".MAIN_DB_PREFIX."c_country as c"; $sql .= " WHERE r.fk_pays = c.rowid AND c.code = '".$this->db->escape($this->country_code)."'"; @@ -3294,11 +3294,11 @@ class Societe extends CommonObject * * @param User $user Utilisateur qui definie la remise * @return int <0 if KO, >0 if OK - * @deprecated Use update function instead + * @deprecated Use update function instead */ function set_prospect_level(User $user) { - return $this->update($this->id, $user); + return $this->update($this->id, $user); } /** @@ -3371,11 +3371,11 @@ class Societe extends CommonObject * * @param User $user User making change * @return int <0 if KO, >0 if OK - * @deprecated Use update function instead + * @deprecated Use update function instead */ function set_OutstandingBill(User $user) { - return $this->update($this->id, $user); + return $this->update($this->id, $user); } /** @@ -3539,39 +3539,39 @@ class Societe extends CommonObject */ function get_OutstandingBill() { - /* Accurate value of remain to pay is to sum remaintopay for each invoice + /* Accurate value of remain to pay is to sum remaintopay for each invoice $paiement = $invoice->getSommePaiement(); $creditnotes=$invoice->getSumCreditNotesUsed(); $deposits=$invoice->getSumDepositsUsed(); $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); */ - $sql = "SELECT rowid, total_ttc FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE fk_soc = ". $this->id; - $sql .= " AND paye = 0"; - $sql .= " AND fk_statut <> 0"; // Not a draft - //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason - $sql .= " AND fk_statut <> 3"; // Not abandonned - $sql .= " AND fk_statut <> 2"; // Not clasified as paid + $sql = "SELECT rowid, total_ttc FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= " WHERE fk_soc = ". $this->id; + $sql .= " AND paye = 0"; + $sql .= " AND fk_statut <> 0"; // Not a draft + //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason + $sql .= " AND fk_statut <> 3"; // Not abandonned + $sql .= " AND fk_statut <> 2"; // Not clasified as paid - dol_syslog("get_OutstandingBill", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $outstandingAmount = 0; - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $tmpobject=new Facture($this->db); - while($obj=$this->db->fetch_object($resql)) { - $tmpobject->id=$obj->rowid; - $paiement = $tmpobject->getSommePaiement(); - $creditnotes = $tmpobject->getSumCreditNotesUsed(); - $deposits = $tmpobject->getSumDepositsUsed(); - $outstandingAmount+= $obj->total_ttc - $paiement - $creditnotes - $deposits; - } - return $outstandingAmount; - } - else - return 0; + dol_syslog("get_OutstandingBill", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $outstandingAmount = 0; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $tmpobject=new Facture($this->db); + while($obj=$this->db->fetch_object($resql)) { + $tmpobject->id=$obj->rowid; + $paiement = $tmpobject->getSommePaiement(); + $creditnotes = $tmpobject->getSumCreditNotesUsed(); + $deposits = $tmpobject->getSumDepositsUsed(); + $outstandingAmount+= $obj->total_ttc - $paiement - $creditnotes - $deposits; + } + return $outstandingAmount; + } + else + return 0; } /** @@ -3620,33 +3620,33 @@ class Societe extends CommonObject if (! empty($moreparams) && ! empty($moreparams['use_companybankid'])) { - $modelpath = "core/modules/bank/doc/"; + $modelpath = "core/modules/bank/doc/"; - include_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; - $companybankaccount = new CompanyBankAccount($this->db); - $result = $companybankaccount->fetch($moreparams['use_companybankid']); - if (! $result) dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); - $result=$companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + include_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; + $companybankaccount = new CompanyBankAccount($this->db); + $result = $companybankaccount->fetch($moreparams['use_companybankid']); + if (! $result) dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); + $result=$companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } else { - // Positionne le modele sur le nom du modele a utiliser - if (! dol_strlen($modele)) - { - if (! empty($conf->global->COMPANY_ADDON_PDF)) - { - $modele = $conf->global->COMPANY_ADDON_PDF; - } - else - { - print $langs->trans("Error")." ".$langs->trans("Error_COMPANY_ADDON_PDF_NotDefined"); - return 0; - } - } + // Positionne le modele sur le nom du modele a utiliser + if (! dol_strlen($modele)) + { + if (! empty($conf->global->COMPANY_ADDON_PDF)) + { + $modele = $conf->global->COMPANY_ADDON_PDF; + } + else + { + print $langs->trans("Error")." ".$langs->trans("Error_COMPANY_ADDON_PDF_NotDefined"); + return 0; + } + } - $modelpath = "core/modules/societe/doc/"; + $modelpath = "core/modules/societe/doc/"; - $result=$this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + $result=$this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } return $result; @@ -3667,7 +3667,7 @@ class Societe extends CommonObject { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - // Decode type + // Decode type if ($type == 'customer') { $type_id = Categorie::TYPE_CUSTOMER; $type_text = 'customer'; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index f9e10667ccd..24789902411 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -127,15 +127,15 @@ $fieldstosearchall = array( 's.nom'=>"ThirdPartyName", 's.name_alias'=>"AliasNameShort", 's.code_client'=>"CustomerCode", - 's.code_fournisseur'=>"SupplierCode", + 's.code_fournisseur'=>"SupplierCode", 's.code_compta'=>"CustomerAccountancyCodeShort", 's.code_compta_fournisseur'=>"SupplierAccountancyCodeShort", 's.email'=>"EMail", 's.url'=>"URL", - 's.tva_intra'=>"VATIntra", - 's.siren'=>"ProfId1", - 's.siret'=>"ProfId2", - 's.ape'=>"ProfId3", + 's.tva_intra'=>"VATIntra", + 's.siren'=>"ProfId1", + 's.siret'=>"ProfId2", + 's.ape'=>"ProfId3", ); if (($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof4']='ProfId4'; if (($tmp = $langs->transnoentities("ProfId5".$mysoc->country_code)) && $tmp != "ProfId5".$mysoc->country_code && $tmp != '-') $fieldstosearchall['s.idprof5']='ProfId5'; @@ -161,35 +161,35 @@ $checkprospectlevel=(in_array($contextpage, array('prospectlist')) ? 1 : 0); $checkstcomm=(in_array($contextpage, array('prospectlist')) ? 1 : 0); $arrayfields=array( 's.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0)), - 's.nom'=>array('label'=>"ThirdPartyName", 'checked'=>1), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1), - 's.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), - 's.code_client'=>array('label'=>"CustomerCodeShort", 'checked'=>$checkedcustomercode), - 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))), - 's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'checked'=>$checkedcustomeraccountcode), - 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))), - 's.town'=>array('label'=>"Town", 'checked'=>1), - 's.zip'=>array('label'=>"Zip", 'checked'=>1), - 'state.nom'=>array('label'=>"State", 'checked'=>0), - 'region.nom'=>array('label'=>"Region", 'checked'=>0), + 's.nom'=>array('label'=>"ThirdPartyName", 'checked'=>1), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1), + 's.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), + 's.code_client'=>array('label'=>"CustomerCodeShort", 'checked'=>$checkedcustomercode), + 's.code_fournisseur'=>array('label'=>"SupplierCodeShort", 'checked'=>$checkedsuppliercode, 'enabled'=>(! empty($conf->fournisseur->enabled))), + 's.code_compta'=>array('label'=>"CustomerAccountancyCodeShort", 'checked'=>$checkedcustomeraccountcode), + 's.code_compta_fournisseur'=>array('label'=>"SupplierAccountancyCodeShort", 'checked'=>$checkedsupplieraccountcode, 'enabled'=>(! empty($conf->fournisseur->enabled))), + 's.town'=>array('label'=>"Town", 'checked'=>1), + 's.zip'=>array('label'=>"Zip", 'checked'=>1), + 'state.nom'=>array('label'=>"State", 'checked'=>0), + 'region.nom'=>array('label'=>"Region", 'checked'=>0), 'country.code_iso'=>array('label'=>"Country", 'checked'=>0), - 's.email'=>array('label'=>"Email", 'checked'=>0), - 's.url'=>array('label'=>"Url", 'checked'=>0), - 's.phone'=>array('label'=>"Phone", 'checked'=>1), - 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers), - 's.siren'=>array('label'=>"ProfId1Short", 'checked'=>$checkedprofid1), - 's.siret'=>array('label'=>"ProfId2Short", 'checked'=>$checkedprofid2), - 's.ape'=>array('label'=>"ProfId3Short", 'checked'=>$checkedprofid3), - 's.idprof4'=>array('label'=>"ProfId4Short", 'checked'=>$checkedprofid4), - 's.idprof5'=>array('label'=>"ProfId5Short", 'checked'=>$checkedprofid5), - 's.idprof6'=>array('label'=>"ProfId6Short", 'checked'=>$checkedprofid6), + 's.email'=>array('label'=>"Email", 'checked'=>0), + 's.url'=>array('label'=>"Url", 'checked'=>0), + 's.phone'=>array('label'=>"Phone", 'checked'=>1), + 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers), + 's.siren'=>array('label'=>"ProfId1Short", 'checked'=>$checkedprofid1), + 's.siret'=>array('label'=>"ProfId2Short", 'checked'=>$checkedprofid2), + 's.ape'=>array('label'=>"ProfId3Short", 'checked'=>$checkedprofid3), + 's.idprof4'=>array('label'=>"ProfId4Short", 'checked'=>$checkedprofid4), + 's.idprof5'=>array('label'=>"ProfId5Short", 'checked'=>$checkedprofid5), + 's.idprof6'=>array('label'=>"ProfId6Short", 'checked'=>$checkedprofid6), 's.tva_intra'=>array('label'=>"VATIntra", 'checked'=>0), 'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1), 's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'checked'=>$checkprospectlevel), 's.fk_stcomm'=>array('label'=>"StatusProsp", 'checked'=>$checkstcomm), - 's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), - 's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), + 's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), + 's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100), ); // Extra fields @@ -197,7 +197,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } } @@ -220,44 +220,44 @@ if (empty($reshook)) // Selection of new fields include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Did we click on purge search criteria ? - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers - { - $search_id=''; - $search_nom=''; - $search_alias=''; - $search_categ_cus=0; - $search_categ_sup=0; - $search_sale=''; - $search_barcode=""; - $search_customer_code=''; - $search_supplier_code=''; - $search_account_customer_code=''; - $search_account_supplier_code=''; - $search_town=""; - $search_zip=""; - $search_state=""; - $search_country=''; - $search_email=''; - $search_phone=''; - $search_url=''; - $search_idprof1=''; - $search_idprof2=''; - $search_idprof3=''; - $search_idprof4=''; - $search_idprof5=''; - $search_idprof6=''; - $search_vat=''; - $search_type=''; - $search_type_thirdparty=''; - $search_status=-1; - $search_stcomm=''; - $search_level_from=''; - $search_level_to=''; - $search_import_key=''; - $toselect=''; - $search_array_options=array(); - } + // Did we click on purge search criteria ? + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + $search_id=''; + $search_nom=''; + $search_alias=''; + $search_categ_cus=0; + $search_categ_sup=0; + $search_sale=''; + $search_barcode=""; + $search_customer_code=''; + $search_supplier_code=''; + $search_account_customer_code=''; + $search_account_supplier_code=''; + $search_town=""; + $search_zip=""; + $search_state=""; + $search_country=''; + $search_email=''; + $search_phone=''; + $search_url=''; + $search_idprof1=''; + $search_idprof2=''; + $search_idprof3=''; + $search_idprof4=''; + $search_idprof5=''; + $search_idprof6=''; + $search_vat=''; + $search_type=''; + $search_type_thirdparty=''; + $search_status=-1; + $search_stcomm=''; + $search_level_from=''; + $search_level_to=''; + $search_import_key=''; + $toselect=''; + $search_array_options=array(); + } // Mass actions $objectclass='Societe'; @@ -469,16 +469,16 @@ if ($search_import_key) $sql.= natural_search("s.import_key",$search_import_k // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } } // Add where from hooks @@ -501,8 +501,8 @@ $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); if (! $resql) { - dol_print_error($db); - exit; + dol_print_error($db); + exit; } $num = $db->num_rows($resql); @@ -511,10 +511,10 @@ $arrayofselected=is_array($toselect)?$toselect:array(); if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($search_all != '' || $search_cti != '') && $action != 'list') { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/societe/card.php?socid='.$id); - exit; + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/societe/card.php?socid='.$id); + exit; } $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; @@ -562,20 +562,20 @@ if ($type != '') $param.='&type='.urlencode($type); // Add $param from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } // Show delete result message if (GETPOST('delsoc')) { - setEventMessages($langs->trans("CompanyDeleted",GETPOST('delsoc')), null, 'mesgs'); + setEventMessages($langs->trans("CompanyDeleted",GETPOST('delsoc')), null, 'mesgs'); } // List of mass actions available $arrayofmassactions = array( - 'presend'=>$langs->trans("SendByMail"), + 'presend'=>$langs->trans("SendByMail"), // 'builddoc'=>$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); @@ -618,8 +618,8 @@ if ($massaction == 'presend') if ($search_all) { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall); + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall); } // Filter on categories @@ -637,14 +637,14 @@ if (empty($type) || $type == 'c' || $type == 'p') } if (empty($type) || $type == 'f') { - if (! empty($conf->categorie->enabled)) - { - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - $moreforfilter.='
        '; - $moreforfilter.=$langs->trans('SuppliersCategoriesShort').': '; - $moreforfilter.=$formother->select_categories('supplier',$search_categ_sup,'search_categ_sup',1); - $moreforfilter.='
        '; - } + if (! empty($conf->categorie->enabled)) + { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $moreforfilter.='
        '; + $moreforfilter.=$langs->trans('SuppliersCategoriesShort').': '; + $moreforfilter.=$formother->select_categories('supplier',$search_categ_sup,'search_categ_sup',1); + $moreforfilter.='
        '; + } } // If the user can view prospects other than his' @@ -661,8 +661,8 @@ if ($moreforfilter) print $moreforfilter; $parameters=array('type'=>$type); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
        '; + print $hookmanager->resPrint; + print '
        '; } $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; @@ -705,125 +705,125 @@ if (! empty($arrayfields['s.barcode']['checked'])) // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { - print ''; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { - print ''; } // Account Customer code if (! empty($arrayfields['s.code_compta']['checked'])) { - print ''; } // Account Supplier code if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { - print ''; } // Town if (! empty($arrayfields['s.town']['checked'])) { - print ''; } // Zip if (! empty($arrayfields['s.zip']['checked'])) { - print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { - print ''; } // Region if (! empty($arrayfields['region.nom']['checked'])) { - print ''; } // Country if (! empty($arrayfields['country.code_iso']['checked'])) { - print ''; } // Company type if (! empty($arrayfields['typent.code']['checked'])) { - print ''; } if (! empty($arrayfields['s.email']['checked'])) { - // Email + // Email print ''; } if (! empty($arrayfields['s.phone']['checked'])) { - // Phone + // Phone print ''; } if (! empty($arrayfields['s.url']['checked'])) { - // Url + // Url print ''; } if (! empty($arrayfields['s.siren']['checked'])) { - // IdProf1 + // IdProf1 print ''; } if (! empty($arrayfields['s.siret']['checked'])) { - // IdProf2 + // IdProf2 print ''; } if (! empty($arrayfields['s.ape']['checked'])) { - // IdProf3 + // IdProf3 print ''; } if (! empty($arrayfields['s.idprof4']['checked'])) { - // IdProf4 + // IdProf4 print ''; } if (! empty($arrayfields['s.idprof5']['checked'])) { - // IdProf5 + // IdProf5 print ''; @@ -846,20 +846,20 @@ if (! empty($arrayfields['s.tva_intra']['checked'])) // Type (customer/prospect/supplier) if (! empty($arrayfields['customerorsupplier']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) { - // Prospect level + // Prospect level print ''; + print ''; } if (! empty($arrayfields['s.fk_stcomm']['checked'])) { - // Prospect status - print ''; + print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); + print ''; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) @@ -904,12 +904,12 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab { if (! empty($arrayfields["ef.".$key]['checked'])) { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; + print ''; } // Date modification if (! empty($arrayfields['s.tms']['checked'])) { - print ''; + print ''; } // Status if (! empty($arrayfields['s.status']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['s.import_key']['checked'])) { @@ -993,16 +993,16 @@ if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_f // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $sortonfield = "ef.".$key; - if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } } // Hook fields $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); @@ -1043,186 +1043,186 @@ while ($i < min($num, $limit)) print '\n"; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['s.nom']['checked'])) { print '\n"; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['s.name_alias']['checked'])) { - print '\n"; - if (! $i) $totalarray['nbfield']++; + print '\n"; + if (! $i) $totalarray['nbfield']++; } // Barcode - if (! empty($arrayfields['s.barcode']['checked'])) + if (! empty($arrayfields['s.barcode']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } // Customer code - if (! empty($arrayfields['s.code_client']['checked'])) + if (! empty($arrayfields['s.code_client']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } - // Supplier code - if (! empty($arrayfields['s.code_fournisseur']['checked'])) + // Supplier code + if (! empty($arrayfields['s.code_fournisseur']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } // Account customer code - if (! empty($arrayfields['s.code_compta']['checked'])) + if (! empty($arrayfields['s.code_compta']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } - // Account supplier code - if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) + // Account supplier code + if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } // Town - if (! empty($arrayfields['s.town']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Zip - if (! empty($arrayfields['s.zip']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // State - if (! empty($arrayfields['state.nom']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Region - if (! empty($arrayfields['region.nom']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Country - if (! empty($arrayfields['country.code_iso']['checked'])) - { - print '\n"; + if (! $i) $totalarray['nbfield']++; + } + // Zip + if (! empty($arrayfields['s.zip']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // State + if (! empty($arrayfields['state.nom']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Region + if (! empty($arrayfields['region.nom']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! $i) $totalarray['nbfield']++; + } // Type ent - if (! empty($arrayfields['typent.code']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.email']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.phone']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.url']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.siren']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.siret']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.ape']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.idprof4']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.idprof5']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.idprof6']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.tva_intra']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Type - if (! empty($arrayfields['customerorsupplier']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.email']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.phone']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.url']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.siren']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.siret']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.ape']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.idprof4']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.idprof5']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.idprof6']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.tva_intra']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Type + if (! empty($arrayfields['customerorsupplier']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } - if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) - { + if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) + { // Prospect level print '"; - if (! $i) $totalarray['nbfield']++; - } + if (! $i) $totalarray['nbfield']++; + } - if (! empty($arrayfields['s.fk_stcomm']['checked'])) - { - // Prospect status + if (! empty($arrayfields['s.fk_stcomm']['checked'])) + { + // Prospect status print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! $i) $totalarray['nbfield']++; + } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -1249,54 +1249,54 @@ while ($i < min($num, $limit)) $tmpkey='options_'.$key; print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } } } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['s.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['s.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status - if (! empty($arrayfields['s.status']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['s.import_key']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - } + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['s.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['s.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status + if (! empty($arrayfields['s.status']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['s.import_key']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + } - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; + } + print ''; + if (! $i) $totalarray['nbfield']++; print ''."\n"; $i++; diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 7bfc5a482fe..5b5a10b598b 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -78,255 +78,255 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($cancel) - { - $action=''; - if (! empty($backtopage)) - { - header("Location: ".$backtopage); - exit; - } - } + if ($cancel) + { + $action=''; + if (! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + } - if ($action == 'update' && ! $_POST["cancel"]) - { - // Modification - if (! GETPOST('label')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); - $action='edit'; - $error++; - } - if (! GETPOST('bank')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors'); - $action='edit'; - $error++; - } - if ($account->needIBAN() == 1) - { - if (! GETPOST('iban')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors'); - $action='edit'; - $error++; - } - if (! GETPOST('bic')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BIC")), null, 'errors'); - $action='edit'; - $error++; - } - } + if ($action == 'update' && ! $_POST["cancel"]) + { + // Modification + if (! GETPOST('label')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); + $action='edit'; + $error++; + } + if (! GETPOST('bank')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors'); + $action='edit'; + $error++; + } + if ($account->needIBAN() == 1) + { + if (! GETPOST('iban')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors'); + $action='edit'; + $error++; + } + if (! GETPOST('bic')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BIC")), null, 'errors'); + $action='edit'; + $error++; + } + } - $account->fetch($id); - if (! $error) - { - $account->socid = $object->id; + $account->fetch($id); + if (! $error) + { + $account->socid = $object->id; - $account->bank = GETPOST('bank','alpha'); - $account->label = GETPOST('label','alpha'); - $account->courant = GETPOST('courant','alpha'); - $account->clos = GETPOST('clos','alpha'); - $account->code_banque = GETPOST('code_banque','alpha'); - $account->code_guichet = GETPOST('code_guichet','alpha'); - $account->number = GETPOST('number','alpha'); - $account->cle_rib = GETPOST('cle_rib','alpha'); - $account->bic = GETPOST('bic','alpha'); - $account->iban = GETPOST('iban','alpha'); - $account->domiciliation = GETPOST('domiciliation','alpha'); - $account->proprio = GETPOST('proprio','alpha'); - $account->owner_address = GETPOST('owner_address','alpha'); - $account->frstrecur = GETPOST('frstrecur','alpha'); - $account->rum = GETPOST('rum','alpha'); - if (empty($account->rum)) - { - $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); - $account->date_rum = dol_now(); - } + $account->bank = GETPOST('bank','alpha'); + $account->label = GETPOST('label','alpha'); + $account->courant = GETPOST('courant','alpha'); + $account->clos = GETPOST('clos','alpha'); + $account->code_banque = GETPOST('code_banque','alpha'); + $account->code_guichet = GETPOST('code_guichet','alpha'); + $account->number = GETPOST('number','alpha'); + $account->cle_rib = GETPOST('cle_rib','alpha'); + $account->bic = GETPOST('bic','alpha'); + $account->iban = GETPOST('iban','alpha'); + $account->domiciliation = GETPOST('domiciliation','alpha'); + $account->proprio = GETPOST('proprio','alpha'); + $account->owner_address = GETPOST('owner_address','alpha'); + $account->frstrecur = GETPOST('frstrecur','alpha'); + $account->rum = GETPOST('rum','alpha'); + if (empty($account->rum)) + { + $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); + $account->date_rum = dol_now(); + } - $result = $account->update($user); - if (! $result) - { - setEventMessages($account->error, $account->errors, 'errors'); - } - else - { - // If this account is the default bank account, we disable others - if ($account->default_rib) - { - $account->setAsDefault($id); // This will make sure there is only one default rib - } + $result = $account->update($user); + if (! $result) + { + setEventMessages($account->error, $account->errors, 'errors'); + } + else + { + // If this account is the default bank account, we disable others + if ($account->default_rib) + { + $account->setAsDefault($id); // This will make sure there is only one default rib + } - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; - header('Location: '.$url); - exit; - } - } - } + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; + header('Location: '.$url); + exit; + } + } + } - if ($action == 'add' && ! $_POST["cancel"]) - { - $error=0; + if ($action == 'add' && ! $_POST["cancel"]) + { + $error=0; - if (! GETPOST('label')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); - $action='create'; - $error++; - } - if (! GETPOST('bank')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors'); - $action='create'; - $error++; - } + if (! GETPOST('label')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); + $action='create'; + $error++; + } + if (! GETPOST('bank')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors'); + $action='create'; + $error++; + } - if (! $error) - { - // Ajout - $account = new CompanyBankAccount($db); + if (! $error) + { + // Ajout + $account = new CompanyBankAccount($db); - $account->socid = $object->id; + $account->socid = $object->id; - $account->bank = GETPOST('bank','alpha'); - $account->label = GETPOST('label','alpha'); - $account->courant = GETPOST('courant','alpha'); - $account->clos = GETPOST('clos','alpha'); - $account->code_banque = GETPOST('code_banque','alpha'); - $account->code_guichet = GETPOST('code_guichet','alpha'); - $account->number = GETPOST('number','alpha'); - $account->cle_rib = GETPOST('cle_rib','alpha'); - $account->bic = GETPOST('bic','alpha'); - $account->iban = GETPOST('iban','alpha'); - $account->domiciliation = GETPOST('domiciliation','alpha'); - $account->proprio = GETPOST('proprio','alpha'); - $account->owner_address = GETPOST('owner_address','alpha'); - $account->frstrecur = GETPOST('frstrecur'); - $account->rum = GETPOST('rum','alpha'); - $account->datec = dol_now(); + $account->bank = GETPOST('bank','alpha'); + $account->label = GETPOST('label','alpha'); + $account->courant = GETPOST('courant','alpha'); + $account->clos = GETPOST('clos','alpha'); + $account->code_banque = GETPOST('code_banque','alpha'); + $account->code_guichet = GETPOST('code_guichet','alpha'); + $account->number = GETPOST('number','alpha'); + $account->cle_rib = GETPOST('cle_rib','alpha'); + $account->bic = GETPOST('bic','alpha'); + $account->iban = GETPOST('iban','alpha'); + $account->domiciliation = GETPOST('domiciliation','alpha'); + $account->proprio = GETPOST('proprio','alpha'); + $account->owner_address = GETPOST('owner_address','alpha'); + $account->frstrecur = GETPOST('frstrecur'); + $account->rum = GETPOST('rum','alpha'); + $account->datec = dol_now(); - $db->begin(); + $db->begin(); - // This test can be done only once properties were set - if ($account->needIBAN() == 1) - { - if (! GETPOST('iban')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors'); - $action='create'; - $error++; - } - if (! GETPOST('bic')) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BIC")), null, 'errors'); - $action='create'; - $error++; - } - } + // This test can be done only once properties were set + if ($account->needIBAN() == 1) + { + if (! GETPOST('iban')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("IBAN")), null, 'errors'); + $action='create'; + $error++; + } + if (! GETPOST('bic')) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BIC")), null, 'errors'); + $action='create'; + $error++; + } + } - if (! $error) - { - $result = $account->create($user); - if ($result < 0) - { - $error++; - setEventMessages($account->error, $account->errors, 'errors'); - $action='create'; // Force chargement page création - } + if (! $error) + { + $result = $account->create($user); + if ($result < 0) + { + $error++; + setEventMessages($account->error, $account->errors, 'errors'); + $action='create'; // Force chargement page création + } - if (empty($account->rum)) - { - $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); - $account->date_rum = dol_now(); - } - } + if (empty($account->rum)) + { + $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); + $account->date_rum = dol_now(); + } + } - if (! $error) - { - $result = $account->update($user); // This will set the UMR number. - if ($result < 0) - { - $error++; - setEventMessages($account->error, $account->errors, 'errors'); - $action='create'; - } - } + if (! $error) + { + $result = $account->update($user); // This will set the UMR number. + if ($result < 0) + { + $error++; + setEventMessages($account->error, $account->errors, 'errors'); + $action='create'; + } + } - if (! $error) - { - $db->commit(); + if (! $error) + { + $db->commit(); - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; - header('Location: '.$url); - exit; - } - else - { - $db->rollback(); - } - } - } + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; + header('Location: '.$url); + exit; + } + else + { + $db->rollback(); + } + } + } - if ($action == 'setasdefault') - { - $account = new CompanyBankAccount($db); - $res = $account->setAsDefault(GETPOST('ribid','int')); - if ($res) - { - $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; - header('Location: '.$url); - exit; - } - else - { - setEventMessages($db->lasterror, null, 'errors'); - } - } + if ($action == 'setasdefault') + { + $account = new CompanyBankAccount($db); + $res = $account->setAsDefault(GETPOST('ribid','int')); + if ($res) + { + $url=DOL_URL_ROOT.'/societe/rib.php?socid='.$object->id; + header('Location: '.$url); + exit; + } + else + { + setEventMessages($db->lasterror, null, 'errors'); + } + } - if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes') - { - $account = new CompanyBankAccount($db); - if ($account->fetch($ribid?$ribid:$id)) - { - $result = $account->delete($user); - if ($result > 0) - { - $url = $_SERVER['PHP_SELF']."?socid=".$object->id; - header('Location: '.$url); - exit; - } - else - { - setEventMessages($account->error, $account->errors, 'errors'); - } - } - else - { - setEventMessages($account->error, $account->errors, 'errors'); - } - } + if ($action == 'confirm_delete' && $_GET['confirm'] == 'yes') + { + $account = new CompanyBankAccount($db); + if ($account->fetch($ribid?$ribid:$id)) + { + $result = $account->delete($user); + if ($result > 0) + { + $url = $_SERVER['PHP_SELF']."?socid=".$object->id; + header('Location: '.$url); + exit; + } + else + { + setEventMessages($account->error, $account->errors, 'errors'); + } + } + else + { + setEventMessages($account->error, $account->errors, 'errors'); + } + } - $savid=$id; + $savid=$id; - // Actions to build doc - if ($action == 'builddocrib') - { - $action = 'builddoc'; - $moreparams = array( - 'use_companybankid'=>GETPOST('companybankid'), - 'force_dir_output'=>$conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id) - ); - $_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid')); - $_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid')); - } - $id = $socid; - $upload_dir = $conf->societe->multidir_output[$object->entity]; - $permissioncreate=$user->rights->societe->creer; - include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + // Actions to build doc + if ($action == 'builddocrib') + { + $action = 'builddoc'; + $moreparams = array( + 'use_companybankid'=>GETPOST('companybankid'), + 'force_dir_output'=>$conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id) + ); + $_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid')); + $_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid')); + } + $id = $socid; + $upload_dir = $conf->societe->multidir_output[$object->entity]; + $permissioncreate=$user->rights->societe->creer; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - $id = $savid; + $id = $savid; } @@ -347,22 +347,22 @@ if (! $id) } else { - $account->fetch($id); + $account->fetch($id); } if (empty($account->socid)) $account->socid=$object->id; if ($socid && $action == 'edit' && $user->rights->societe->creer) { - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; } if ($socid && $action == 'create' && $user->rights->societe->creer) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } @@ -372,25 +372,25 @@ if ($socid && $action != 'edit' && $action != "create") dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"), -1, 'company'); // Confirm delete third party - if ($action == 'delete') - { - print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1); - } + if ($action == 'delete') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1); + } - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - print load_fiche_titre($langs->trans("DefaultRIB"), '', ''); + print load_fiche_titre($langs->trans("DefaultRIB"), '', ''); - print '
        '; - print '
        '; + print '
        '; + print '
        '; - print '
        '; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($search_syear?$search_syear:-1,'search_syear',1, 20, 5); - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_syear?$search_syear:-1,'search_syear',1, 20, 5); + print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($search_eyear?$search_eyear:-1,'search_eyear',1, 20, 5); - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_eyear?$search_eyear:-1,'search_eyear',1, 20, 5); + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - $arrayofstatus = array(); - foreach($projectstatic->statuts_short as $key => $val) $arrayofstatus[$key]=$langs->trans($val); - $arrayofstatus['99']=$langs->trans("NotClosed").' ('.$langs->trans('Draft').'+'.$langs->trans('Opened').')'; + print ''; + $arrayofstatus = array(); + foreach($projectstatic->statuts_short as $key => $val) $arrayofstatus[$key]=$langs->trans($val); + $arrayofstatus['99']=$langs->trans("NotClosed").' ('.$langs->trans('Draft').'+'.$langs->trans('Opened').')'; print $form->selectarray('search_projectstatus', $arrayofstatus, $search_projectstatus, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); - print 'getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) { - $crit=$val; + $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); $searchclass=''; if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; print ''; } - print ''; - print ''; + print ''; - print ''; + print ''; @@ -604,16 +604,16 @@ if (! empty($arrayfields['t.progress']['checked'])) print_liste_field_titre // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $sortonfield = "ef.".$key; - if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } } // Hook fields $parameters=array('arrayfields'=>$arrayfields); @@ -656,157 +656,157 @@ while ($i < min($num,$limit)) { print '
        '; - print $object->getNomUrl(1,'withproject'); - if ($object->hasDelay()) print img_warning("Late"); - print ''; - print $object->label; - print ''; + print $object->getNomUrl(1,'withproject'); + if ($object->hasDelay()) print img_warning("Late"); + print ''; + print $object->label; + print ''; - print dol_print_date($db->jdate($obj->date_start),'day'); - print ''; - print dol_print_date($db->jdate($obj->date_end),'day'); - print ''; - print $projectstatic->getNomUrl(1, 'task'); - if ($projectstatic->hasDelay()) print img_warning("Late"); - print ''; - print dol_trunc($obj->projecttitle,80); - print ''; - if ($obj->socid) - { - $socstatic->id=$obj->socid; - $socstatic->name=$obj->name; - print $socstatic->getNomUrl(1); - } - else - { - print ' '; - } - print ''; - print $projectstatic->getLibStatut(1); - print ''; + print $projectstatic->getNomUrl(1, 'task'); + if ($projectstatic->hasDelay()) print img_warning("Late"); + print ''; + print dol_trunc($obj->projecttitle,80); + print ''; + if ($obj->socid) + { + $socstatic->id=$obj->socid; + $socstatic->name=$obj->name; + print $socstatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + print $projectstatic->getLibStatut(1); + print ''; - $fullhour=convertSecondToTime($obj->planned_workload,$plannedworkloadoutputformat); - $workingdelay=convertSecondToTime($obj->planned_workload,'all',86400,7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks - if ($obj->planned_workload != '') - { - print $fullhour; - // TODO Add delay taking account of working hours per day and working day per week - //if ($workingdelay != $fullhour) print '
        ('.$workingdelay.')'; - } - //else print '--:--'; - print '
        '; + // Planned workload + if (! empty($arrayfields['t.planned_workload']['checked'])) + { + print ''; + $fullhour=convertSecondToTime($obj->planned_workload,$plannedworkloadoutputformat); + $workingdelay=convertSecondToTime($obj->planned_workload,'all',86400,7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks + if ($obj->planned_workload != '') + { + print $fullhour; + // TODO Add delay taking account of working hours per day and working day per week + //if ($workingdelay != $fullhour) print '
        ('.$workingdelay.')'; + } + //else print '--:--'; + print '
        '; if ($showlineingray) print ''; else print ''; if ($obj->duration_effective) print convertSecondToTime($obj->duration_effective,$timespentoutputformat); else print '--:--'; if ($showlineingray) print ''; else print ''; - print ''; - if ($obj->planned_workload || $obj->duration_effective) + if ($obj->planned_workload || $obj->duration_effective) { if ($obj->planned_workload) print round(100 * $obj->duration_effective / $obj->planned_workload,2).' %'; else print $form->textwithpicto('',$langs->trans('WorkloadNotDefined'), 1, 'help'); } - print ''; - if ($obj->progress != '') + if ($obj->progress != '') { print $obj->progress.' %'; } - print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''.$projectstatic->getLibStatut(5).''; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->id, $arrayofselected)) $selected=1; - print ''; - } - print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->id, $arrayofselected)) $selected=1; + print ''; + } + print '
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.convertSecondToTime($totalarray['totalplannedworkload'],$plannedworkloadoutputformat).''.convertSecondToTime($totalarray['totaldurationeffective'],$timespentoutputformat).''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationeffective'] / $totalarray['totalplannedworkload'], 2).' %' : '').'
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.convertSecondToTime($totalarray['totalplannedworkload'],$plannedworkloadoutputformat).''.convertSecondToTime($totalarray['totaldurationeffective'],$timespentoutputformat).''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationeffective'] / $totalarray['totalplannedworkload'], 2).' %' : '').'

        '.$text.'

        '.$text.'

        '.$langs->trans("WelcomeOnPaymentPage").'
        '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'


        '.$langs->trans("WelcomeOnPaymentPage").'
        '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'

        '.$langs->trans("Creditor"); - print ''.$creditor.''; - print ''; - print '
        '.$creditor.''; + print ''; + print '
        '; if (empty($amount) || ! is_numeric($amount)) { - print ''; - print ''; + print ''; + print ''; } else { print ''.price($amount).''; - print ''; + print ''; print ''; } // Currency @@ -658,8 +658,8 @@ if (! $source) print ''; print '
        '.$langs->trans("Creditor"); - print ''.$creditor.''; - print ''; - print '
        '.$creditor.''; + print ''; + print '
        '; if (empty($amount) || ! is_numeric($amount)) { - print ''; - print ''; + print ''; + print ''; } else { print ''.price($amount).''; - print ''; + print ''; print ''; } // Currency @@ -749,32 +749,32 @@ if ($source == 'order') // Shipping address $shipToName=$order->thirdparty->name; - $shipToStreet=$order->thirdparty->address; - $shipToCity=$order->thirdparty->town; - $shipToState=$order->thirdparty->state_code; - $shipToCountryCode=$order->thirdparty->country_code; - $shipToZip=$order->thirdparty->zip; - $shipToStreet2=''; - $phoneNum=$order->thirdparty->phone; - if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - else - { - print ''."\n"; - } - print ''."\n"; - $labeldesc=$langs->trans("Order").' '.$order->ref; - if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); - print ''."\n"; + $shipToStreet=$order->thirdparty->address; + $shipToCity=$order->thirdparty->town; + $shipToState=$order->thirdparty->state_code; + $shipToCountryCode=$order->thirdparty->country_code; + $shipToZip=$order->thirdparty->zip; + $shipToStreet2=''; + $phoneNum=$order->thirdparty->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + else + { + print ''."\n"; + } + print ''."\n"; + $labeldesc=$langs->trans("Order").' '.$order->ref; + if (GETPOST('desc','alpha')) $labeldesc=GETPOST('desc','alpha'); + print ''."\n"; } @@ -800,12 +800,12 @@ if ($source == 'invoice') $object = $invoice; } - if ($action != 'dopayment') // Do not change amount if we just click on first dopayment - { - $amount=price2num($invoice->total_ttc - $invoice->getSommePaiement()); - if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); - $amount=price2num($amount); - } + if ($action != 'dopayment') // Do not change amount if we just click on first dopayment + { + $amount=price2num($invoice->total_ttc - $invoice->getSommePaiement()); + if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); + $amount=price2num($amount); + } $fulltag='INV='.$invoice->ref.'.CUS='.$invoice->thirdparty->id; //$fulltag.='.NAM='.strtr($invoice->thirdparty->name,"-"," "); @@ -815,9 +815,9 @@ if ($source == 'invoice') // Creditor print '
        '.$langs->trans("Creditor"); - print ''.$creditor.''; - print ''; - print '
        '.$creditor.''; + print ''; + print '
        '; if (empty($amount) || ! is_numeric($amount)) { - print ''; - print ''; + print ''; + print ''; } else { print ''.price($amount).''; - print ''; + print ''; print ''; } // Currency @@ -870,34 +870,34 @@ if ($source == 'invoice') print '
        '.$langs->trans("Creditor"); print ''.$creditor.''; - print ''; + print ''; print '
        '; if (empty($amount) || ! is_numeric($amount)) { - print ''; - print ''; + print ''; + print ''; } else { print ''.price($amount).''; - print ''; + print ''; print ''; } // Currency @@ -1075,34 +1075,34 @@ if ($source == 'contractline') print ''; print '
        '.$langs->trans("Creditor"); - print ''.$creditor.''; - print ''; - print '
        '.$creditor.''; + print ''; + print '
        '; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print $form->select_country($search_country,'search_country','',0,'maxwidth100'); print ''; + print ''; print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; - if ($type != '') print ''; - print ''; + if ($type != '') print ''; + print ''; $options_from = ''; // Generate in $options_from the list of each option sorted foreach ($tab_level as $tab_level_sortorder => $tab_level_label) @@ -877,25 +877,25 @@ if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) $options_to .= ''; } - // Print these two select + // Print these two select print $langs->trans("From").' '; print ' '; print $langs->trans("to").' '; - print ''; - $arraystcomm=array(); + // Prospect status + print ''; + $arraystcomm=array(); foreach($prospectstatic->cacheprospectstatus as $key => $val) { - $arraystcomm[$val['id']]=($langs->trans("StatusProspect".$val['id']) != "StatusProspect".$val['id'] ? $langs->trans("StatusProspect".$val['id']) : $val['label']); + $arraystcomm[$val['id']]=($langs->trans("StatusProspect".$val['id']) != "StatusProspect".$val['id'] ? $langs->trans("StatusProspect".$val['id']) : $val['label']); } - print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); - print ''; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) { - $crit=$val; + $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); $searchclass=''; if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; @@ -932,21 +932,21 @@ print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['s.datec']['checked'])) { - print ''; - print ''; + print ''; - print ''; + print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $search_status, 1); - print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $search_status, 1); + print ''; print $obj->rowid; print "'; print $companystatic->getNomUrl(1,'',100); print "'; - print $companystatic->name_alias; - print "'; + print $companystatic->name_alias; + print "'.$obj->barcode.''.$obj->code_client.''.$obj->code_fournisseur.''.$obj->code_compta.''.$obj->code_compta_fournisseur.'".$obj->town."".$obj->zip."".$obj->state_name."".$obj->region_name."'; + if (! empty($arrayfields['s.town']['checked'])) + { + print "".$obj->town."".$obj->zip."".$obj->state_name."".$obj->region_name."'; $tmparray=getCountry($obj->fk_pays,'all'); print $tmparray['label']; print ''; + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); print $typenArray[$obj->typent_code]; print '".$obj->email."".$obj->phone."".$obj->url."".$obj->idprof1."".$obj->idprof2."".$obj->idprof3."".$obj->idprof4."".$obj->idprof5."".$obj->idprof6."".$obj->tva_intra."'; - $s=''; - if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $companystatic->name=$langs->trans("Customer"); - $companystatic->name_alias=''; - $s.=$companystatic->getNomUrl(0,'customer'); - } - if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - if ($s) $s.=" / "; - $companystatic->name=$langs->trans("Prospect"); - $companystatic->name_alias=''; - $s.=$companystatic->getNomUrl(0,'prospect'); - } - if (! empty($conf->fournisseur->enabled) && $obj->fournisseur) - { - if ($s) $s.=" / "; - $companystatic->name=$langs->trans("Supplier"); - $companystatic->name_alias=''; - $s.=$companystatic->getNomUrl(0,'supplier'); - } - print $s; - print '".$obj->email."".$obj->phone."".$obj->url."".$obj->idprof1."".$obj->idprof2."".$obj->idprof3."".$obj->idprof4."".$obj->idprof5."".$obj->idprof6."".$obj->tva_intra."'; + $s=''; + if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $companystatic->name=$langs->trans("Customer"); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'customer'); + } + if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + if ($s) $s.=" / "; + $companystatic->name=$langs->trans("Prospect"); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'prospect'); + } + if (! empty($conf->fournisseur->enabled) && $obj->fournisseur) + { + if ($s) $s.=" / "; + $companystatic->name=$langs->trans("Supplier"); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'supplier'); + } + print $s; + print ''; print $companystatic->getLibProspLevel(); print "
        '; print '
        '.$companystatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); print '
        -
        '; @@ -1233,8 +1233,8 @@ while ($i < min($num, $limit)) if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt,$val['code']).''; } print '
        '; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''.$companystatic->getLibStatut(3).''; - print $obj->import_key; - print "'; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''.$companystatic->getLibStatut(3).''; + print $obj->import_key; + print "'; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; + // Action column + print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; if (in_array($obj->rowid, $arrayofselected)) $selected=1; print ''; - } - print '
        '; + print '
        '; - print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -405,11 +405,11 @@ if ($socid && $action != 'edit' && $action != "create") } elseif ($val == 'BankAccountNumber') { $content = $account->number; if (! empty($account->label) && $account->number) { - if (! checkBanForAccount($account)) { - $content.= ' '.img_picto($langs->trans("ValueIsNotValid"),'warning'); - } else { - $content.= ' '.img_picto($langs->trans("ValueIsValid"),'info'); - } + if (! checkBanForAccount($account)) { + $content.= ' '.img_picto($langs->trans("ValueIsNotValid"),'warning'); + } else { + $content.= ' '.img_picto($langs->trans("ValueIsValid"),'info'); + } } } elseif ($val == 'BankAccountNumberKey') { $content = $account->cle_rib; @@ -451,78 +451,78 @@ if ($socid && $action != 'edit' && $action != "create") print "\n"; print '
        '.$langs->trans("LabelRIB").''.$account->label.'
        '.$langs->trans("LabelRIB").''.$account->label.'
        '.$langs->trans("BankName").''.$account->bank.'
        '; - print '
        '; + print '
        '; print '
        '; - /* + /* * List of bank accounts */ - print load_fiche_titre($langs->trans("AllRIB"), '', ''); + print load_fiche_titre($langs->trans("AllRIB"), '', ''); - $rib_list = $object->get_all_rib(); - $var = false; - if (is_array($rib_list)) - { + $rib_list = $object->get_all_rib(); + $var = false; + if (is_array($rib_list)) + { print '
        '; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print ''; + print '
        '; - print ''; - print_liste_field_titre("LabelRIB"); - print_liste_field_titre("Bank"); - print_liste_field_titre("RIB"); - print_liste_field_titre("IBAN"); - print_liste_field_titre("BIC"); - if (! empty($conf->prelevement->enabled)) - { + print ''; + print_liste_field_titre("LabelRIB"); + print_liste_field_titre("Bank"); + print_liste_field_titre("RIB"); + print_liste_field_titre("IBAN"); + print_liste_field_titre("BIC"); + if (! empty($conf->prelevement->enabled)) + { print print_liste_field_titre("RUM"); print print_liste_field_titre("WithdrawMode"); - } - print_liste_field_titre("DefaultRIB", '', '', '', '', 'align="center"'); - print_liste_field_titre('', '', '', '', '', 'align="center"'); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + } + print_liste_field_titre("DefaultRIB", '', '', '', '', 'align="center"'); + print_liste_field_titre('', '', '', '', '', 'align="center"'); + print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - foreach ($rib_list as $rib) - { - print ''; - // Label - print ''; - // Bank name - print ''; - // Account number - print ''; + // Label + print ''; + // Bank name + print ''; + // Account number + print ''; - // IBAN - print ''; + // IBAN + print ''; - // BIC - print ''; + // BIC + print '
        '.$rib->label.''.$rib->bank.''; - $string=''; - foreach ($rib->getFieldsToShow() as $val) { + foreach ($rib_list as $rib) + { + print '
        '.$rib->label.''.$rib->bank.''; + $string=''; + foreach ($rib->getFieldsToShow() as $val) { - if ($val == 'BankCode') { - $string .= $rib->code_banque.' '; - } elseif ($val == 'BankAccountNumber') { - $string .= $rib->number.' '; - } elseif ($val == 'DeskCode') { - $string .= $rib->code_guichet.' '; - } elseif ($val == 'BankAccountNumberKey') { - $string .= $rib->cle_rib.' '; - /* Already output after + if ($val == 'BankCode') { + $string .= $rib->code_banque.' '; + } elseif ($val == 'BankAccountNumber') { + $string .= $rib->number.' '; + } elseif ($val == 'DeskCode') { + $string .= $rib->code_guichet.' '; + } elseif ($val == 'BankAccountNumberKey') { + $string .= $rib->cle_rib.' '; + /* Already output after }elseif ($val == 'BIC') { $string .= $rib->bic.' '; }elseif ($val == 'IBAN') { $string .= $rib->iban.' ';*/ - } - } - if (! empty($rib->label) && $rib->number) { - if (! checkBanForAccount($rib)) { - $string.= ' '.img_picto($langs->trans("ValueIsNotValid"),'warning'); - } else { - $string.= ' '.img_picto($langs->trans("ValueIsValid"),'info'); - } + } + } + if (! empty($rib->label) && $rib->number) { + if (! checkBanForAccount($rib)) { + $string.= ' '.img_picto($langs->trans("ValueIsNotValid"),'warning'); + } else { + $string.= ' '.img_picto($langs->trans("ValueIsValid"),'info'); + } } - print $string; - print ''.$rib->iban; + print $string; + print ''.$rib->iban; if (! empty($rib->iban)) { if (! checkIbanForAccount($rib)) { print ' '.img_picto($langs->trans("IbanNotValid"),'warning'); @@ -530,9 +530,9 @@ if ($socid && $action != 'edit' && $action != "create") print ' '.img_picto($langs->trans("IbanValid"),'info'); } } - print ''.$rib->bic; + print ''.$rib->bic; if (! empty($rib->bic)) { if (! checkSwiftForAccount($rib)) { print ' '.img_picto($langs->trans("SwiftNotValid"),'warning'); @@ -723,20 +723,20 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - print '
        '; + print '
        '; - print '
        '; + print '
        '; print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; // Show fields of bank account foreach ($account->getFieldsToShow(1) as $val) { @@ -775,51 +775,51 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) print ''; } - print '"; + print '"; - print ''; - print ''; - print "\n"; + print ''; + print ''; + print "\n"; - print '"; + print '"; - print '
        '.$langs->trans("LabelRIB").'
        '.$langs->trans("LabelRIB").'
        '.$langs->trans("BankName").'
        '.$langs->trans("BankName").'
        '.$langs->trans("BankAccountDomiciliation").''; - print '
        '.$langs->trans("BankAccountDomiciliation").''; + print '
        '.$langs->trans("BankAccountOwner").'
        '.$langs->trans("BankAccountOwner").'
        '.$langs->trans("BankAccountOwnerAddress").''; - print '
        '.$langs->trans("BankAccountOwnerAddress").''; + print '
        '; + print '
        '; - if ($conf->prelevement->enabled) - { + if ($conf->prelevement->enabled) + { print '
        '; - print ''; + print '
        '; - if (empty($account->rum)) $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); + if (empty($account->rum)) $account->rum = $prelevement->buildRumNumber($object->code_client, $account->datec, $account->id); - // RUM - print ''; - print ''; + // RUM + print ''; + print ''; - print ''; + print ''; - print '
        '.$langs->trans("RUM").'
        '.$langs->trans("RUM").'
        '.$langs->trans("WithdrawMode").''; - $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); - print $form->selectarray("frstrecur", $tblArraychoice, dol_escape_htmltag(GETPOST('frstrecur')?GETPOST('frstrecur'):$account->frstrecur), 0); - print '
        '.$langs->trans("WithdrawMode").''; + $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); + print $form->selectarray("frstrecur", $tblArraychoice, dol_escape_htmltag(GETPOST('frstrecur')?GETPOST('frstrecur'):$account->frstrecur), 0); + print '
        '; - } + print ''; + } - print '
        '; + print '
        '; - dol_fiche_end(); + dol_fiche_end(); print '
        '; print ''; - print '     '; + print '     '; print ''; - print '
        '; + print '
        '; } @@ -828,95 +828,95 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - print '
        '; + print '
        '; - print '
        '; + print '
        '; print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - // Show fields of bank account - foreach ($account->getFieldsToShow(1) as $val) { + // Show fields of bank account + foreach ($account->getFieldsToShow(1) as $val) { - $require=false; - if ($val == 'BankCode') { - $name = 'code_banque'; - $size = 8; - } elseif ($val == 'DeskCode') { - $name = 'code_guichet'; - $size = 8; - } elseif ($val == 'BankAccountNumber') { - $name = 'number'; - $size = 18; - } elseif ($val == 'BankAccountNumberKey') { - $name = 'cle_rib'; - $size = 3; - } elseif ($val == 'IBAN') { - $name = 'iban'; - $size = 30; - if ($account->needIBAN()) $require=true; - } elseif ($val == 'BIC') { - $name = 'bic'; - $size = 12; - if ($account->needIBAN()) $require=true; - } + $require=false; + if ($val == 'BankCode') { + $name = 'code_banque'; + $size = 8; + } elseif ($val == 'DeskCode') { + $name = 'code_guichet'; + $size = 8; + } elseif ($val == 'BankAccountNumber') { + $name = 'number'; + $size = 18; + } elseif ($val == 'BankAccountNumberKey') { + $name = 'cle_rib'; + $size = 3; + } elseif ($val == 'IBAN') { + $name = 'iban'; + $size = 30; + if ($account->needIBAN()) $require=true; + } elseif ($val == 'BIC') { + $name = 'bic'; + $size = 12; + if ($account->needIBAN()) $require=true; + } - print ''.$langs->trans($val).''; - print ''; - print ''; - } + print ''.$langs->trans($val).''; + print ''; + print ''; + } - print '"; + print '"; - print ''; - print ''; - print "\n"; + print ''; + print ''; + print "\n"; - print '"; + print '"; - print '
        '.$langs->trans("LabelRIB").'
        '.$langs->trans("LabelRIB").'
        '.$langs->trans("Bank").'
        '.$langs->trans("Bank").'
        '.$langs->trans("BankAccountDomiciliation").''; - print '
        '.$langs->trans("BankAccountDomiciliation").''; + print '
        '.$langs->trans("BankAccountOwner").'
        '.$langs->trans("BankAccountOwner").'
        '.$langs->trans("BankAccountOwnerAddress").''; - print '
        '.$langs->trans("BankAccountOwnerAddress").''; + print '
        '; + print ''; - if ($conf->prelevement->enabled) - { - print '
        '; + if ($conf->prelevement->enabled) + { + print '
        '; - print ''; + print '
        '; - // RUM - print ''; - print ''; + // RUM + print ''; + print ''; - print ''; + print ''; - print '
        '.$langs->trans("RUM").'
        '.$langs->trans("RUMWillBeGenerated").'
        '.$langs->trans("RUM").'
        '.$langs->trans("RUMWillBeGenerated").'
        '.$langs->trans("WithdrawMode").''; - $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); - print $form->selectarray("frstrecur", $tblArraychoice, (isset($_POST['frstrecur'])?GETPOST('frstrecur'):'FRST'), 0); - print '
        '.$langs->trans("WithdrawMode").''; + $tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR")); + print $form->selectarray("frstrecur", $tblArraychoice, (isset($_POST['frstrecur'])?GETPOST('frstrecur'):'FRST'), 0); + print '
        '; - } + print ''; + } - print '
        '; + print '
        '; dol_fiche_end(); print '
        '; print ''; - print '     '; + print '     '; print ''; - print '
        '; + print '
        '; } if ($socid && $action == 'edit' && $user->rights->societe->creer) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 9b345827a8e..85798a8a80f 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -126,39 +126,39 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'p.ref'=>'Ref', - 's.nom'=>'Supplier', - 'pd.description'=>'Description', - 'p.note_public'=>'NotePublic', + 'p.ref'=>'Ref', + 's.nom'=>'Supplier', + 'pd.description'=>'Description', + 'p.note_public'=>'NotePublic', ); if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate"; $checkedtypetiers=0; $arrayfields=array( - 'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1), - 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), - 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), - 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), - 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), - 'sp.date_valid'=>array('label'=>$langs->trans("Date"), 'checked'=>1), - 'sp.date_livraison'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1), - 'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), - 'sp.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), - 'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), - 'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10), - 'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'sp.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1), + 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), + 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), + 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), + 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), + 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers), + 'sp.date_valid'=>array('label'=>$langs->trans("Date"), 'checked'=>1), + 'sp.date_livraison'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1), + 'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), + 'sp.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), + 'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), + 'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10), + 'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'sp.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } } @@ -180,38 +180,38 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Do we click on purge search criteria ? if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { - $search_categ=''; - $search_user=''; - $search_sale=''; - $search_ref=''; - $search_societe=''; - $search_montant_ht=''; - $search_montant_vat=''; - $search_montant_ttc=''; - $search_login=''; - $search_product_category=''; - $search_town=''; - $search_zip=""; - $search_state=""; - $search_type=''; - $search_country=''; - $search_type_thirdparty=''; - $search_author=''; - $yearvalid=''; - $monthvalid=''; - $year=''; - $month=''; - $search_status=''; - $object_statut=''; + $search_categ=''; + $search_user=''; + $search_sale=''; + $search_ref=''; + $search_societe=''; + $search_montant_ht=''; + $search_montant_vat=''; + $search_montant_ttc=''; + $search_login=''; + $search_product_category=''; + $search_town=''; + $search_zip=""; + $search_state=""; + $search_type=''; + $search_country=''; + $search_type_thirdparty=''; + $search_author=''; + $yearvalid=''; + $monthvalid=''; + $year=''; + $month=''; + $search_status=''; + $object_statut=''; } if (empty($reshook)) { - $objectclass='SupplierProposal'; - $objectlabel='SupplierProposals'; - $permtoread = $user->rights->supplier_proposal->lire; - $permtodelete = $user->rights->supplier_proposal->supprimer; - $uploaddir = $conf->supplier_proposal->dir_output; + $objectclass='SupplierProposal'; + $objectlabel='SupplierProposals'; + $permtoread = $user->rights->supplier_proposal->lire; + $permtodelete = $user->rights->supplier_proposal->supprimer; + $uploaddir = $conf->supplier_proposal->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -263,8 +263,8 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = sp.fk_projet"; if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_user > 0) { - $sql.=", ".MAIN_DB_PREFIX."element_contact as c"; - $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; + $sql.=", ".MAIN_DB_PREFIX."element_contact as c"; + $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } $sql.= ' WHERE sp.fk_soc = s.rowid'; $sql.= ' AND sp.entity IN ('.getEntity('supplier_proposal').')'; @@ -288,12 +288,12 @@ if ($socid) $sql.= ' AND s.rowid = '.$socid; if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$db->escape($search_status).')'; if ($month > 0) { - if ($year > 0 && empty($day)) - $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; - else - $sql.= " AND date_format(sp.date_livraison, '%m') = '".$month."'"; + if ($year > 0 && empty($day)) + $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND sp.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(sp.date_livraison, '%m') = '".$month."'"; } else if ($year > 0) { @@ -301,12 +301,12 @@ else if ($year > 0) } if ($monthvalid > 0) { - if ($yearvalid > 0 && empty($dayvalid)) - $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_get_first_day($yearvalid,$monthvalid,false))."' AND '".$db->idate(dol_get_last_day($yearvalid,$monthvalid,false))."'"; - else if ($yearvalid > 0 && ! empty($dayvalid)) - $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $monthvalid, $dayvalid, $yearvalid))."' AND '".$db->idate(dol_mktime(23, 59, 59, $monthvalid, $dayvalid, $yearvalid))."'"; - else - $sql.= " AND date_format(sp.date_valid, '%m') = '".$monthvalid."'"; + if ($yearvalid > 0 && empty($dayvalid)) + $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_get_first_day($yearvalid,$monthvalid,false))."' AND '".$db->idate(dol_get_last_day($yearvalid,$monthvalid,false))."'"; + else if ($yearvalid > 0 && ! empty($dayvalid)) + $sql.= " AND sp.date_valid BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $monthvalid, $dayvalid, $yearvalid))."' AND '".$db->idate(dol_mktime(23, 59, 59, $monthvalid, $dayvalid, $yearvalid))."'"; + else + $sql.= " AND date_format(sp.date_valid, '%m') = '".$monthvalid."'"; } else if ($yearvalid > 0) { @@ -315,21 +315,21 @@ else if ($yearvalid > 0) if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) { - $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='supplier_proposal' AND tc.source='internal' AND c.element_id = sp.rowid AND c.fk_socpeople = ".$search_user; + $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='supplier_proposal' AND tc.source='internal' AND c.element_id = sp.rowid AND c.fk_socpeople = ".$search_user; } // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } } // Add where from hooks $parameters=array(); @@ -357,13 +357,13 @@ if ($resql) if ($socid > 0) { - $soc = new Societe($db); - $soc->fetch($socid); - $title = $langs->trans('ListOfSupplierProposals') . ' - '.$soc->name; + $soc = new Societe($db); + $soc->fetch($socid); + $title = $langs->trans('ListOfSupplierProposals') . ' - '.$soc->name; } else { - $title = $langs->trans('ListOfSupplierProposals'); + $title = $langs->trans('ListOfSupplierProposals'); } $num = $db->num_rows($resql); @@ -371,13 +371,13 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sall) $param.='&sall='.$sall; if ($month) $param.='&month='.$month; if ($year) $param.='&year='.$year; - if ($search_ref) $param.='&search_ref=' .$search_ref; - if ($search_societe) $param.='&search_societe=' .$search_societe; + if ($search_ref) $param.='&search_ref=' .$search_ref; + if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; @@ -390,15 +390,15 @@ if ($resql) // Add $param from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - 'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>$langs->trans("SendByMail"), + 'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->supplier_proposal->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); @@ -428,8 +428,8 @@ if ($resql) if ($sall) { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } $i = 0; @@ -448,20 +448,20 @@ if ($resql) // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { - $moreforfilter.='
        '; - $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; - $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - $moreforfilter.='
        '; + $moreforfilter.='
        '; + $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + $moreforfilter.='
        '; } // If the user can view products if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) { - include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter.='
        '; - $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); - $moreforfilter.='
        '; + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter.='
        '; + $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter.='
        '; } $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook @@ -469,18 +469,18 @@ if ($resql) else $moreforfilter = $hookmanager->resPrint; if (! empty($moreforfilter)) - { - print '
        '; - print $moreforfilter; - print '
        '; - } + { + print '
        '; + print $moreforfilter; + print '
        '; + } - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - print '
        '; - print ''."\n"; + print '
        '; + print '
        '."\n"; print ''; if (! empty($arrayfields['sp.ref']['checked'])) @@ -498,26 +498,26 @@ if ($resql) if (! empty($arrayfields['s.town']['checked'])) print ''; if (! empty($arrayfields['s.zip']['checked'])) print ''; // State - if (! empty($arrayfields['state.nom']['checked'])) - { - print ''; - } - // Country - if (! empty($arrayfields['country.code_iso']['checked'])) - { - print ''; - } + if (! empty($arrayfields['state.nom']['checked'])) + { + print ''; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + } // Company type - if (! empty($arrayfields['typent.code']['checked'])) - { - print ''; - } + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + } // Date if (! empty($arrayfields['sp.date_valid']['checked'])) { @@ -543,54 +543,54 @@ if ($resql) if (! empty($arrayfields['sp.total_ht']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['sp.total_vat']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['sp.total_ttc']['checked'])) { - // Amount - print ''; + // Amount + print ''; } if (! empty($arrayfields['u.login']['checked'])) { - // Author - print ''; + // Author + print ''; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } } // Fields from hook $parameters=array('arrayfields'=>$arrayfields); @@ -599,14 +599,14 @@ if ($resql) // Date creation if (! empty($arrayfields['sp.datec']['checked'])) { - print ''; + print ''; } // Date modification if (! empty($arrayfields['sp.tms']['checked'])) { - print ''; + print ''; } // Status if (! empty($arrayfields['sp.fk_statut']['checked'])) @@ -643,19 +643,19 @@ if ($resql) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) - { + if (! empty($arrayfields["ef.".$key]['checked'])) + { $align=$extrafields->getAlignFlag($key); - $sortonfield = "ef.".$key; - if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; - print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } } } // Hook fields $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (! empty($arrayfields['sp.datec']['checked'])) print_liste_field_titre($arrayfields['sp.datec']['label'],$_SERVER["PHP_SELF"],"sp.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['sp.tms']['checked'])) print_liste_field_titre($arrayfields['sp.tms']['label'],$_SERVER["PHP_SELF"],"sp.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['sp.fk_statut']['checked'])) print_liste_field_titre($arrayfields['sp.fk_statut']['label'],$_SERVER["PHP_SELF"],"sp.fk_statut","",$param,'align="right"',$sortfield,$sortorder); @@ -724,164 +724,164 @@ if ($resql) // Thirdparty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; } // Town - if (! empty($arrayfields['s.town']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Zip - if (! empty($arrayfields['s.zip']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // State - if (! empty($arrayfields['state.nom']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Country - if (! empty($arrayfields['country.code_iso']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Type ent - if (! empty($arrayfields['typent.code']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } + if (! empty($arrayfields['s.town']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Zip + if (! empty($arrayfields['s.zip']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // State + if (! empty($arrayfields['state.nom']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Type ent + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Date proposal - if (! empty($arrayfields['sp.date_valid']['checked'])) - { - print '\n"; if (! $i) $totalarray['nbfield']++; - } + } // Date delivery - if (! empty($arrayfields['sp.date_livraison']['checked'])) - { - print '\n"; if (! $i) $totalarray['nbfield']++; - } + } - // Amount HT - if (! empty($arrayfields['sp.total_ht']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; - $totalarray['totalht'] += $obj->total_ht; - } - // Amount VAT - if (! empty($arrayfields['sp.total_vat']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; - $totalarray['totalvat'] += $obj->total_vat; - } - // Amount TTC - if (! empty($arrayfields['sp.total_ttc']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; - $totalarray['totalttc'] += $obj->total_ttc; - } + // Amount HT + if (! empty($arrayfields['sp.total_ht']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; + $totalarray['totalht'] += $obj->total_ht; + } + // Amount VAT + if (! empty($arrayfields['sp.total_vat']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; + $totalarray['totalvat'] += $obj->total_vat; + } + // Amount TTC + if (! empty($arrayfields['sp.total_ttc']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; + $totalarray['totalttc'] += $obj->total_ttc; + } $userstatic->id=$obj->fk_user_author; $userstatic->login=$obj->login; - // Author - if (! empty($arrayfields['u.login']['checked'])) - { + // Author + if (! empty($arrayfields['u.login']['checked'])) + { print '\n"; - if (! $i) $totalarray['nbfield']++; - } + if (! $i) $totalarray['nbfield']++; + } - // Extra fields - if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - print 'getAlignFlag($key); - if ($align) print ' align="'.$align.'"'; - print '>'; - $tmpkey='options_'.$key; - print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); - print ''; - if (! $i) $totalarray['nbfield']++; - } - } - } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['sp.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['sp.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status - if (! empty($arrayfields['sp.fk_statut']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['sp.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['sp.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status + if (! empty($arrayfields['sp.fk_statut']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + } - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; print "\n"; @@ -893,28 +893,28 @@ if ($resql) // Show total line if (isset($totalarray['totalhtfield']) - || isset($totalarray['totalvatfield']) - || isset($totalarray['totalttcfield']) - || isset($totalarray['totalamfield']) - || isset($totalarray['totalrtpfield']) - ) + || isset($totalarray['totalvatfield']) + || isset($totalarray['totalttcfield']) + || isset($totalarray['totalamfield']) + || isset($totalarray['totalrtpfield']) + ) { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; - else print ''; - } - print ''; + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if ($i == 1) + { + if ($num < $limit && empty($offset)) print ''; + else print ''; + } + elseif ($totalarray['totalhtfield'] == $i) print ''; + elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totalttcfield'] == $i) print ''; + else print ''; + } + print ''; } $db->free($resql); @@ -924,28 +924,28 @@ if ($resql) print $hookmanager->resPrint; print '
        '; - print ''; - print ''; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); - print ''; + print ''; + print ''; + print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $searchclass=''; - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; - print ''; - } - print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; - print ''; + print ''; - print ''; + print ''; + print ''; print $companystatic->getNomUrl(1,'customer'); print ''; - print $obj->town; - print ''; - print $obj->zip; - print '".$obj->state_name."'; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''; + print $obj->town; + print ''; + print $obj->zip; + print '".$obj->state_name."'; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; + print ''; + if (! empty($arrayfields['sp.date_valid']['checked'])) + { + print ''; print dol_print_date($db->jdate($obj->date_valid), 'day'); print "'; + if (! empty($arrayfields['sp.date_livraison']['checked'])) + { + print ''; print dol_print_date($db->jdate($obj->dp), 'day'); print "'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_ttc)."'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_ttc)."'; if ($userstatic->id) print $userstatic->getLoginUrl(1); else print ' '; print "'; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''.$objectstatic->LibStatut($obj->fk_statut,5)."'; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''.$objectstatic->LibStatut($obj->fk_statut,5)."'; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->rowid, $arrayofselected)) $selected=1; - print ''; - } - print ''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
        '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
        '."\n"; - print '
        '."\n"; + print '
        '."\n"; print ''."\n"; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { - /* + /* * Show list of available documents */ - $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&','&',$param); - $filedir=$diroutputmassaction; + $filedir=$diroutputmassaction; - $genallowed=$user->rights->supplier_proposal->lire; - $delallowed=$user->rights->supplier_proposal->lire; + $genallowed=$user->rights->supplier_proposal->lire; + $delallowed=$user->rights->supplier_proposal->lire; - print $formfile->showdocuments('massfilesarea_supplier_proposal','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'',''); + print $formfile->showdocuments('massfilesarea_supplier_proposal','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'',''); } else { - print '
        '.$langs->trans("ShowTempMassFilesArea").''; + print '
        '.$langs->trans("ShowTempMassFilesArea").''; } } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 15571755944..981704de6ae 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -72,37 +72,37 @@ $form = new Form($db); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'u.login'=>"Login", - 'u.lastname'=>"Lastname", - 'u.firstname'=>"Firstname", + 'u.lastname'=>"Lastname", + 'u.firstname'=>"Firstname", 'u.accountancy_code'=>"AccountancyCode", 'u.email'=>"EMail", - 'u.note'=>"Note" + 'u.note'=>"Note" ); // Definition of fields for list $arrayfields=array( - 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), - 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), - 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'u.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0), - 'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>($mode=='employee'?1:0)), - 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0), - 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), - 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), - 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), - 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), - 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), - 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110), - 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), + 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), + 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'u.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0), + 'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>($mode=='employee'?1:0)), + 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0), + 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), + 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), + 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), + 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), + 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110), + 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } } @@ -141,29 +141,29 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers - { - $search_user=""; - $search_login=""; - $search_lastname=""; - $search_firstname=""; - $search_gender=""; - $search_employee=""; - $search_accountancy_code=""; - $search_email=""; - $search_statut=""; - $search_thirdparty=""; - $search_supervisor=""; - $search_datelastlogin=""; - $search_datepreviouslogin=""; - $search_date_creation=""; - $search_date_update=""; - $search_array_options=array(); - } + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + $search_user=""; + $search_login=""; + $search_lastname=""; + $search_firstname=""; + $search_gender=""; + $search_employee=""; + $search_accountancy_code=""; + $search_email=""; + $search_statut=""; + $search_thirdparty=""; + $search_supervisor=""; + $search_datelastlogin=""; + $search_datepreviouslogin=""; + $search_date_creation=""; + $search_date_update=""; + $search_array_options=array(); + } } @@ -217,16 +217,16 @@ if ($sall) $sql.= natural_search(array_keys($fieldstos // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode=0; - if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } } // Add where from hooks $parameters=array(); @@ -238,7 +238,7 @@ $nbtotalofrecords=0; $result=$db->query($sql); if ($result) { - $nbtotalofrecords = $db->num_rows($result); + $nbtotalofrecords = $db->num_rows($result); } $sql.= $db->plimit($limit+1, $offset); @@ -246,18 +246,18 @@ $sql.= $db->plimit($limit+1, $offset); $result = $db->query($sql); if (! $result) { - dol_print_error($db); - exit; + dol_print_error($db); + exit; } $num = $db->num_rows($result); if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/user/card.php?id='.$id); - exit; + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/user/card.php?id='.$id); + exit; } llxHeader('',$langs->trans("ListOfUsers")); @@ -281,9 +281,9 @@ if ($mode != '') $param.='&mode='.$mode; // Add $param from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } $text = $langs->trans("ListOfUsers"); @@ -302,8 +302,8 @@ print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sorto if ($sall) { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } $moreforfilter=''; @@ -319,59 +319,59 @@ print ''; if (! empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.lastname']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.firstname']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.gender']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.employee']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.accountancy_code']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.email']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.fk_soc']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.entity']['checked'])) { - print ''; + print ''; } // Supervisor if (! empty($arrayfields['u.fk_user']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.datelastlogin']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['u.datepreviouslogin']['checked'])) { - print ''; + print ''; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) @@ -380,12 +380,12 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab { if (! empty($arrayfields["ef.".$key]['checked'])) { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print ''; + // Date creation + print ''; } if (! empty($arrayfields['u.tms']['checked'])) { - // Date modification - print ''; + // Date modification + print ''; } if (! empty($arrayfields['u.statut']['checked'])) { - // Status - print ''; + // Status + print ''; } // Action column print '"; - if (! empty($arrayfields['u.login']['checked'])) + print ""; + if (! empty($arrayfields['u.login']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) + { + print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); + } + else if ($obj->admin) + { + print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); + } + print ''; + if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['u.lastname']['checked'])) + if (! empty($arrayfields['u.lastname']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['u.firstname']['checked'])) + if (! empty($arrayfields['u.firstname']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['u.gender']['checked'])) + if (! empty($arrayfields['u.gender']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['u.employee']['checked'])) + if (! empty($arrayfields['u.employee']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.accountancy_code']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['u.email']['checked'])) + if (! empty($arrayfields['u.email']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['u.fk_soc']['checked'])) { print "'; - if (! $i) $totalarray['nbfield']++; - } - // Multicompany enabled - if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) - { - if (! empty($arrayfields['u.entity']['checked'])) + if ($obj->fk_soc) { - print ''; - if (! $i) $totalarray['nbfield']++; + $companystatic->id=$obj->fk_soc; + $companystatic->name=$obj->name; + $companystatic->canvas=$obj->canvas; + print $companystatic->getNomUrl(1); } - } - // Supervisor - if (! empty($arrayfields['u.fk_user']['checked'])) + else if ($obj->ldap_sid) + { + print $langs->trans("DomainUser"); + } + else + { + print $langs->trans("InternalUser"); + } + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Multicompany enabled + if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + { + if (! empty($arrayfields['u.entity']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + // Supervisor + if (! empty($arrayfields['u.fk_user']['checked'])) { // Resp - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } - // Date last login - if (! empty($arrayfields['u.datelastlogin']['checked'])) + // Date last login + if (! empty($arrayfields['u.datelastlogin']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } - // Date previous login - if (! empty($arrayfields['u.datepreviouslogin']['checked'])) + // Date previous login + if (! empty($arrayfields['u.datepreviouslogin']['checked'])) { - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; } // Extra fields @@ -632,44 +632,44 @@ while ($i < min($num,$limit)) $tmpkey='options_'.$key; print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print ''; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; } } } - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + print $hookmanager->resPrint; // Date creation - if (! empty($arrayfields['u.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['u.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status - if (! empty($arrayfields['u.statut']['checked'])) - { + if (! empty($arrayfields['u.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['u.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status + if (! empty($arrayfields['u.statut']['checked'])) + { $userstatic->statut=$obj->statut; - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; - print "\n"; + print "\n"; - $i++; + $i++; } $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); From c1c3725eb6c41f114934b944b9daad2ebab544bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Oct 2017 15:23:24 +0200 Subject: [PATCH 1107/1137] The website grabber rocks --- htdocs/websites/index.php | 83 ++++++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 22 deletions(-) diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 23c915335c5..4438812cc60 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -180,6 +180,8 @@ if ($action == 'addsite') // Add page if ($action == 'add') { + dol_mkdir($pathofwebsite); + $db->begin(); $objectpage->fk_website = $object->id; @@ -240,20 +242,25 @@ if ($action == 'add') } $objectpage->content = $tmp['content']; - $objectpage->content = preg_replace('/^.*]*>/ims', '', $objectpage->content); - $objectpage->content = preg_replace('/<\/body[^>]*>.*$/ims', '', $objectpage->content); + $objectpage->content = preg_replace('/^.*]*)*>/ims', '', $objectpage->content); + $objectpage->content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $objectpage->content); + $absoluteurlinaction=$urltograbdirwithoutslash; + // TODO Replace 'action="$urltograbdirwithoutslash' into action="/" + // TODO Replace 'action="$urltograbdirwithoutslash..."' into action="..." + // TODO Replace 'a href="$urltograbdirwithoutslash' into a href="/" + // TODO Replace 'a href="$urltograbdirwithoutslash..."' into a href="..." // Now loop to fetch all css files. Include them inline into header of page $objectpage->htmlheader = $tmp['content']; - $objectpage->htmlheader = preg_replace('/^.*]*>/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/<\/head[^>]*>.*$/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/]*>\n*/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/]*>\n*/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/]*>\n*/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/]*)*>\n*/ims', '', $objectpage->htmlheader); + $objectpage->htmlheader = preg_replace('/]*)*>\n*/ims', '', $objectpage->htmlheader); + $objectpage->htmlheader = preg_replace('/]*)*>\n*/ims', '', $objectpage->htmlheader); //$objectpage->htmlheader = preg_replace('/]*>\n*/ims', '', $objectpage->htmlheader); $objectpage->htmlheader = preg_replace('/[^<]*<\/title>\n*/ims', '', $objectpage->htmlheader); @@ -262,12 +269,14 @@ if ($action == 'add') // Now loop to fetch JS $tmp = $objectpage->htmlheader; - preg_match_all('/<script([^\.]+)src="([^>"]+)"([^>]*)><\/script>/i', $objectpage->htmlheader, $regs); + preg_match_all('/<script([^\.>]+)src=["\']([^"\'>]+)["\']([^>]*)><\/script>/i', $objectpage->htmlheader, $regs); foreach ($regs[0] as $key => $val) { - $urltograbbis = $urltograbdirwithoutslash.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key]; + dol_syslog("We will grab the resource ".$regs[2][$key]); $linkwithoutdomain = $regs[2][$key]; + $urltograbbis = $urltograbdirwithoutslash.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key]; + //$filetosave = $conf->medias->multidir_output[$conf->entity].'/css/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key]; if (preg_match('/^http/', $regs[2][$key])) { @@ -275,6 +284,15 @@ if ($action == 'add') $linkwithoutdomain = preg_replace('/^https?:\/\/[^\/]+\//i', '', $regs[2][$key]); //$filetosave = $conf->medias->multidir_output[$conf->entity].'/css/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; } + + //print $domaintograb.' - '.$domaintograbbis.' - '.$urltograbdirwithoutslash.' - '; + //print $linkwithoutdomain.' - '.$urltograbbis."<br>\n"; + + // Test if this is an external URL of grabbed web site. If yes, we do not load resource + $domaintograb = getDomainFromURL($urltograbdirwithoutslash); + $domaintograbbis = getDomainFromURL($urltograbbis); + if ($domaintograb != $domaintograbbis) continue; + /* $tmpgeturl = getURLContent($urltograbbis); if ($tmpgeturl['curl_error_no']) @@ -293,9 +311,9 @@ if ($action == 'add') if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); } + */ - $filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; - */ + //$filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; $tmp = preg_replace('/'.preg_quote($regs[0][$key],'/').'/i', '', $tmp); } $objectpage->htmlheader = trim($tmp); @@ -304,11 +322,14 @@ if ($action == 'add') // Now loop to fetch CSS $pagecsscontent = "\n".'<style>'."\n"; - preg_match_all('/<link([^\.]+)href="([^>"]+\.css)"([^>]*)>/i', $objectpage->htmlheader, $regs); + preg_match_all('/<link([^\.>]+)href=["\']([^"\'>]+\.css[^"\'>]*)["\']([^>]*)>/i', $objectpage->htmlheader, $regs); foreach ($regs[0] as $key => $val) { - $urltograbbis = $urltograbdirwithoutslash.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key]; + dol_syslog("We will grab the resource ".$regs[2][$key]); + $linkwithoutdomain = $regs[2][$key]; + $urltograbbis = $urltograbdirwithoutslash.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key]; + //$filetosave = $conf->medias->multidir_output[$conf->entity].'/css/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key]; if (preg_match('/^http/', $regs[2][$key])) { @@ -317,6 +338,14 @@ if ($action == 'add') //$filetosave = $conf->medias->multidir_output[$conf->entity].'/css/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; } + //print $domaintograb.' - '.$domaintograbbis.' - '.$urltograbdirwithoutslash.' - '; + //print $linkwithoutdomain.' - '.$urltograbbis."<br>\n"; + + // Test if this is an external URL of grabbed web site. If yes, we do not load resource + $domaintograb = getDomainFromURL($urltograbdirwithoutslash); + $domaintograbbis = getDomainFromURL($urltograbbis); + if ($domaintograb != $domaintograbbis) continue; + $tmpgeturl = getURLContent($urltograbbis); if ($tmpgeturl['curl_error_no']) { @@ -326,13 +355,13 @@ if ($action == 'add') } else { - //dol_mkdir(dirname($filetosave)); + //dol_mkdir(dirname($filetosave)); - //$fp = fopen($filetosave, "w"); - //fputs($fp, $tmpgeturl['content']); - //fclose($fp); - //if (! empty($conf->global->MAIN_UMASK)) - // @chmod($file, octdec($conf->global->MAIN_UMASK)); + //$fp = fopen($filetosave, "w"); + //fputs($fp, $tmpgeturl['content']); + //fclose($fp); + //if (! empty($conf->global->MAIN_UMASK)) + // @chmod($file, octdec($conf->global->MAIN_UMASK)); } // $filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; @@ -448,6 +477,16 @@ if ($action == 'add') // To generate the CSS, robot and htmlheader file. + // Check symlink to medias and restore it if ko + $pathtomedias=DOL_DATA_ROOT.'/medias'; + $pathtomediasinwebsite=$pathofwebsite.'/medias'; + if (! is_link(dol_osencode($pathtomediasinwebsite))) + { + dol_syslog("Create symlink for ".$pathtomedias." into name ".$pathtomediasinwebsite); + dol_mkdir(dirname($pathtomediasinwebsite)); // To be sure dir for website exists + $result = symlink($pathtomedias, $pathtomediasinwebsite); + } + if (! dol_is_file($filehtmlheader)) { $htmlheadercontent = "<!-- HTML header content (common for all pages) -->"; From 8b64f979ef1f9620a6d1d3f2699afe8c4bfe0b94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 15:49:39 +0200 Subject: [PATCH 1108/1137] Fix multiple upload was broken --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 73198771b93..7559179c87d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -131,7 +131,7 @@ class FormFile $out .= '<input class="flat minwidth400" type="file"'; $out .= ((! empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic')?' name="userfile"':' name="userfile[]" multiple'); $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); - $out .= (!empty($accept)?' accept="'.$accept.'"':'accept=""'); + $out .= (!empty($accept)?' accept="'.$accept.'"':' accept=""'); $out .= '>'; $out .= ' '; $out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"'; From 5f021990b4769739fe61c90a1084a0394e8e655f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 17:44:31 +0200 Subject: [PATCH 1109/1137] Code comment --- htdocs/user/card.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index eeb1e898736..4902e0b6de0 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1412,9 +1412,13 @@ else print '</td>'; print "</tr>\n"; + //$childids = $user->getAllChildIds(1); + if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))) { + // Even a superior can't see this info of its subordinates wihtout $user->rights->salaries->read and $user->rights->hrm->employee->read (setting/viewing is reserverd to HR people). + // However, he can see the valuation of timesheet of its subordinates even without these permissions. $langs->load("salaries"); // THM From 1f2555d7c6e83fed0fb6fd390a0eb2c000b6928d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 19:51:36 +0200 Subject: [PATCH 1110/1137] Add link other invoices of third party on supplier card to --- htdocs/fourn/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 3c257c9d4e5..6241a80aec1 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2036,6 +2036,7 @@ else $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherBills").'</a>)'; // Project if (! empty($conf->projet->enabled)) { From 5092c41d943f31ab902e479b15ac8903836ecb9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 20:04:11 +0200 Subject: [PATCH 1111/1137] Look and feel v6 --- htdocs/core/class/html.formactions.class.php | 1 - htdocs/fourn/paiement/card.php | 7 +++---- htdocs/fourn/paiement/info.php | 21 ++++++++++++-------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index adf5f4c340b..7d5bffb6e54 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -179,7 +179,6 @@ class FormActions if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill'); elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill'); elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal'); - elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment'); elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal'); elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder'); elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder'); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 4126ef8c134..36749977927 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -367,11 +367,10 @@ if ($result > 0) } print '</div>'; + /* print '<div class="fichecenter"><div class="fichehalfleft">'; - /* - * Documents generes - */ + // Documents generes $ref=dol_sanitizeFileName($object->ref); $filedir = $conf->fournisseur->payment->dir_output.'/'.dol_sanitizeFileName($object->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id; @@ -393,7 +392,7 @@ if ($result > 0) print '</div></div></div>'; //print '</td></tr></table>'; - + */ } else { diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php index 24263106052..eafc4f2decc 100644 --- a/htdocs/fourn/paiement/info.php +++ b/htdocs/fourn/paiement/info.php @@ -32,9 +32,12 @@ $langs->load("bills"); $langs->load("suppliers"); $langs->load("companies"); -$paiement = new PaiementFourn($db); -$paiement->fetch($_GET["id"], $user); -$paiement->info($_GET["id"]); +$id = GETPOST('id','int'); + +$object = new PaiementFourn($db); +$object->fetch($id); +$object->info($id); + /* * View @@ -42,15 +45,17 @@ $paiement->info($_GET["id"]); llxHeader(); -$head = payment_supplier_prepare_head($paiement); +$head = payment_supplier_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans("SupplierPayment"), 0, 'payment'); -print '<table width="100%"><tr><td>'; -dol_print_object_info($paiement); -print '</td></tr></table>'; +dol_banner_tab($object, 'id', $linkback, -1, 'rowid', 'ref'); -print '</div>'; +dol_fiche_end(); + +print '<table width="100%"><tr><td>'; +dol_print_object_info($object); +print '</td></tr></table>'; llxFooter(); From c28dec8dc2a63d4a66ca6b4362d6103722d10763 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 21:04:20 +0200 Subject: [PATCH 1112/1137] Fix balance no more visible --- htdocs/compta/bank/bankentries_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 271cb03cd6d..4e88ff8bf4a 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -100,10 +100,10 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder='ASC'; -if (! $sortfield) $sortfield='b.datev, b.dateo, b.rowid'; +if (! $sortfield) $sortfield='b.datev,b.dateo,b.rowid'; $mode_balance_ok=false; -//if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) // TODO Manage balance when account not selected +//if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) // TODO Manage balance when account not selected if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) { $sortfield = 'b.datev,b.dateo,b.rowid'; From afd83a4454e92a21027029db8610fbcfbead80cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 21:25:27 +0200 Subject: [PATCH 1113/1137] Fix navigation on bank receipts --- htdocs/compta/bank/releve.php | 120 ++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 57 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 95e73183154..ee30812545a 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -47,10 +47,11 @@ $langs->load("companies"); $langs->load("bills"); $action=GETPOST('action', 'alpha'); -$id=GETPOST('account'); -$ref=GETPOST('ref'); -$dvid=GETPOST('dvid'); -$numref=GETPOST('num'); +$id=GETPOST('account','int'); +$ref=GETPOST('ref','alpha'); +$dvid=GETPOST('dvid','alpha'); +$numref=GETPOST('num','alpha'); +$ve=GETPOST("ve",'alpha'); // Security check $fieldid = (! empty($ref)?$ref:$id); @@ -95,6 +96,62 @@ if ($id > 0 || ! empty($ref)) // Initialize technical object to manage context to save list fields $contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id); + +// Define number of receipt to show (current, previous or next one ?) +$found=false; +if ($_GET["rel"] == 'prev') +{ + // Recherche valeur pour num = numero releve precedent + $sql = "SELECT DISTINCT(b.num_releve) as num"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= " WHERE b.num_releve < '".$db->escape($numref)."'"; + $sql.= " AND b.fk_account = ".$object->id; + $sql.= " ORDER BY b.num_releve DESC"; + + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $numrows = $db->num_rows($resql); + if ($numrows > 0) + { + $obj = $db->fetch_object($resql); + $numref = $obj->num; + $found=true; + } + } +} +elseif ($_GET["rel"] == 'next') +{ + // Recherche valeur pour num = numero releve precedent + $sql = "SELECT DISTINCT(b.num_releve) as num"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= " WHERE b.num_releve > '".$db->escape($numref)."'"; + $sql.= " AND b.fk_account = ".$object->id; + $sql.= " ORDER BY b.num_releve ASC"; + + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $numrows = $db->num_rows($resql); + if ($numrows > 0) + { + $obj = $db->fetch_object($resql); + $numref = $obj->num; + $found=true; + } + } +} +else { + // On veut le releve num + $found=true; +} + + + + + $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; $sql.= " b.fk_bordereau,"; @@ -104,7 +161,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."bank as b"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau'; $sql.= " WHERE b.num_releve='".$db->escape($numref)."'"; -if (!isset($numref)) $sql.= " OR b.num_releve is null"; +if (empty($numref)) $sql.= " OR b.num_releve is null"; $sql.= " AND b.fk_account = ".$object->id; $sql.= " AND b.fk_account = ba.rowid"; $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day @@ -420,58 +477,6 @@ else /** * Show list of bank statements */ - $ve=$_GET["ve"]; - - // Define number of receipt to show (current, previous or next one ?) - $found=false; - if ($_GET["rel"] == 'prev') - { - // Recherche valeur pour num = numero releve precedent - $sql = "SELECT DISTINCT(b.num_releve) as num"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= " WHERE b.num_releve < '".$db->escape($numref)."'"; - $sql.= " AND b.fk_account = ".$object->id; - $sql.= " ORDER BY b.num_releve DESC"; - - dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) - { - $numrows = $db->num_rows($resql); - if ($numrows > 0) - { - $obj = $db->fetch_object($resql); - $numref = $obj->num; - $found=true; - } - } - } - elseif ($_GET["rel"] == 'next') - { - // Recherche valeur pour num = numero releve precedent - $sql = "SELECT DISTINCT(b.num_releve) as num"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= " WHERE b.num_releve > '".$db->escape($numref)."'"; - $sql.= " AND b.fk_account = ".$object->id; - $sql.= " ORDER BY b.num_releve ASC"; - - dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) - { - $numrows = $db->num_rows($resql); - if ($numrows > 0) - { - $obj = $db->fetch_object($resql); - $numref = $obj->num; - $found=true; - } - } - } - else { - // On veut le releve num - $found=true; - } $mesprevnext=''; $mesprevnext.='<div class="pagination"><ul>'; @@ -713,6 +718,7 @@ else dol_print_error($db); } } + print "</td>"; if ($objp->amount < 0) From 807724e0f0f18a04c789e9bb1d85633c9b89cfc5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 19:51:36 +0200 Subject: [PATCH 1114/1137] Add link other invoices of third party on supplier card to --- htdocs/fourn/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ca9689292b4..c0e8ce23c4b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2028,6 +2028,7 @@ else $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->facture->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherBills").'</a>)'; // Project if (! empty($conf->projet->enabled)) { From 5a4480bd1d57940b09166b44ce5d0016d5af4c06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 21:25:27 +0200 Subject: [PATCH 1115/1137] Fix navigation on bank receipts --- htdocs/compta/bank/releve.php | 120 ++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 57 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ec61c39ee84..efa7c03f89b 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -47,10 +47,11 @@ $langs->load("companies"); $langs->load("bills"); $action=GETPOST('action', 'alpha'); -$id=GETPOST('account'); -$ref=GETPOST('ref'); -$dvid=GETPOST('dvid'); -$numref=GETPOST('num'); +$id=GETPOST('account','int'); +$ref=GETPOST('ref','alpha'); +$dvid=GETPOST('dvid','alpha'); +$numref=GETPOST('num','alpha'); +$ve=GETPOST("ve",'alpha'); // Security check $fieldid = (! empty($ref)?$ref:$id); @@ -95,6 +96,62 @@ if ($id > 0 || ! empty($ref)) // Initialize technical object to manage context to save list fields $contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id); + +// Define number of receipt to show (current, previous or next one ?) +$found=false; +if ($_GET["rel"] == 'prev') +{ + // Recherche valeur pour num = numero releve precedent + $sql = "SELECT DISTINCT(b.num_releve) as num"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= " WHERE b.num_releve < '".$db->escape($numref)."'"; + $sql.= " AND b.fk_account = ".$object->id; + $sql.= " ORDER BY b.num_releve DESC"; + + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $numrows = $db->num_rows($resql); + if ($numrows > 0) + { + $obj = $db->fetch_object($resql); + $numref = $obj->num; + $found=true; + } + } +} +elseif ($_GET["rel"] == 'next') +{ + // Recherche valeur pour num = numero releve precedent + $sql = "SELECT DISTINCT(b.num_releve) as num"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; + $sql.= " WHERE b.num_releve > '".$db->escape($numref)."'"; + $sql.= " AND b.fk_account = ".$object->id; + $sql.= " ORDER BY b.num_releve ASC"; + + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); + $resql = $db->query($sql); + if ($resql) + { + $numrows = $db->num_rows($resql); + if ($numrows > 0) + { + $obj = $db->fetch_object($resql); + $numref = $obj->num; + $found=true; + } + } +} +else { + // On veut le releve num + $found=true; +} + + + + + $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; $sql.= " b.fk_bordereau,"; @@ -104,7 +161,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."bank as b"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau'; $sql.= " WHERE b.num_releve='".$db->escape($numref)."'"; -if (!isset($numref)) $sql.= " OR b.num_releve is null"; +if (empty($numref)) $sql.= " OR b.num_releve is null"; $sql.= " AND b.fk_account = ".$object->id; $sql.= " AND b.fk_account = ba.rowid"; $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day @@ -420,58 +477,6 @@ else /** * Show list of bank statements */ - $ve=$_GET["ve"]; - - // Define number of receipt to show (current, previous or next one ?) - $found=false; - if ($_GET["rel"] == 'prev') - { - // Recherche valeur pour num = numero releve precedent - $sql = "SELECT DISTINCT(b.num_releve) as num"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= " WHERE b.num_releve < '".$db->escape($numref)."'"; - $sql.= " AND b.fk_account = ".$object->id; - $sql.= " ORDER BY b.num_releve DESC"; - - dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) - { - $numrows = $db->num_rows($resql); - if ($numrows > 0) - { - $obj = $db->fetch_object($resql); - $numref = $obj->num; - $found=true; - } - } - } - elseif ($_GET["rel"] == 'next') - { - // Recherche valeur pour num = numero releve precedent - $sql = "SELECT DISTINCT(b.num_releve) as num"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; - $sql.= " WHERE b.num_releve > '".$db->escape($numref)."'"; - $sql.= " AND b.fk_account = ".$object->id; - $sql.= " ORDER BY b.num_releve ASC"; - - dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) - { - $numrows = $db->num_rows($resql); - if ($numrows > 0) - { - $obj = $db->fetch_object($resql); - $numref = $obj->num; - $found=true; - } - } - } - else { - // On veut le releve num - $found=true; - } $mesprevnext=''; $mesprevnext.='<div class="pagination"><ul>'; @@ -713,6 +718,7 @@ else dol_print_error($db); } } + print "</td>"; if ($objp->amount < 0) From 4b43faf0c186687dabaa2f1bef424526ccf39213 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 21:44:38 +0200 Subject: [PATCH 1116/1137] Fix lose filter --- htdocs/compta/bank/bankentries_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 4e88ff8bf4a..80463f10899 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -367,7 +367,7 @@ if (!empty($debit)) $param.='&debit='.$debit; if (!empty($credit)) $param.='&credit='.$credit; if (!empty($account)) $param.='&account='.$account; if (!empty($search_num_releve)) $param.='&search_num_releve='.urlencode($search_num_releve); -if ($search_conciliated != '') $param.='&search_conciliated='.urlencode($search_conciliated); +if ($search_conciliated != '' && $search_conciliated != '-1') $param.='&search_conciliated='.urlencode($search_conciliated); if (!empty($bid)) $param.='&bid='.$bid; if (dol_strlen($search_dt_start) > 0) $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int'); if (dol_strlen($search_dt_end) > 0) $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int'); From ab280feaa56d97650e3a9342dfcf6a96907418b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 22:37:30 +0200 Subject: [PATCH 1117/1137] Move datepicker vars into lib_heas.js.php --- htdocs/core/class/html.form.class.php | 4 +- htdocs/core/js/datepicker.js.php | 151 -------------------------- htdocs/core/js/lib_head.js.php | 33 ++++++ htdocs/main.inc.php | 6 - 4 files changed, 36 insertions(+), 158 deletions(-) delete mode 100644 htdocs/core/js/datepicker.js.php diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c29c0f9e924..faf26f7c111 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4803,8 +4803,10 @@ class Form { $retstring.="<script type='text/javascript'>"; $retstring.="$(function(){ $('#".$prefix."').datepicker({ - autoclose: true, + dateFormat: '".$langs->trans("FormatDateShortJQueryInput")."', + autoclose: true, todayHighlight: true,"; + // Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) { $retstring.=" diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php deleted file mode 100644 index 32b7ca43f5e..00000000000 --- a/htdocs/core/js/datepicker.js.php +++ /dev/null @@ -1,151 +0,0 @@ -<?php -/* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> - * - * 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 3 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, see <http://www.gnu.org/licenses/>. - */ - -/** - * \file htdocs/core/js/datepicker.js.php - * \brief File that include javascript functions for datepickers - */ - -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); -if (! defined('NOLOGIN')) define('NOLOGIN',1); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); - -session_cache_limiter(FALSE); - -require_once '../../main.inc.php'; - -// Define javascript type -top_httphead('text/javascript; charset=UTF-8'); -// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. -if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate'); -else header('Cache-Control: no-cache'); - - -// Define tradMonths javascript array (we define this in datepicker AND in parent page to avoid errors with IE8) -$tradMonths=array( - dol_escape_js($langs->transnoentitiesnoconv("January")), - dol_escape_js($langs->transnoentitiesnoconv("February")), - dol_escape_js($langs->transnoentitiesnoconv("March")), - dol_escape_js($langs->transnoentitiesnoconv("April")), - dol_escape_js($langs->transnoentitiesnoconv("May")), - dol_escape_js($langs->transnoentitiesnoconv("June")), - dol_escape_js($langs->transnoentitiesnoconv("July")), - dol_escape_js($langs->transnoentitiesnoconv("August")), - dol_escape_js($langs->transnoentitiesnoconv("September")), - dol_escape_js($langs->transnoentitiesnoconv("October")), - dol_escape_js($langs->transnoentitiesnoconv("November")), - dol_escape_js($langs->transnoentitiesnoconv("December")) -); - -$tradMonthsShort=array( - $langs->trans("JanuaryMin"), - $langs->trans("FebruaryMin"), - $langs->trans("MarchMin"), - $langs->trans("AprilMin"), - $langs->trans("MayMin"), - $langs->trans("JuneMin"), - $langs->trans("JulyMin"), - $langs->trans("AugustMin"), - $langs->trans("SeptemberMin"), - $langs->trans("OctoberMin"), - $langs->trans("NovemberMin"), - $langs->trans("DecemberMin") -); - -$tradDays=array( - $langs->trans("Sunday"), - $langs->trans("Monday"), - $langs->trans("Tuesday"), - $langs->trans("Wednesday"), - $langs->trans("Thursday"), - $langs->trans("Friday"), - $langs->trans("Saturday") -); - -$tradDaysShort=array( - $langs->trans("ShortSunday"), - $langs->trans("ShortMonday"), - $langs->trans("ShortTuesday"), - $langs->trans("ShortWednesday"), - $langs->trans("ShortThursday"), - $langs->trans("ShortFriday"), - $langs->trans("ShortSaturday") -); - -$tradDaysMin=array( - $langs->trans("SundayMin"), - $langs->trans("MondayMin"), - $langs->trans("TuesdayMin"), - $langs->trans("WednesdayMin"), - $langs->trans("ThursdayMin"), - $langs->trans("FridayMin"), - $langs->trans("SaturdayMin") -); -?> - - -// For jQuery date picker -var tradMonths = <?php echo json_encode($tradMonths) ?>; -var tradMonthsShort = <?php echo json_encode($tradMonthsShort) ?>; -var tradDays = <?php echo json_encode($tradDays) ?>; -var tradDaysShort = <?php echo json_encode($tradDaysShort) ?>; -var tradDaysMin = <?php echo json_encode($tradDaysMin) ?>; - - -// For JQuery date picker -$(document).ready(function() { - $.datepicker.setDefaults({ - autoSize: true, - changeMonth: true, - changeYear: true, - altField: '#timestamp', - altFormat: '@' // Gives a timestamp dateformat - }); -}); - -jQuery(function($){ - $.datepicker.regional['<?php echo $langs->defaultlang ?>'] = { - closeText: '<?php echo $langs->trans("Close2") ?>', - prevText: '<?php echo $langs->trans("Previous") ?>', - nextText: '<?php echo $langs->trans("Next") ?>', - currentText: '<?php echo $langs->trans("Now") ?>', - monthNames: tradMonths, - monthNamesShort: tradMonthsShort, - dayNames: tradDays, - dayNamesShort: tradDaysShort, - dayNamesMin: tradDaysMin, - weekHeader: '<?php echo $langs->trans("Week"); ?>', - dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>', - firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, - isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>, - showMonthAfterYear: false, /* TODO add specific to country */ - yearSuffix: '' /* TODO add specific to country */ - }; - $.datepicker.setDefaults($.datepicker.regional['<?php echo $langs->defaultlang ?>']); -}); - - -<?php -if (is_object($db)) $db->close(); diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index f725e23cad5..188c8dc193a 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -117,6 +117,39 @@ var tradDays = <?php echo json_encode($tradDays) ?>; var tradDaysShort = <?php echo json_encode($tradDaysShort) ?>; var tradDaysMin = <?php echo json_encode($tradDaysMin) ?>; +// For JQuery date picker +$(document).ready(function() { + $.datepicker.setDefaults({ + autoSize: true, + changeMonth: true, + changeYear: true, + altField: '#timestamp', + altFormat: '@' // Gives a timestamp dateformat + }); +}); + +jQuery(function($){ + $.datepicker.regional['<?php echo $langs->defaultlang ?>'] = { + closeText: '<?php echo $langs->trans("Close2") ?>', + prevText: '<?php echo $langs->trans("Previous") ?>', + nextText: '<?php echo $langs->trans("Next") ?>', + currentText: '<?php echo $langs->trans("Now") ?>', + monthNames: tradMonths, + monthNamesShort: tradMonthsShort, + dayNames: tradDays, + dayNamesShort: tradDaysShort, + dayNamesMin: tradDaysMin, + weekHeader: '<?php echo $langs->trans("Week"); ?>', + dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>', + firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, + isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>, + showMonthAfterYear: false, /* TODO add specific to country */ + yearSuffix: '' /* TODO add specific to country */ + }; + $.datepicker.setDefaults($.datepicker.regional['<?php echo $langs->defaultlang ?>']); +}); + + /** * Set select2 translations (if module was loaded). diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6321856bfb3..973a7b95567 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1328,12 +1328,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print '<!-- Includes JS of Dolibarr -->'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n"; - // Add datepicker default options (needed by jquery datepicker!) - /*if (! defined('DISABLE_DATE_PICKER')) - { - print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n"; - }*/ - // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) { From e17c92b11cc7f900ac4e973506d15d1d84f4dba5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 22:40:33 +0200 Subject: [PATCH 1118/1137] Code comment --- htdocs/core/js/lib_head.js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 188c8dc193a..a68995e5eeb 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -140,7 +140,7 @@ jQuery(function($){ dayNamesShort: tradDaysShort, dayNamesMin: tradDaysMin, weekHeader: '<?php echo $langs->trans("Week"); ?>', - dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>', + dateFormat: '<?php echo $langs->trans("FormatDateShortJQuery"); ?>', /* Note dd/mm/yy means year on 4 digit in jquery format */ firstDay: <?php echo (isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, isRTL: <?php echo ($langs->trans("DIRECTION")=='rtl'?'true':'false'); ?>, showMonthAfterYear: false, /* TODO add specific to country */ From c0147864467cfe651d026d4340a6770f9b7108ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 23:07:27 +0200 Subject: [PATCH 1119/1137] NEW On reconciliation, show balance including all reconciliated fields --- htdocs/compta/bank/bankentries_list.php | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 80463f10899..319f5cb05db 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -963,6 +963,55 @@ if ($resql) else dol_print_error($db); $balancecalculated=true; + + // Output a line with start balance + if ($user->rights->banque->consolidate && $action == 'reconcile') + { + $tmpnbfieldbeforebalance=0; + $tmpnbfieldafterbalance=0; + $balancefieldfound=false; + foreach($arrayfields as $key => $val) + { + if ($key == 'balance') + { + $balancefieldfound=true; + continue; + } + if (! empty($arrayfields[$key]['checked'])) + { + if (! $balancefieldfound) $tmpnbfieldbeforebalance++; + else $tmpnbfieldafterbalance++; + } + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + if (! empty($arrayfields[$key]['checked'])) + { + if (! $balancefieldfound) $tmpnbfieldbeforebalance++; + else $tmpnbfieldafterbalance++; + } + } + } + } + + print '<tr class="oddeven trforbreak">'; + if ($tmpnbfieldbeforebalance) + { + print '<td colspan="'.$tmpnbfieldbeforebalance.'">'; + print '</td>'; + } + print '<td align="right">'; + print price2num($balance, 'MT'); + print '</td>'; + print '<td colspan="'.($tmpnbfieldafterbalance+2).'">'; + print '</td>'; + print '</tr>'; + } } $balance = price2num($balance + ($sign * $objp->amount),'MT'); From 07d16afe3bc2bb685c3f4cd405a6a1fa7cf5d5cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 23:10:40 +0200 Subject: [PATCH 1120/1137] Save one space --- htdocs/compta/bank/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 27de7b6e863..0fc7657f184 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -669,7 +669,6 @@ else if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT) { - print '<br>'; print '<div class="underbanner clearboth"></div>'; From d06f260b9496648e127a03da1b3c2f2d3e9269b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 23:13:26 +0200 Subject: [PATCH 1121/1137] Fix amount format --- htdocs/compta/bank/bankentries_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 319f5cb05db..326e3ece569 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1006,7 +1006,7 @@ if ($resql) print '</td>'; } print '<td align="right">'; - print price2num($balance, 'MT'); + print price(price2num($balance, 'MT'), 1, $langs); print '</td>'; print '<td colspan="'.($tmpnbfieldafterbalance+2).'">'; print '</td>'; From b90770c30c05c90c2dae2b3f917570f394c199db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Fri, 13 Oct 2017 23:38:57 +0200 Subject: [PATCH 1122/1137] NEW Can rename (so reorder) bank receipts --- htdocs/compta/bank/releve.php | 46 +++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ee30812545a..fb43f098583 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -52,6 +52,9 @@ $ref=GETPOST('ref','alpha'); $dvid=GETPOST('dvid','alpha'); $numref=GETPOST('num','alpha'); $ve=GETPOST("ve",'alpha'); +$brref=GETPOST('brref','alpha'); +$oldbankreceipt=GETPOST('oldbankreceipt','alpha'); +$newbankreceipt=GETPOST('newbankreceipt','alpha'); // Security check $fieldid = (! empty($ref)?$ref:$id); @@ -149,9 +152,6 @@ else { } - - - $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; $sql.= " b.fk_bordereau,"; @@ -174,6 +174,16 @@ $sqlrequestforbankline = $sql; * Actions */ +if ($action == 'confirm_editbankreceipt' && ! empty($oldbankreceipt) && ! empty($newbankreceipt)) +{ + // TODO Add a test to check newbankreceipt does not exists yet + $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX.'bank SET num_releve = "'.$db->escape($newbankreceipt).'" WHERE num_releve = "'.$db->escape($oldbankreceipt).'"'; + $result = $db->query($sqlupdate); + if ($result < 0) dol_print_error($db); + + $action='view'; +} + // ZIP creation if ($action=="dl" && $numref > 0) { @@ -404,16 +414,22 @@ if (empty($numref)) } print '</div>'; - print '<br><br>'; print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$object->id, $sortfield, $sortorder,'',$numrows); + print '<form name="aaa" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="confirm_editbankreceipt">'; + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; + print '<input type="hidden" name="account" value="'.$object->id.'">'; + print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td>'.$langs->trans("AccountStatement").'</td>'; print '<td align="right">'.$langs->trans("InitialBankBalance").'</td>'; print '<td align="right">'.$langs->trans("EndBankBalance").'</td>'; + print '<td></td>'; print '</tr>'; $balancestart=array(); @@ -429,7 +445,20 @@ if (empty($numref)) } else { - print '<tr class="oddeven"><td><a href="releve.php?num='.$objp->numr.'&account='.$object->id.'">'.$objp->numr.'</a></td>'; + print '<tr class="oddeven">'; + print '<td>'; + if ($action != 'editbankreceipt' || $objp->numr != $brref) + { + print '<a href="releve.php?num='.$objp->numr.'&account='.$object->id.'">'.$objp->numr.'</a>'; + } + else + { + print '<input type="hidden" name="oldbankreceipt" value="'.$objp->numr.'">'; + print '<input type="text" name="newbankreceipt" value="'.$objp->numr.'">'; + print '<input type="submit" class="button" name="actionnewbankreceipt" value="'.$langs->trans("Rename").'">'; + print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; + } + print '</td>'; // Calculate start amount $sql = "SELECT sum(b.amount) as amount"; @@ -459,11 +488,18 @@ if (empty($numref)) } print '<td align="right">'.price(($balancestart[$objp->numr]+$content[$objp->numr]),'',$langs,1,-1,-1,$conf->currency).'</td>'; + print '<td align="center">'; + if ($user->rights->banque->consolidate && $action != 'editbankreceipt') { + print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.'&action=editbankreceipt&brref='.$objp->numr.'">'.img_edit().'</a>'; + } + print '</td>'; + print '</tr>'."\n"; } $i++; } print "</table>\n"; + print '</form>'; print "\n</div>\n"; } From 56e27d785adeb7135490fe7e1aadc5a7387f279f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sat, 14 Oct 2017 01:03:59 +0200 Subject: [PATCH 1123/1137] CSS on report --- htdocs/compta/resultat/clientfourn.php | 16 ++++++++-------- htdocs/compta/resultat/index.php | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index eea830dfbc5..485b9a9b47a 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -338,7 +338,7 @@ else /* * Factures clients */ - print '<tr><td colspan="4">'.$langs->trans("CustomersInvoices").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("CustomersInvoices").'</td></tr>'; if ($modecompta == 'CREANCES-DETTES') { @@ -500,7 +500,7 @@ else $sql .= " GROUP BY name, socid"; $sql.= $db->order($sortfield, $sortorder); - print '<tr><td colspan="4">'.$langs->trans("SuppliersInvoices").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("SuppliersInvoices").'</td></tr>'; $subtotal_ht = 0; $subtotal_ttc = 0; @@ -554,7 +554,7 @@ else * Charges sociales non deductibles */ - print '<tr><td colspan="4">'.$langs->trans("SocialContributionsNondeductibles").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("SocialContributionsNondeductibles").'</td></tr>'; if ($modecompta == 'CREANCES-DETTES') { @@ -630,7 +630,7 @@ else * Charges sociales deductibles */ - print '<tr><td colspan="4">'.$langs->trans("SocialContributionsDeductibles").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("SocialContributionsDeductibles").'</td></tr>'; if ($modecompta == 'CREANCES-DETTES') { @@ -727,7 +727,7 @@ else if (! empty($conf->salaries->enabled)) { - print '<tr><td colspan="4">'.$langs->trans("Salaries").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Salaries").'</td></tr>'; if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { @@ -840,7 +840,7 @@ else $sql.= $db->order($newsortfield, $sortorder); } - print '<tr><td colspan="4">'.$langs->trans("ExpenseReport").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("ExpenseReport").'</td></tr>'; dol_syslog("get expense report outcome"); $result=$db->query($sql); @@ -890,7 +890,7 @@ else if (! empty($conf->don->enabled)) { - print '<tr><td colspan="4">'.$langs->trans("Donations").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("Donations").'</td></tr>'; if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { @@ -972,7 +972,7 @@ else * VAT */ - print '<tr><td colspan="4">'.$langs->trans("VAT").'</td></tr>'; + print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("VAT").'</td></tr>'; $subtotal_ht = 0; $subtotal_ttc = 0; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index bd1d8effcc7..20333675542 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -893,10 +893,19 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } print '</tr>'; print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>'; +// Loop on each year to ouput for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print '<td class="liste_titre" align="center">'.$langs->trans("Outcome").'</td>'; - print '<td class="liste_titre" align="center" class="borderrightlight">'.$langs->trans("Income").'</td>'; + print '<td class="liste_titre" align="center">'; + $htmlhelp=''; + // if ($modecompta == 'RECETTES-DEPENSES') $htmlhelp=$langs->trans("PurchasesPlusVATEarnedAndDue"); + print $form->textwithpicto($langs->trans("Outcome"), $htmlhelp); + print '</td>'; + print '<td class="liste_titre" align="center" class="borderrightlight">'; + $htmlhelp=''; + // if ($modecompta == 'RECETTES-DEPENSES') $htmlhelp=$langs->trans("SalesPlusVATToRetreive"); + print $form->textwithpicto($langs->trans("Income"), $htmlhelp); + print '</td>'; } print '</tr>'; @@ -967,7 +976,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { $in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0); $out=(isset($totsorties[$annee])?price2num($totsorties[$annee],'MT'):0); - print price($in-$out).'</td>'; + print price(price2num($in-$out, 'MT')).'</td>'; // print '<td> </td>'; } } From f853dbc152dedd90a3227e61bdd0c6ff95929c7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sat, 14 Oct 2017 02:55:07 +0200 Subject: [PATCH 1124/1137] Add spec for SEPA --- dev/resources/sepa/pain.001.001.03.xsd | 921 +++++++++++++++++++++++++ dev/resources/sepa/pain.008.001.02.xsd | 879 +++++++++++++++++++++++ dev/resources/sepa/text.txt | 2 + 3 files changed, 1802 insertions(+) create mode 100644 dev/resources/sepa/pain.001.001.03.xsd create mode 100644 dev/resources/sepa/pain.008.001.02.xsd create mode 100644 dev/resources/sepa/text.txt diff --git a/dev/resources/sepa/pain.001.001.03.xsd b/dev/resources/sepa/pain.001.001.03.xsd new file mode 100644 index 00000000000..8649779919c --- /dev/null +++ b/dev/resources/sepa/pain.001.001.03.xsd @@ -0,0 +1,921 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!--Generated by SWIFTStandards Workstation (build:R6.1.0.2) on 2009 Jan 08 17:30:53--> +<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"> + <xs:element name="Document" type="Document"/> + <xs:complexType name="AccountIdentification4Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="IBAN" type="IBAN2007Identifier"/> + <xs:element name="Othr" type="GenericAccountIdentification1"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="AccountSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalAccountIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType"> + <xs:restriction base="xs:decimal"> + <xs:minInclusive value="0"/> + <xs:fractionDigits value="5"/> + <xs:totalDigits value="18"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ActiveOrHistoricCurrencyAndAmount"> + <xs:simpleContent> + <xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType"> + <xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:simpleType name="ActiveOrHistoricCurrencyCode"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{3,3}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="AddressType2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="ADDR"/> + <xs:enumeration value="PBOX"/> + <xs:enumeration value="HOME"/> + <xs:enumeration value="BIZZ"/> + <xs:enumeration value="MLTO"/> + <xs:enumeration value="DLVY"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="AmountType3Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element name="EqvtAmt" type="EquivalentAmount2"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="AnyBICIdentifier"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Authorisation1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="Authorisation1Code"/> + <xs:element name="Prtry" type="Max128Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Authorisation1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="AUTH"/> + <xs:enumeration value="FDET"/> + <xs:enumeration value="FSUM"/> + <xs:enumeration value="ILEV"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="BICIdentifier"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="BaseOneRate"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="10"/> + <xs:totalDigits value="11"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="BatchBookingIndicator"> + <xs:restriction base="xs:boolean"/> + </xs:simpleType> + <xs:complexType name="BranchAndFinancialInstitutionIdentification4"> + <xs:sequence> + <xs:element name="FinInstnId" type="FinancialInstitutionIdentification7"/> + <xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="BranchData2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CashAccount16"> + <xs:sequence> + <xs:element name="Id" type="AccountIdentification4Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CashAccountType2"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="CashAccountType4Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="CashAccountType4Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CASH"/> + <xs:enumeration value="CHAR"/> + <xs:enumeration value="COMM"/> + <xs:enumeration value="TAXE"/> + <xs:enumeration value="CISH"/> + <xs:enumeration value="TRAS"/> + <xs:enumeration value="SACC"/> + <xs:enumeration value="CACC"/> + <xs:enumeration value="SVGS"/> + <xs:enumeration value="ONDP"/> + <xs:enumeration value="MGLD"/> + <xs:enumeration value="NREX"/> + <xs:enumeration value="MOMA"/> + <xs:enumeration value="LOAN"/> + <xs:enumeration value="SLRY"/> + <xs:enumeration value="ODFT"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="CategoryPurpose1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalCategoryPurpose1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ChargeBearerType1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="DEBT"/> + <xs:enumeration value="CRED"/> + <xs:enumeration value="SHAR"/> + <xs:enumeration value="SLEV"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Cheque6"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/> + <xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/> + <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/> + <xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ChequeDelivery1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="MLDB"/> + <xs:enumeration value="MLCD"/> + <xs:enumeration value="MLFA"/> + <xs:enumeration value="CRDB"/> + <xs:enumeration value="CRCD"/> + <xs:enumeration value="CRFA"/> + <xs:enumeration value="PUDB"/> + <xs:enumeration value="PUCD"/> + <xs:enumeration value="PUFA"/> + <xs:enumeration value="RGDB"/> + <xs:enumeration value="RGCD"/> + <xs:enumeration value="RGFA"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ChequeDeliveryMethod1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ChequeDelivery1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ChequeType2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CCHQ"/> + <xs:enumeration value="CCCH"/> + <xs:enumeration value="BCHQ"/> + <xs:enumeration value="DRFT"/> + <xs:enumeration value="ELDR"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ClearingSystemIdentification2Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ClearingSystemMemberIdentification2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/> + <xs:element name="MmbId" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ContactDetails2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="CountryCode"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{2,2}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="CreditDebitCode"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CRDT"/> + <xs:enumeration value="DBIT"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="CreditTransferTransactionInformation10"> + <xs:sequence> + <xs:element name="PmtId" type="PaymentIdentification1"/> + <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/> + <xs:element name="Amt" type="AmountType3Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRateInformation1"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque6"/> + <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification32"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/> + <xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/> + <xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/> + <xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/> + <xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation5"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CreditorReferenceInformation2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CreditorReferenceType1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="DocumentType3Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CreditorReferenceType2"> + <xs:sequence> + <xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CustomerCreditTransferInitiationV03"> + <xs:sequence> + <xs:element name="GrpHdr" type="GroupHeader32"/> + <xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstructionInformation3"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DateAndPlaceOfBirth"> + <xs:sequence> + <xs:element name="BirthDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/> + <xs:element name="CityOfBirth" type="Max35Text"/> + <xs:element name="CtryOfBirth" type="CountryCode"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DatePeriodDetails"> + <xs:sequence> + <xs:element name="FrDt" type="ISODate"/> + <xs:element name="ToDt" type="ISODate"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="DecimalNumber"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="17"/> + <xs:totalDigits value="18"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Document"> + <xs:sequence> + <xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV03"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DocumentAdjustment1"> + <xs:sequence> + <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="DocumentType3Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="RADM"/> + <xs:enumeration value="RPIN"/> + <xs:enumeration value="FXDR"/> + <xs:enumeration value="DISP"/> + <xs:enumeration value="PUOR"/> + <xs:enumeration value="SCOR"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="DocumentType5Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="MSIN"/> + <xs:enumeration value="CNFA"/> + <xs:enumeration value="DNFA"/> + <xs:enumeration value="CINV"/> + <xs:enumeration value="CREN"/> + <xs:enumeration value="DEBN"/> + <xs:enumeration value="HIRI"/> + <xs:enumeration value="SBIN"/> + <xs:enumeration value="CMCN"/> + <xs:enumeration value="SOAC"/> + <xs:enumeration value="DISP"/> + <xs:enumeration value="BOLD"/> + <xs:enumeration value="VCHR"/> + <xs:enumeration value="AROI"/> + <xs:enumeration value="TSUT"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="EquivalentAmount2"> + <xs:sequence> + <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ExchangeRateInformation1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/> + <xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ExchangeRateType1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="SPOT"/> + <xs:enumeration value="SALE"/> + <xs:enumeration value="AGRD"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalAccountIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalCategoryPurpose1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalClearingSystemIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="5"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalFinancialInstitutionIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalLocalInstrument1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="35"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalOrganisationIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalPersonIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalPurpose1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalServiceLevel1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="FinancialIdentificationSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="FinancialInstitutionIdentification7"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="BIC" type="BICIdentifier"/> + <xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> + <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericAccountIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max34Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericFinancialIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericOrganisationIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericPersonIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GroupHeader32"> + <xs:sequence> + <xs:element name="MsgId" type="Max35Text"/> + <xs:element name="CreDtTm" type="ISODateTime"/> + <xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/> + <xs:element name="NbOfTxs" type="Max15NumericText"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> + <xs:element name="InitgPty" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification4"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="IBAN2007Identifier"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ISODate"> + <xs:restriction base="xs:date"/> + </xs:simpleType> + <xs:simpleType name="ISODateTime"> + <xs:restriction base="xs:dateTime"/> + </xs:simpleType> + <xs:simpleType name="Instruction3Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CHQB"/> + <xs:enumeration value="HOLD"/> + <xs:enumeration value="PHOB"/> + <xs:enumeration value="TELB"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="InstructionForCreditorAgent1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="LocalInstrument2Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalLocalInstrument1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Max10Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="10"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max128Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="128"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max140Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="140"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max15NumericText"> + <xs:restriction base="xs:string"> + <xs:pattern value="[0-9]{1,15}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max16Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="16"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max2048Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="2048"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max34Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="34"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max35Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="35"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max4Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max70Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="70"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="NameAndAddress10"> + <xs:sequence> + <xs:element name="Nm" type="Max140Text"/> + <xs:element name="Adr" type="PostalAddress6"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="NamePrefix1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="DOCT"/> + <xs:enumeration value="MIST"/> + <xs:enumeration value="MISS"/> + <xs:enumeration value="MADM"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Number"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="0"/> + <xs:totalDigits value="18"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="OrganisationIdentification4"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="BICOrBEI" type="AnyBICIdentifier"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="OrganisationIdentificationSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="Party6Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="OrgId" type="OrganisationIdentification4"/> + <xs:element name="PrvtId" type="PersonIdentification5"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PartyIdentification32"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> + <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party6Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PaymentIdentification1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/> + <xs:element name="EndToEndId" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PaymentInstructionInformation3"> + <xs:sequence> + <xs:element name="PmtInfId" type="Max35Text"/> + <xs:element name="PmtMtd" type="PaymentMethod3Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/> + <xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/> + <xs:element name="ReqdExctnDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/> + <xs:element name="Dbtr" type="PartyIdentification32"/> + <xs:element name="DbtrAcct" type="CashAccount16"/> + <xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransactionInformation10"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="PaymentMethod3Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CHK"/> + <xs:enumeration value="TRF"/> + <xs:enumeration value="TRA"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PaymentTypeInformation19"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="PercentageRate"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="10"/> + <xs:totalDigits value="11"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PersonIdentification5"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PersonIdentificationSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalPersonIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="PhoneNumber"> + <xs:restriction base="xs:string"> + <xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PostalAddress6"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> + <xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Priority2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="HIGH"/> + <xs:enumeration value="NORM"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Purpose2Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalPurpose1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ReferredDocumentInformation3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ReferredDocumentType1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="DocumentType5Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ReferredDocumentType2"> + <xs:sequence> + <xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RegulatoryAuthority2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RegulatoryReporting3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="RegulatoryReportingType1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CRED"/> + <xs:enumeration value="DEBT"/> + <xs:enumeration value="BOTH"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="RemittanceAmount1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="DscntApldAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RemittanceInformation5"> + <xs:sequence> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation7"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RemittanceLocation2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="RemittanceLocationMethod2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="FAXI"/> + <xs:enumeration value="EDIC"/> + <xs:enumeration value="URID"/> + <xs:enumeration value="EMAL"/> + <xs:enumeration value="POST"/> + <xs:enumeration value="SMSM"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ServiceLevel8Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalServiceLevel1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="StructuredRegulatoryReporting3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="StructuredRemittanceInformation7"> + <xs:sequence> + <xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/> + <xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount1"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification32"/> + <xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxAmount1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxAuthorisation1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxInformation3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/> + <xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxParty1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxParty2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxPeriod1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxRecord1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/> + <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxRecordDetails1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/> + <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="TaxRecordPeriod1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="MM01"/> + <xs:enumeration value="MM02"/> + <xs:enumeration value="MM03"/> + <xs:enumeration value="MM04"/> + <xs:enumeration value="MM05"/> + <xs:enumeration value="MM06"/> + <xs:enumeration value="MM07"/> + <xs:enumeration value="MM08"/> + <xs:enumeration value="MM09"/> + <xs:enumeration value="MM10"/> + <xs:enumeration value="MM11"/> + <xs:enumeration value="MM12"/> + <xs:enumeration value="QTR1"/> + <xs:enumeration value="QTR2"/> + <xs:enumeration value="QTR3"/> + <xs:enumeration value="QTR4"/> + <xs:enumeration value="HLF1"/> + <xs:enumeration value="HLF2"/> + </xs:restriction> + </xs:simpleType> +</xs:schema> diff --git a/dev/resources/sepa/pain.008.001.02.xsd b/dev/resources/sepa/pain.008.001.02.xsd new file mode 100644 index 00000000000..63359725617 --- /dev/null +++ b/dev/resources/sepa/pain.008.001.02.xsd @@ -0,0 +1,879 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!--Generated by SWIFTStandards Workstation (build:R6.1.0.2) on 2009 Jan 08 17:30:53--> +<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"> + <xs:element name="Document" type="Document"/> + <xs:complexType name="AccountIdentification4Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="IBAN" type="IBAN2007Identifier"/> + <xs:element name="Othr" type="GenericAccountIdentification1"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="AccountSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalAccountIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType"> + <xs:restriction base="xs:decimal"> + <xs:minInclusive value="0"/> + <xs:fractionDigits value="5"/> + <xs:totalDigits value="18"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ActiveOrHistoricCurrencyAndAmount"> + <xs:simpleContent> + <xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType"> + <xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:simpleType name="ActiveOrHistoricCurrencyCode"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{3,3}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="AddressType2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="ADDR"/> + <xs:enumeration value="PBOX"/> + <xs:enumeration value="HOME"/> + <xs:enumeration value="BIZZ"/> + <xs:enumeration value="MLTO"/> + <xs:enumeration value="DLVY"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="AmendmentInformationDetails6"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlMndtId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlCdtrSchmeId" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlCdtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlCdtrAgtAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtrAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtrAgtAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlFnlColltnDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="OrgnlFrqcy" type="Frequency1Code"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="AnyBICIdentifier"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Authorisation1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="Authorisation1Code"/> + <xs:element name="Prtry" type="Max128Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Authorisation1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="AUTH"/> + <xs:enumeration value="FDET"/> + <xs:enumeration value="FSUM"/> + <xs:enumeration value="ILEV"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="BICIdentifier"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="BatchBookingIndicator"> + <xs:restriction base="xs:boolean"/> + </xs:simpleType> + <xs:complexType name="BranchAndFinancialInstitutionIdentification4"> + <xs:sequence> + <xs:element name="FinInstnId" type="FinancialInstitutionIdentification7"/> + <xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="BranchData2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CashAccount16"> + <xs:sequence> + <xs:element name="Id" type="AccountIdentification4Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CashAccountType2"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="CashAccountType4Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="CashAccountType4Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CASH"/> + <xs:enumeration value="CHAR"/> + <xs:enumeration value="COMM"/> + <xs:enumeration value="TAXE"/> + <xs:enumeration value="CISH"/> + <xs:enumeration value="TRAS"/> + <xs:enumeration value="SACC"/> + <xs:enumeration value="CACC"/> + <xs:enumeration value="SVGS"/> + <xs:enumeration value="ONDP"/> + <xs:enumeration value="MGLD"/> + <xs:enumeration value="NREX"/> + <xs:enumeration value="MOMA"/> + <xs:enumeration value="LOAN"/> + <xs:enumeration value="SLRY"/> + <xs:enumeration value="ODFT"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="CategoryPurpose1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalCategoryPurpose1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="ChargeBearerType1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="DEBT"/> + <xs:enumeration value="CRED"/> + <xs:enumeration value="SHAR"/> + <xs:enumeration value="SLEV"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ClearingSystemIdentification2Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ClearingSystemMemberIdentification2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/> + <xs:element name="MmbId" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ContactDetails2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="CountryCode"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{2,2}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="CreditDebitCode"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CRDT"/> + <xs:enumeration value="DBIT"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="CreditorReferenceInformation2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CreditorReferenceType1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="DocumentType3Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CreditorReferenceType2"> + <xs:sequence> + <xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CustomerDirectDebitInitiationV02"> + <xs:sequence> + <xs:element name="GrpHdr" type="GroupHeader39"/> + <xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstructionInformation4"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DateAndPlaceOfBirth"> + <xs:sequence> + <xs:element name="BirthDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/> + <xs:element name="CityOfBirth" type="Max35Text"/> + <xs:element name="CtryOfBirth" type="CountryCode"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DatePeriodDetails"> + <xs:sequence> + <xs:element name="FrDt" type="ISODate"/> + <xs:element name="ToDt" type="ISODate"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="DecimalNumber"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="17"/> + <xs:totalDigits value="18"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="DirectDebitTransaction6"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="MndtRltdInf" type="MandateRelatedInformation6"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrSchmeId" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="PreNtfctnId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PreNtfctnDt" type="ISODate"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DirectDebitTransactionInformation9"> + <xs:sequence> + <xs:element name="PmtId" type="PaymentIdentification1"/> + <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation20"/> + <xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="DrctDbtTx" type="DirectDebitTransaction6"/> + <xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification32"/> + <xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount16"/> + <xs:element name="Dbtr" type="PartyIdentification32"/> + <xs:element name="DbtrAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="InstrForCdtrAgt" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/> + <xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/> + <xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/> + <xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation5"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="Document"> + <xs:sequence> + <xs:element name="CstmrDrctDbtInitn" type="CustomerDirectDebitInitiationV02"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="DocumentAdjustment1"> + <xs:sequence> + <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="DocumentType3Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="RADM"/> + <xs:enumeration value="RPIN"/> + <xs:enumeration value="FXDR"/> + <xs:enumeration value="DISP"/> + <xs:enumeration value="PUOR"/> + <xs:enumeration value="SCOR"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="DocumentType5Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="MSIN"/> + <xs:enumeration value="CNFA"/> + <xs:enumeration value="DNFA"/> + <xs:enumeration value="CINV"/> + <xs:enumeration value="CREN"/> + <xs:enumeration value="DEBN"/> + <xs:enumeration value="HIRI"/> + <xs:enumeration value="SBIN"/> + <xs:enumeration value="CMCN"/> + <xs:enumeration value="SOAC"/> + <xs:enumeration value="DISP"/> + <xs:enumeration value="BOLD"/> + <xs:enumeration value="VCHR"/> + <xs:enumeration value="AROI"/> + <xs:enumeration value="TSUT"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalAccountIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalCategoryPurpose1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalClearingSystemIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="5"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalFinancialInstitutionIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalLocalInstrument1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="35"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalOrganisationIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalPersonIdentification1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalPurpose1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ExternalServiceLevel1Code"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="FinancialIdentificationSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="FinancialInstitutionIdentification7"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="BIC" type="BICIdentifier"/> + <xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> + <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Frequency1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="YEAR"/> + <xs:enumeration value="MNTH"/> + <xs:enumeration value="QURT"/> + <xs:enumeration value="MIAN"/> + <xs:enumeration value="WEEK"/> + <xs:enumeration value="DAIL"/> + <xs:enumeration value="ADHO"/> + <xs:enumeration value="INDA"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="GenericAccountIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max34Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericFinancialIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericOrganisationIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GenericPersonIdentification1"> + <xs:sequence> + <xs:element name="Id" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GroupHeader39"> + <xs:sequence> + <xs:element name="MsgId" type="Max35Text"/> + <xs:element name="CreDtTm" type="ISODateTime"/> + <xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/> + <xs:element name="NbOfTxs" type="Max15NumericText"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> + <xs:element name="InitgPty" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification4"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="IBAN2007Identifier"> + <xs:restriction base="xs:string"> + <xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="ISODate"> + <xs:restriction base="xs:date"/> + </xs:simpleType> + <xs:simpleType name="ISODateTime"> + <xs:restriction base="xs:dateTime"/> + </xs:simpleType> + <xs:complexType name="LocalInstrument2Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalLocalInstrument1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="MandateRelatedInformation6"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="MndtId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="DtOfSgntr" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="AmdmntInd" type="TrueFalseIndicator"/> + <xs:element maxOccurs="1" minOccurs="0" name="AmdmntInfDtls" type="AmendmentInformationDetails6"/> + <xs:element maxOccurs="1" minOccurs="0" name="ElctrncSgntr" type="Max1025Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="FrstColltnDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="FnlColltnDt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="Frqcy" type="Frequency1Code"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Max1025Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="1025"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max10Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="10"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max128Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="128"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max140Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="140"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max15NumericText"> + <xs:restriction base="xs:string"> + <xs:pattern value="[0-9]{1,15}"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max16Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="16"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max2048Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="2048"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max34Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="34"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max35Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="35"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max4Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="4"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Max70Text"> + <xs:restriction base="xs:string"> + <xs:minLength value="1"/> + <xs:maxLength value="70"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="NameAndAddress10"> + <xs:sequence> + <xs:element name="Nm" type="Max140Text"/> + <xs:element name="Adr" type="PostalAddress6"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="NamePrefix1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="DOCT"/> + <xs:enumeration value="MIST"/> + <xs:enumeration value="MISS"/> + <xs:enumeration value="MADM"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="Number"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="0"/> + <xs:totalDigits value="18"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="OrganisationIdentification4"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="BICOrBEI" type="AnyBICIdentifier"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="OrganisationIdentificationSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="Party6Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="OrgId" type="OrganisationIdentification4"/> + <xs:element name="PrvtId" type="PersonIdentification5"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PartyIdentification32"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> + <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party6Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PaymentIdentification1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/> + <xs:element name="EndToEndId" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PaymentInstructionInformation4"> + <xs:sequence> + <xs:element name="PmtInfId" type="Max35Text"/> + <xs:element name="PmtMtd" type="PaymentMethod2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/> + <xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> + <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation20"/> + <xs:element name="ReqdColltnDt" type="ISODate"/> + <xs:element name="Cdtr" type="PartyIdentification32"/> + <xs:element name="CdtrAcct" type="CashAccount16"/> + <xs:element name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount16"/> + <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification4"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrSchmeId" type="PartyIdentification32"/> + <xs:element maxOccurs="unbounded" minOccurs="1" name="DrctDbtTxInf" type="DirectDebitTransactionInformation9"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="PaymentMethod2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="DD"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PaymentTypeInformation20"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="SeqTp" type="SequenceType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="PercentageRate"> + <xs:restriction base="xs:decimal"> + <xs:fractionDigits value="10"/> + <xs:totalDigits value="11"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PersonIdentification5"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PersonIdentificationSchemeName1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalPersonIdentification1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="PhoneNumber"> + <xs:restriction base="xs:string"> + <xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PostalAddress6"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> + <xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="Priority2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="HIGH"/> + <xs:enumeration value="NORM"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Purpose2Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalPurpose1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ReferredDocumentInformation3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ReferredDocumentType1Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="DocumentType5Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="ReferredDocumentType2"> + <xs:sequence> + <xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/> + <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RegulatoryAuthority2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RegulatoryReporting3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="RegulatoryReportingType1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="CRED"/> + <xs:enumeration value="DEBT"/> + <xs:enumeration value="BOTH"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="RemittanceAmount1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="DscntApldAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RemittanceInformation5"> + <xs:sequence> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation7"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="RemittanceLocation2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="RemittanceLocationMethod2Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="FAXI"/> + <xs:enumeration value="EDIC"/> + <xs:enumeration value="URID"/> + <xs:enumeration value="EMAL"/> + <xs:enumeration value="POST"/> + <xs:enumeration value="SMSM"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="SequenceType1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="FRST"/> + <xs:enumeration value="RCUR"/> + <xs:enumeration value="FNAL"/> + <xs:enumeration value="OOFF"/> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="ServiceLevel8Choice"> + <xs:sequence> + <xs:choice> + <xs:element name="Cd" type="ExternalServiceLevel1Code"/> + <xs:element name="Prtry" type="Max35Text"/> + </xs:choice> + </xs:sequence> + </xs:complexType> + <xs:complexType name="StructuredRegulatoryReporting3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> + <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="StructuredRemittanceInformation7"> + <xs:sequence> + <xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/> + <xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount1"/> + <xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/> + <xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification32"/> + <xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification32"/> + <xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxAmount1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxAuthorisation1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxInformation3"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/> + <xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/> + <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/> + <xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxParty1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxParty2"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxPeriod1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/> + <xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxRecord1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/> + <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/> + <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/> + <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/> + </xs:sequence> + </xs:complexType> + <xs:complexType name="TaxRecordDetails1"> + <xs:sequence> + <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/> + <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> + </xs:sequence> + </xs:complexType> + <xs:simpleType name="TaxRecordPeriod1Code"> + <xs:restriction base="xs:string"> + <xs:enumeration value="MM01"/> + <xs:enumeration value="MM02"/> + <xs:enumeration value="MM03"/> + <xs:enumeration value="MM04"/> + <xs:enumeration value="MM05"/> + <xs:enumeration value="MM06"/> + <xs:enumeration value="MM07"/> + <xs:enumeration value="MM08"/> + <xs:enumeration value="MM09"/> + <xs:enumeration value="MM10"/> + <xs:enumeration value="MM11"/> + <xs:enumeration value="MM12"/> + <xs:enumeration value="QTR1"/> + <xs:enumeration value="QTR2"/> + <xs:enumeration value="QTR3"/> + <xs:enumeration value="QTR4"/> + <xs:enumeration value="HLF1"/> + <xs:enumeration value="HLF2"/> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="TrueFalseIndicator"> + <xs:restriction base="xs:boolean"/> + </xs:simpleType> +</xs:schema> diff --git a/dev/resources/sepa/text.txt b/dev/resources/sepa/text.txt new file mode 100644 index 00000000000..0a5336a128e --- /dev/null +++ b/dev/resources/sepa/text.txt @@ -0,0 +1,2 @@ +To test a SEPA file: +http://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa \ No newline at end of file From c44207f7d36279cce6483cd9fe8b86930c8a21d0 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <charles.fr@benke.fr> Date: Sat, 14 Oct 2017 12:39:39 +0200 Subject: [PATCH 1125/1137] template file not only odt/ods --- htdocs/core/lib/functions2.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 3d2e2bb359b..044a885aded 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1606,7 +1606,8 @@ function getListOfModels($db,$type,$maxfilenamelength=0) if (! $tmpdir) { unset($listofdir[$key]); continue; } if (is_dir($tmpdir)) { - $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0); + // all type of template is allowed + $tmpfiles=dol_dir_list($tmpdir, 'files', 0, '', '', 'name', SORT_ASC, 0); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); } } From 75835dd7fd99f322b703b77d05e9cd2bb11343d3 Mon Sep 17 00:00:00 2001 From: Papoteur <papoteur@mageia.org> Date: Sun, 15 Oct 2017 13:33:48 +0200 Subject: [PATCH 1126/1137] Add Autofill button for amount to pay in charge payment page --- htdocs/compta/paiement_charge.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 398f70ad36a..95426b824a1 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -169,6 +169,20 @@ if ($action == 'create') $charge->paiementtype=$charge->mode_reglement_id?$charge->mode_reglement_id:$charge->paiementtype; $total = $charge->amount; + if (! empty($conf->use_javascript_ajax)) + { + print "\n".'<script type="text/javascript" language="javascript">'; + + //Add js for AutoFill + print ' $(document).ready(function () {'; + print ' $(".AutoFillAmount").on(\'click touchstart\', function(){ + var amount = $(this).data("value"); + document.getElementById($(this).data(\'rowid\')).value = amount ; + });'; + print ' });'."\n"; + + print ' </script>'."\n"; + } print load_fiche_titre($langs->trans("DoPayment")); print "<br>\n"; @@ -294,7 +308,12 @@ if ($action == 'create') if ($sumpaid < $objp->amount) { $namef = "amount_".$objp->id; - print '<input type="text" size="8" name="'.$namef.'">'; + $nameRemain = "remain_".$objp->id; + if (!empty($conf->use_javascript_ajax)) + print img_picto("Auto fill",'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); + $remaintopay=$objp->amount - $sumpaid; + print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">'; + print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">'; } else { From bd5bffa72c21c7e2a2dcd3d0aa2aceda8afe36f8 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> Date: Mon, 16 Oct 2017 06:47:05 +0000 Subject: [PATCH 1127/1137] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/accountancy/class/lettering.class.php | 14 +- .../admin/dolistore/class/dolistore.class.php | 536 ++-- htdocs/admin/mails_senderprofile_list.php | 414 +-- htdocs/collab/index.php | 500 ++-- htdocs/commande/card.php | 494 ++-- htdocs/compta/facture/card.php | 1222 ++++----- htdocs/compta/facture/fiche-rec.php | 1534 +++++------ htdocs/contrat/card.php | 2440 ++++++++-------- .../core/class/emailsenderprofile.class.php | 20 +- htdocs/core/class/html.formfile.class.php | 2442 ++++++++--------- htdocs/core/class/html.formmail.class.php | 1102 ++++---- .../class/expensereport_rule.class.php | 22 +- htdocs/fourn/commande/card.php | 1634 +++++------ htdocs/fourn/facture/card.php | 2004 +++++++------- htdocs/main.inc.php | 2436 ++++++++-------- htdocs/societe/rib.php | 236 +- htdocs/supplier_proposal/card.php | 424 +-- htdocs/websites/index.php | 2 +- scripts/emailings/mailing-send.php | 94 +- 19 files changed, 8785 insertions(+), 8785 deletions(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index f3d9359b19d..423a3e54b02 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -33,12 +33,12 @@ include_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; */ class lettering extends BookKeeping { - /** - * lettrageTiers - * - * @param int $socid Thirdparty id - * @return int <0 if KO, >0 if OK - */ + /** + * lettrageTiers + * + * @param int $socid Thirdparty id + * @return int <0 if KO, >0 if OK + */ public function lettrageTiers($socid) { $db = $this->db; @@ -121,7 +121,7 @@ class lettering extends BookKeeping /** Prise en charge des lettering complexe avec prelevment , virement - */ + */ $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.date_lettering, bu.url_id , bu.type "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) "; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 84ec9457532..07dbec4b902 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -25,119 +25,119 @@ include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class */ class Dolistore { - // params - public $start; // beginning of pagination - public $end; // end of pagination - public $per_page; // pagination: display per page - public $categorie; // the current categorie - public $search; // the search keywords + // params + public $start; // beginning of pagination + public $end; // end of pagination + public $per_page; // pagination: display per page + public $categorie; // the current categorie + public $search; // the search keywords - // setups - public $url; // the url of this page - public $shop_url; // the url of the shop - public $vat_rate; // the vat rate used in the shop (prices are provided without vat) - public $lang; // the integer representing the lang in the store - public $debug_api; // usefull if no dialog + // setups + public $url; // the url of this page + public $shop_url; // the url of the shop + public $vat_rate; // the vat rate used in the shop (prices are provided without vat) + public $lang; // the integer representing the lang in the store + public $debug_api; // usefull if no dialog - /** - * Constructor - */ - function __construct() - { - global $conf, $langs; + /** + * Constructor + */ + function __construct() + { + global $conf, $langs; - $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; - $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; - $this->vat_rate = 1.2; // 20% de TVA - $this->debug_api = false; + $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; + $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; + $this->vat_rate = 1.2; // 20% de TVA + $this->debug_api = false; - $langtmp = explode('_', $langs->defaultlang); - $lang = $langtmp[0]; - $lang_array = array('en'=>0, 'fr'=>1, 'es'=>2, 'it'=>3, 'de'=>4); // Into table ps_lang of Prestashop - 1 - if (! in_array($lang, array_keys($lang_array))) $lang = 'en'; - $this->lang = $lang_array[$lang]; - } + $langtmp = explode('_', $langs->defaultlang); + $lang = $langtmp[0]; + $lang_array = array('en'=>0, 'fr'=>1, 'es'=>2, 'it'=>3, 'de'=>4); // Into table ps_lang of Prestashop - 1 + if (! in_array($lang, array_keys($lang_array))) $lang = 'en'; + $this->lang = $lang_array[$lang]; + } - /** - * Load data from remote Dolistore market place. - * This fills ->categories - * - * @param array $options Options - * @return void - */ - function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) - { - global $conf, $langs; + /** + * Load data from remote Dolistore market place. + * This fills ->categories + * + * @param array $options Options + * @return void + */ + function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) + { + global $conf, $langs; - $this->start = $options['start']; - $this->end = $options['end']; - $this->per_page = $options['per_page']; - $this->categorie = $options['categorie']; - $this->search = $options['search']; + $this->start = $options['start']; + $this->end = $options['end']; + $this->per_page = $options['per_page']; + $this->categorie = $options['categorie']; + $this->search = $options['search']; - if ($this->end == 0) { - $this->end = $this->per_page; - } + if ($this->end == 0) { + $this->end = $this->per_page; + } - try { - $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); + try { + $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); - // Here we set the option array for the Webservice : we want products resources - $opt = array(); - $opt['resource'] = 'products'; + // Here we set the option array for the Webservice : we want products resources + $opt = array(); + $opt['resource'] = 'products'; - // make a search to limit the id returned. - if ($this->search != '') { - $opt2 = array(); - $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; - // Call - $xml = $this->api->get($opt2); - $products = array(); - foreach ($xml->products->children() as $product) { - $products[] = (int) $product['id']; - } - $opt['filter[id]'] = '['.implode('|', $products).']'; - } elseif ($this->categorie != 0) { - $opt2 = array(); - $opt2['resource'] = 'categories'; - $opt2['id'] = $this->categorie; - // Call - $xml = $this->api->get($opt2); - $products = array(); - foreach ($xml->category->associations->products->children() as $product) { - $products[] = (int) $product->id; - } - $opt['filter[id]'] = '['.implode('|', $products).']'; - } - $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; - $opt['sort'] = 'id_desc'; - $opt['filter[active]'] = '[1]'; - $opt['limit'] = "$this->start,$this->end"; + // make a search to limit the id returned. + if ($this->search != '') { + $opt2 = array(); + $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->products->children() as $product) { + $products[] = (int) $product['id']; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } elseif ($this->categorie != 0) { + $opt2 = array(); + $opt2['resource'] = 'categories'; + $opt2['id'] = $this->categorie; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->category->associations->products->children() as $product) { + $products[] = (int) $product->id; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } + $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; + $opt['sort'] = 'id_desc'; + $opt['filter[active]'] = '[1]'; + $opt['limit'] = "$this->start,$this->end"; // $opt['filter[id]'] contais list of product id that are result of search - // Call API to get the detail - $xml = $this->api->get($opt); - $this->products = $xml->products->children(); + // Call API to get the detail + $xml = $this->api->get($opt); + $this->products = $xml->products->children(); - // Here we set the option array for the Webservice : we want categories resources - $opt = array(); - $opt['resource'] = 'categories'; - $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; - $opt['sort'] = 'id_asc'; - // Call - $xml = $this->api->get($opt); - $this->categories = $xml->categories->children(); - } catch (PrestaShopWebserviceException $e) { - // Here we are dealing with errors - $trace = $e->getTrace(); - if ($trace[0]['args'][0] == 404) die('Bad ID'); - else if ($trace[0]['args'][0] == 401) die('Bad auth key'); - else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); - } - } + // Here we set the option array for the Webservice : we want categories resources + $opt = array(); + $opt['resource'] = 'categories'; + $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; + $opt['sort'] = 'id_asc'; + // Call + $xml = $this->api->get($opt); + $this->categories = $xml->categories->children(); + } catch (PrestaShopWebserviceException $e) { + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + else if ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); + } + } /** * Return tree of Dolistore categories. $this->categories must have been loaded before. @@ -145,199 +145,199 @@ class Dolistore * @param int $parent Id of parent category * @return string */ - function get_categories($parent = 0) - { - if (!isset($this->categories)) die('not possible'); - if ($parent != 0) { - $html = '<ul>'; - } else { - $html = ''; - } + function get_categories($parent = 0) + { + if (!isset($this->categories)) die('not possible'); + if ($parent != 0) { + $html = '<ul>'; + } else { + $html = ''; + } - $nbofcateg = count($this->categories); - for ($i = 0; $i < $nbofcateg; $i++) - { - $cat = $this->categories[$i]; - if ($cat->is_root_category == 1 && $parent == 0) { - $html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ' - .'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'"' - .'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>'; - $html .= self::get_categories($cat->id); - $html .= "</li>\n"; - } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau - $select = ($cat->id == $this->categorie) ? ' selected' : ''; - $html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"' - .' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'" ' - .'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a>'; - $html .= self::get_categories($cat->id); - $html .= "</li>\n"; - } else { + $nbofcateg = count($this->categories); + for ($i = 0; $i < $nbofcateg; $i++) + { + $cat = $this->categories[$i]; + if ($cat->is_root_category == 1 && $parent == 0) { + $html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ' + .'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'"' + .'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>'; + $html .= self::get_categories($cat->id); + $html .= "</li>\n"; + } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau + $select = ($cat->id == $this->categorie) ? ' selected' : ''; + $html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"' + .' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'" ' + .'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a>'; + $html .= self::get_categories($cat->id); + $html .= "</li>\n"; + } else { - } - } + } + } - if ($html == '<ul>') { - return ''; - } - if ($parent != 0) { - return $html.'</ul>'; - } else { - return $html; - } - } + if ($html == '<ul>') { + return ''; + } + if ($parent != 0) { + return $html.'</ul>'; + } else { + return $html; + } + } - /** - * Return list of product formated for output - * - * @return string HTML output - */ - function get_products() - { - global $langs, $conf; - $html = ""; - $parity = "pair"; - $last_month = time() - (30 * 24 * 60 * 60); - foreach ($this->products as $product) { - $parity = ($parity == "impair") ? 'pair' : 'impair'; + /** + * Return list of product formated for output + * + * @return string HTML output + */ + function get_products() + { + global $langs, $conf; + $html = ""; + $parity = "pair"; + $last_month = time() - (30 * 24 * 60 * 60); + foreach ($this->products as $product) { + $parity = ($parity == "impair") ? 'pair' : 'impair'; - // check new product ? - $newapp = ''; - if ($last_month < strtotime($product->date_add)) { - $newapp .= '<span class="newApp">'.$langs->trans('New').'</span> '; - } + // check new product ? + $newapp = ''; + if ($last_month < strtotime($product->date_add)) { + $newapp .= '<span class="newApp">'.$langs->trans('New').'</span> '; + } - // check updated ? - if ($last_month < strtotime($product->date_upd) && $newapp == '') { - $newapp .= '<span class="updatedApp">'.$langs->trans('Updated').'</span> '; - } + // check updated ? + if ($last_month < strtotime($product->date_upd) && $newapp == '') { + $newapp .= '<span class="updatedApp">'.$langs->trans('Updated').'</span> '; + } - // add image or default ? - if ($product->id_default_image != '') { - $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image; - $images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'. - '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>'; - } else { - $images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />'; - } + // add image or default ? + if ($product->id_default_image != '') { + $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image; + $images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'. + '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>'; + } else { + $images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />'; + } - // free or pay ? - if ($product->price > 0) { - $price = '<h3>'.price(round((float) $product->price * $this->vat_rate, 2)).' €</h3>'; - $download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; - } else { - $price = '<h3>'.$langs->trans('Free').'</h3>'; - $download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>'; - $download_link.= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; - } + // free or pay ? + if ($product->price > 0) { + $price = '<h3>'.price(round((float) $product->price * $this->vat_rate, 2)).' €</h3>'; + $download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; + } else { + $price = '<h3>'.$langs->trans('Free').'</h3>'; + $download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>'; + $download_link.= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>'; + } - //checking versions - if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { - if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { - //compatible - $version = '<span class="compatible">'.$langs->trans('CompatibleUpTo', $product->dolibarr_max, - $product->dolibarr_min, $product->dolibarr_max).'</span>'; - $compatible = ''; - } else { - //never compatible, module expired - $version = '<span class="notcompatible">'.$langs->trans('NotCompatible', DOL_VERSION, - $product->dolibarr_min, $product->dolibarr_max).'</span>'; - $compatible = 'NotCompatible'; - } - } else { - //need update - $version = '<span class="compatibleafterupdate">'.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, - $product->dolibarr_min, $product->dolibarr_max).'</span>'; - $compatible = 'NotCompatible'; - } + //checking versions + if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) { + if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) { + //compatible + $version = '<span class="compatible">'.$langs->trans('CompatibleUpTo', $product->dolibarr_max, + $product->dolibarr_min, $product->dolibarr_max).'</span>'; + $compatible = ''; + } else { + //never compatible, module expired + $version = '<span class="notcompatible">'.$langs->trans('NotCompatible', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).'</span>'; + $compatible = 'NotCompatible'; + } + } else { + //need update + $version = '<span class="compatibleafterupdate">'.$langs->trans('CompatibleAfterUpdate', DOL_VERSION, + $product->dolibarr_min, $product->dolibarr_max).'</span>'; + $compatible = 'NotCompatible'; + } - //.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a> + //.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a> - //output template - $html .= '<tr class="app '.$parity.' '.$compatible.'"> + //output template + $html .= '<tr class="app '.$parity.' '.$compatible.'"> <td align="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td> <td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang] - .'<br/><small>'.$version.'</small></h2> + .'<br/><small>'.$version.'</small></h2> <small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang].'</td> <td style="display:none;" class="long_description">'.$product->description->language[$this->lang].'</td> <td class="margeCote" align="center">'.$price.' </td> <td class="margeCote">'.$download_link.'</td> </tr>'; - } - return $html; - } + } + return $html; + } - function get_previous_link($text = '<<') - { - return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>'; - } + function get_previous_link($text = '<<') + { + return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>'; + } - function get_next_link($text = '>>') - { - return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>'; - } + function get_next_link($text = '>>') + { + return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>'; + } - function get_previous_url() - { - $param_array = array(); - if ($this->start < $this->per_page) { - $sub = 0; - } else { - $sub = $this->per_page; - } - $param_array['start'] = $this->start - $sub; - $param_array['end'] = $this->end - $sub; - if ($this->categorie != 0) { - $param_array['categorie'] = $this->categorie; - } - $param = http_build_query($param_array); - return $this->url."&".$param; - } + function get_previous_url() + { + $param_array = array(); + if ($this->start < $this->per_page) { + $sub = 0; + } else { + $sub = $this->per_page; + } + $param_array['start'] = $this->start - $sub; + $param_array['end'] = $this->end - $sub; + if ($this->categorie != 0) { + $param_array['categorie'] = $this->categorie; + } + $param = http_build_query($param_array); + return $this->url."&".$param; + } - function get_next_url() - { - $param_array = array(); - if (count($this->products) < $this->per_page) { - $add = 0; - } else { - $add = $this->per_page; - } - $param_array['start'] = $this->start + $add; - $param_array['end'] = $this->end + $add; - if ($this->categorie != 0) { - $param_array['categorie'] = $this->categorie; - } - $param = http_build_query($param_array); - return $this->url."&".$param; - } + function get_next_url() + { + $param_array = array(); + if (count($this->products) < $this->per_page) { + $add = 0; + } else { + $add = $this->per_page; + } + $param_array['start'] = $this->start + $add; + $param_array['end'] = $this->end + $add; + if ($this->categorie != 0) { + $param_array['categorie'] = $this->categorie; + } + $param = http_build_query($param_array); + return $this->url."&".$param; + } - function version_compare($v1, $v2) - { - $v1 = explode('.', $v1); - $v2 = explode('.', $v2); - $ret = 0; - $level = 0; - $count1 = count($v1); - $count2 = count($v2); - $maxcount = max($count1, $count2); - while ($level < $maxcount) { - $operande1 = isset($v1[$level]) ? $v1[$level] : 'x'; - $operande2 = isset($v2[$level]) ? $v2[$level] : 'x'; - $level++; - if (strtoupper($operande1) == 'X' || strtoupper($operande2) == 'X' || $operande1 == '*' || $operande2 == '*') { - break; - } - if ($operande1 < $operande2) { - $ret = -$level; - break; - } - if ($operande1 > $operande2) { - $ret = $level; - break; - } - } - //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'<br>'."\n"; - return $ret; - } + function version_compare($v1, $v2) + { + $v1 = explode('.', $v1); + $v2 = explode('.', $v2); + $ret = 0; + $level = 0; + $count1 = count($v1); + $count2 = count($v2); + $maxcount = max($count1, $count2); + while ($level < $maxcount) { + $operande1 = isset($v1[$level]) ? $v1[$level] : 'x'; + $operande2 = isset($v2[$level]) ? $v2[$level] : 'x'; + $level++; + if (strtoupper($operande1) == 'X' || strtoupper($operande2) == 'X' || $operande1 == '*' || $operande2 == '*') { + break; + } + if ($operande1 < $operande2) { + $ret = -$level; + break; + } + if ($operande1 > $operande2) { + $ret = $level; + break; + } + } + //print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'<br>'."\n"; + return $ret; + } } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 91f0a3a8037..2190705ea8b 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -85,7 +85,7 @@ if (! $sortorder) $sortorder="ASC"; $socid=0; if ($user->societe_id > 0) { - //$socid = $user->societe_id; + //$socid = $user->societe_id; accessforbidden(); } @@ -94,14 +94,14 @@ $search_all=trim(GETPOST("search_all",'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); } // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach($object->fields as $key => $val) { - if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; + if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label']; } // Definition of fields for list @@ -109,15 +109,15 @@ $arrayfields=array(); foreach($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field - if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); + if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']); } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } } @@ -136,32 +136,32 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers - { - foreach($object->fields as $key => $val) - { - $search[$key]=''; - } - $toselect=''; - $search_array_options=array(); - } - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') - || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) - { - $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation - } + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + foreach($object->fields as $key => $val) + { + $search[$key]=''; + } + $toselect=''; + $search_array_options=array(); + } + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') + || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + { + $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } - // Mass actions - $objectclass='EmailSenderProfile'; - $objectlabel='EmailSenderProfile'; - $permtoread = $user->admin; - $permtodelete = $user->admin; - $uploaddir = $conf->admin->dir_output.'/senderprofiles'; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + // Mass actions + $objectclass='EmailSenderProfile'; + $objectlabel='EmailSenderProfile'; + $permtoread = $user->admin; + $permtodelete = $user->admin; + $uploaddir = $conf->admin->dir_output.'/senderprofiles'; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -196,7 +196,7 @@ dol_fiche_head($head, 'senderprofiles', '', -1); $sql = 'SELECT '; foreach($object->fields as $key => $val) { - $sql.='t.'.$key.', '; + $sql.='t.'.$key.', '; } // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); @@ -217,16 +217,16 @@ if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_a // Add where from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $typ=$extrafields->attribute_type[$tmpkey]; - $mode_search=0; - if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric - if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int - if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) - { - $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); - } + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode_search=0; + if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric + if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int + if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0')) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode_search); + } } // Add where from hooks $parameters=array(); @@ -263,8 +263,8 @@ dol_syslog($script_file, LOG_DEBUG); $resql=$db->query($sql); if (! $resql) { - dol_print_error($db); - exit; + dol_print_error($db); + exit; } $num = $db->num_rows($resql); @@ -272,10 +272,10 @@ $num = $db->num_rows($resql); // Direct jump if only one record found if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id); - exit; + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id); + exit; } @@ -301,21 +301,21 @@ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&con if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); foreach($search as $key => $val) { - $param.= '&search_'.$key.'='.urlencode($search[$key]); + $param.= '&search_'.$key.'='.urlencode($search[$key]); } if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields foreach ($search_array_options as $key => $val) { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->monmodule->delete) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); @@ -347,7 +347,7 @@ if (! empty($moreforfilter)) { print '<div class="liste_titre liste_titre_bydiv centpercent">'; print $moreforfilter; - print '</div>'; + print '</div>'; } $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; @@ -363,35 +363,35 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"") print '<tr class="liste_titre">'; foreach($object->fields as $key => $val) { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>'; + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>'; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); - $typeofextrafield=$extrafields->attribute_type[$key]; - print '<td class="liste_titre'.($align?' '.$align:'').'">'; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) - { - $crit=$val; - $tmpkey=preg_replace('/search_options_/','',$key); - $searchclass=''; - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; - if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; - print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; - } - print '</td>'; - } - } + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print '<td class="liste_titre'.($align?' '.$align:'').'">'; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key])) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">'; + } + print '</td>'; + } + } } // Fields from hook $parameters=array('arrayfields'=>$arrayfields); @@ -400,12 +400,12 @@ print $hookmanager->resPrint; // Rest of fields search foreach($object->fields as $key => $val) { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>'; + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>'; } // Action column print '<td class="liste_titre" align="right">'; @@ -420,25 +420,25 @@ print '</tr>'."\n"; print '<tr class="liste_titre">'; foreach($object->fields as $key => $val) { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) { - if (! empty($arrayfields["ef.".$key]['checked'])) - { + if (! empty($arrayfields["ef.".$key]['checked'])) + { $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; print getTitleFieldOfList($langs->trans($extralabels[$key]), 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder)."\n"; - } + } } } // Hook fields @@ -448,12 +448,12 @@ print $hookmanager->resPrint; // Rest of fields title foreach($object->fields as $key => $val) { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.=' nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n"; } print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; print '</tr>'."\n"; @@ -463,7 +463,7 @@ print '</tr>'."\n"; $needToFetchEachLine=0; foreach ($extrafields->attribute_computed as $key => $val) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object } @@ -473,42 +473,42 @@ $i=0; $totalarray=array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); - if (empty($obj)) break; // Should not happen + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen - // Store properties in $object + // Store properties in $object $object->id = $obj->rowid; foreach($object->fields as $key => $val) { if (isset($obj->$key)) $object->$key = $obj->$key; } - // Show here line of result - print '<tr class="oddeven">'; - foreach($object->fields as $key => $val) - { - if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; - if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) - { - print '<td'.($align?' class="'.$align.'"':'').'>'; - if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); - elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1); - elseif ($key == 'status') print $object->getLibStatut(3); - else print $obj->$key; - print '</td>'; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) - { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; - $totalarray['val']['t.'.$key] += $obj->$key; - } - } - } - // Extra fields + // Show here line of result + print '<tr class="oddeven">'; + foreach($object->fields as $key => $val) + { + if (in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align='center'; + if (in_array($val['type'], array('timestamp'))) $align.='nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print '<td'.($align?' class="'.$align.'"':'').'>'; + if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print '</td>'; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) @@ -522,86 +522,86 @@ while ($i < min($num, $limit)) $tmpkey='options_'.$key; print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print '</td>'; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) - { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; - $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; - } + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; + $totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey; + } } } } - // Fields from hook + // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Rest of fields - foreach($object->fields as $key => $val) - { - if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; - $align=''; - if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; - if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; - if ($key == 'status') $align.=($align?' ':'').'center'; - if (! empty($arrayfields['t.'.$key]['checked'])) - { - print '<td'.($align?' class="'.$align.'"':'').'>'; - if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); - elseif ($key == 'status') print $object->getLibStatut(3); - else print $obj->$key; - print '</td>'; - if (! $i) $totalarray['nbfield']++; - if (! empty($val['isameasure'])) - { - if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; - $totalarray['val']['t.'.$key] += $obj->$key; - } - } - } - // Action column - print '<td class="nowrap" align="center">'; + print $hookmanager->resPrint; + // Rest of fields + foreach($object->fields as $key => $val) + { + if (! in_array($key, array('date_creation', 'tms', 'import_key', 'status'))) continue; + $align=''; + if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center'; + if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap'; + if ($key == 'status') $align.=($align?' ':'').'center'; + if (! empty($arrayfields['t.'.$key]['checked'])) + { + print '<td'.($align?' class="'.$align.'"':'').'>'; + if (in_array($val['type'], array('date','datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour'); + elseif ($key == 'status') print $object->getLibStatut(3); + else print $obj->$key; + print '</td>'; + if (! $i) $totalarray['nbfield']++; + if (! empty($val['isameasure'])) + { + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key; + $totalarray['val']['t.'.$key] += $obj->$key; + } + } + } + // Action column + print '<td class="nowrap" align="center">'; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; + { + $selected=0; if (in_array($obj->rowid, $arrayofselected)) $selected=1; print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>'; - } + } print '</td>'; - if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['nbfield']++; - print '</tr>'; + print '</tr>'; - $i++; + $i++; } // Show total line if (isset($totalarray['pos'])) { - print '<tr class="liste_total">'; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>'; - else - { - if ($i == 1) - { - if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>'; - else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>'; - } - else print '<td></td>'; - } - } - print '</tr>'; + print '<tr class="liste_total">'; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>'; + else + { + if ($i == 1) + { + if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>'; + else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>'; + } + else print '<td></td>'; + } + } + print '</tr>'; } // If no record found if ($num == 0) { - $colspan=1; - foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } - print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>'; + $colspan=1; + foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; } + print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>'; } @@ -618,25 +618,25 @@ print '</form>'."\n"; if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) - { - require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); - $formfile = new FormFile($db); + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) + { + require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); + $formfile = new FormFile($db); - // Show list of available documents - $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + // Show list of available documents + $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource.=str_replace('&','&',$param); - $filedir=$diroutputmassaction; - $genallowed=$user->rights->monmodule->read; - $delallowed=$user->rights->monmodule->read; + $filedir=$diroutputmassaction; + $genallowed=$user->rights->monmodule->read; + $delallowed=$user->rights->monmodule->read; - print $formfile->showdocuments('massfilesarea_monmodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); - } - else - { - print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>'; - } + print $formfile->showdocuments('massfilesarea_monmodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + } + else + { + print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>'; + } } dol_fiche_end(); diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index 3cba48cfc07..bcc12c0a341 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden(); if (! ((GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { - $conf->dol_hide_leftmenu = 1; // Force hide of left menu. + $conf->dol_hide_leftmenu = 1; // Force hide of left menu. } $error=0; @@ -71,33 +71,33 @@ if (GETPOST('refreshpage')) $action='preview'; // Add a collab page if ($action == 'add') { - $db->begin(); + $db->begin(); - $objectpage->title = GETPOST('WEBSITE_TITLE'); - $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME'); - $objectpage->description = GETPOST('WEBSITE_DESCRIPTION'); - $objectpage->keywords = GETPOST('WEBSITE_KEYWORD'); + $objectpage->title = GETPOST('WEBSITE_TITLE'); + $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME'); + $objectpage->description = GETPOST('WEBSITE_DESCRIPTION'); + $objectpage->keywords = GETPOST('WEBSITE_KEYWORD'); - if (empty($objectpage->title)) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WEBSITE_PAGENAME")), null, 'errors'); - $error++; - } + if (empty($objectpage->title)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WEBSITE_PAGENAME")), null, 'errors'); + $error++; + } - if (! $error) - { - $res = $objectpage->create($user); - if ($res <= 0) - { - $error++; - setEventMessages($objectpage->error, $objectpage->errors, 'errors'); - } - } + if (! $error) + { + $res = $objectpage->create($user); + if ($res <= 0) + { + $error++; + setEventMessages($objectpage->error, $objectpage->errors, 'errors'); + } + } if (! $error) { $db->commit(); - setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs'); - $action=''; + setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs'); + $action=''; } else { @@ -111,38 +111,38 @@ if ($action == 'add') // Update page if ($action == 'delete') { - $db->begin(); + $db->begin(); - $res = $object->fetch(0, $website); + $res = $object->fetch(0, $website); - $res = $objectpage->fetch($pageid, $object->fk_website); + $res = $objectpage->fetch($pageid, $object->fk_website); - if ($res > 0) - { - $res = $objectpage->delete($user); - if (! $res > 0) - { - $error++; - setEventMessages($objectpage->error, $objectpage->errors, 'errors'); - } + if ($res > 0) + { + $res = $objectpage->delete($user); + if (! $res > 0) + { + $error++; + setEventMessages($objectpage->error, $objectpage->errors, 'errors'); + } - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans("PageDeleted", $objectpage->pageurl, $website), null, 'mesgs'); + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("PageDeleted", $objectpage->pageurl, $website), null, 'mesgs'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); - exit; - } - else - { - $db->rollback(); - } - } - else - { - dol_print_error($db); - } + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); + exit; + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db); + } } @@ -161,7 +161,7 @@ print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST"><div>'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; if ($action == 'create') { - print '<input type="hidden" name="action" value="add">'; + print '<input type="hidden" name="action" value="add">'; } @@ -174,225 +174,225 @@ print '<div class="centpercent websitebar">'; if (count($object->records) > 0) { - // ***** Part for web sites + // ***** Part for web sites - print '<div class="websiteselection hideonsmartphoneimp">'; - print $langs->trans("Website").': '; - print '</div>'; + print '<div class="websiteselection hideonsmartphoneimp">'; + print $langs->trans("Website").': '; + print '</div>'; - // List of websites - print '<div class="websiteselection">'; - $out=''; - $out.='<select name="website" class="minwidth100" id="website">'; - if (empty($object->records)) $out.='<option value="-1"> </option>'; - // Loop on each sites - $i=0; - foreach($object->records as $key => $valwebsite) - { - if (empty($website)) $website=$valwebsite->ref; + // List of websites + print '<div class="websiteselection">'; + $out=''; + $out.='<select name="website" class="minwidth100" id="website">'; + if (empty($object->records)) $out.='<option value="-1"> </option>'; + // Loop on each sites + $i=0; + foreach($object->records as $key => $valwebsite) + { + if (empty($website)) $website=$valwebsite->ref; - $out.='<option value="'.$valwebsite->ref.'"'; - if ($website == $valwebsite->ref) $out.=' selected'; // To preselect a value - $out.='>'; - $out.=$valwebsite->ref; - $out.='</option>'; - $i++; - } - $out.='</select>'; - $out.=ajax_combobox('website'); - print $out; - print '<input type="submit" class="button" name="refreshsite" value="'.$langs->trans("Load").'">'; + $out.='<option value="'.$valwebsite->ref.'"'; + if ($website == $valwebsite->ref) $out.=' selected'; // To preselect a value + $out.='>'; + $out.=$valwebsite->ref; + $out.='</option>'; + $i++; + } + $out.='</select>'; + $out.=ajax_combobox('website'); + print $out; + print '<input type="submit" class="button" name="refreshsite" value="'.$langs->trans("Load").'">'; - if ($website) - { - $virtualurl=''; - $dataroot=DOL_DATA_ROOT.'/websites/'.$website; - if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost; - } + if ($website) + { + $virtualurl=''; + $dataroot=DOL_DATA_ROOT.'/websites/'.$website; + if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost; + } - if ($website && $action == 'preview') - { - $disabled=''; - if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; + if ($website && $action == 'preview') + { + $disabled=''; + if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; - print '   '; + print '   '; - //print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="editmedia">'; - print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">'; - print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">'; - print '<input type="submit"'.$disabled.' class="button" value="'.dol_escape_htmltag($langs->trans("AddPage")).'" name="create">'; - } + //print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="editmedia">'; + print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">'; + print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">'; + print '<input type="submit"'.$disabled.' class="button" value="'.dol_escape_htmltag($langs->trans("AddPage")).'" name="create">'; + } - print '</div>'; + print '</div>'; - // Button for websites - print '<div class="websitetools">'; + // Button for websites + print '<div class="websitetools">'; - if ($action == 'preview') - { - print '<div class="websiteinputurl">'; - print '<input type="text" id="previewsiteurl" class="minwidth200imp" name="previewsite" placeholder="'.$langs->trans("http://myvirtualhost").'" value="'.$virtualurl.'">'; - //print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">'; - $htmltext=$langs->trans("SetHereVirtualHost", $dataroot); - print $form->textwithpicto('', $htmltext); - print '</div>'; + if ($action == 'preview') + { + print '<div class="websiteinputurl">'; + print '<input type="text" id="previewsiteurl" class="minwidth200imp" name="previewsite" placeholder="'.$langs->trans("http://myvirtualhost").'" value="'.$virtualurl.'">'; + //print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">'; + $htmltext=$langs->trans("SetHereVirtualHost", $dataroot); + print $form->textwithpicto('', $htmltext); + print '</div>'; - $urlext=$virtualurl; - $urlint=$urlwithroot.'/public/websites/index.php?website='.$website; - //if (! empty($object->virtualhost)) - //{ - print '<a class="websitebuttonsitepreview" id="previewsiteext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); - print '</a>'; - //} + $urlext=$virtualurl; + $urlint=$urlwithroot.'/public/websites/index.php?website='.$website; + //if (! empty($object->virtualhost)) + //{ + print '<a class="websitebuttonsitepreview" id="previewsiteext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); + print '</a>'; + //} - print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/websites/index.php?website='.$website.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview'); - print '</a>'; - } + print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/websites/index.php?website='.$website.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">'; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview'); + print '</a>'; + } - if (in_array($action, array('editcss','editmenu','create'))) - { - if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">'; - if (preg_match('/^create/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; - if (preg_match('/^edit/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; - } + if (in_array($action, array('editcss','editmenu','create'))) + { + if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">'; + if (preg_match('/^create/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; + if (preg_match('/^edit/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; + } - print '</div>'; + print '</div>'; - // ***** Part for pages + // ***** Part for pages - if ($website) - { - print '</div>'; + if ($website) + { + print '</div>'; - $array=$objectpage->fetchAll($object->id); - if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors); - $atleastonepage=(is_array($array) && count($array) > 0); + $array=$objectpage->fetchAll($object->id); + if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors); + $atleastonepage=(is_array($array) && count($array) > 0); - print '<div class="centpercent websitebar"'.($style?' style="'.$style.'"':'').'">'; - print '<div class="websiteselection hideonsmartphoneimp">'; - print $langs->trans("Page").': '; - print '</div>'; - print '<div class="websiteselection">'; + print '<div class="centpercent websitebar"'.($style?' style="'.$style.'"':'').'">'; + print '<div class="websiteselection hideonsmartphoneimp">'; + print $langs->trans("Page").': '; + print '</div>'; + print '<div class="websiteselection">'; - if ($action != 'add') - { - $out=''; - $out.='<select name="pageid" id="pageid" class="minwidth200">'; - if ($atleastonepage) - { - if (empty($pageid) && $action != 'create') // Page id is not defined, we try to take one - { - $firstpageid=0;$homepageid=0; - foreach($array as $key => $valpage) - { - if (empty($firstpageid)) $firstpageid=$valpage->id; - if ($object->fk_default_home && $key == $object->fk_default_home) $homepageid=$valpage->id; - } - $pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page - } + if ($action != 'add') + { + $out=''; + $out.='<select name="pageid" id="pageid" class="minwidth200">'; + if ($atleastonepage) + { + if (empty($pageid) && $action != 'create') // Page id is not defined, we try to take one + { + $firstpageid=0;$homepageid=0; + foreach($array as $key => $valpage) + { + if (empty($firstpageid)) $firstpageid=$valpage->id; + if ($object->fk_default_home && $key == $object->fk_default_home) $homepageid=$valpage->id; + } + $pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page + } - foreach($array as $key => $valpage) - { - $out.='<option value="'.$key.'"'; - if ($pageid > 0 && $pageid == $key) $out.=' selected'; // To preselect a value - $out.='>'; - $out.=$valpage->title; - if ($object->fk_default_home && $key == $object->fk_default_home) $out.=' ('.$langs->trans("HomePage").')'; - $out.='</option>'; - } - } - else $out.='<option value="-1"> </option>'; - $out.='</select>'; - $out.=ajax_combobox('pageid'); - print $out; - } - else - { - print $langs->trans("New"); - } + foreach($array as $key => $valpage) + { + $out.='<option value="'.$key.'"'; + if ($pageid > 0 && $pageid == $key) $out.=' selected'; // To preselect a value + $out.='>'; + $out.=$valpage->title; + if ($object->fk_default_home && $key == $object->fk_default_home) $out.=' ('.$langs->trans("HomePage").')'; + $out.='</option>'; + } + } + else $out.='<option value="-1"> </option>'; + $out.='</select>'; + $out.=ajax_combobox('pageid'); + print $out; + } + else + { + print $langs->trans("New"); + } - print '<input type="submit" class="button" name="refreshpage" value="'.$langs->trans("Load").'"'.($atleastonepage?'':' disabled="disabled"').'>'; - //print $form->selectarray('page', $array); + print '<input type="submit" class="button" name="refreshpage" value="'.$langs->trans("Load").'"'.($atleastonepage?'':' disabled="disabled"').'>'; + //print $form->selectarray('page', $array); - if ($action == 'preview') - { - $disabled=''; - if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; + if ($action == 'preview') + { + $disabled=''; + if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; - if ($pageid > 0) - { - print '   '; + if ($pageid > 0) + { + print '   '; - if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) print '<input type="submit" class="button" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; - else print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; - print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">'; - print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageContent")).'" name="editcontent">'; - //print '<a href="'.$_SERVER["PHP_SELF"].'?action=editmeta&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</a>'; - //print '<a href="'.$_SERVER["PHP_SELF"].'?action=editcontent&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageContent")).'</a>'; - print '<input type="submit" class="buttonDelete" name="delete" value="'.$langs->trans("Delete").'"'.($atleastonepage?'':' disabled="disabled"').'>'; - } - } + if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) print '<input type="submit" class="button" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; + else print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; + print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">'; + print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageContent")).'" name="editcontent">'; + //print '<a href="'.$_SERVER["PHP_SELF"].'?action=editmeta&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</a>'; + //print '<a href="'.$_SERVER["PHP_SELF"].'?action=editcontent&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageContent")).'</a>'; + print '<input type="submit" class="buttonDelete" name="delete" value="'.$langs->trans("Delete").'"'.($atleastonepage?'':' disabled="disabled"').'>'; + } + } - print '</div>'; - print '<div class="websiteselection">'; - print '</div>'; + print '</div>'; + print '<div class="websiteselection">'; + print '</div>'; - print '<div class="websitetools">'; + print '<div class="websitetools">'; - if ($website && $pageid > 0 && $action == 'preview') - { - $websitepage = new WebSitePage($db); - $websitepage->fetch($pageid); + if ($website && $pageid > 0 && $action == 'preview') + { + $websitepage = new WebSitePage($db); + $websitepage->fetch($pageid); - $realpage=$urlwithroot.'/public/websites/index.php?website='.$website.'&page='.$pageid; - $pagealias = $websitepage->pageurl; + $realpage=$urlwithroot.'/public/websites/index.php?website='.$website.'&page='.$pageid; + $pagealias = $websitepage->pageurl; - print '<div class="websiteinputurl">'; - print '<input type="text" id="previewpageurl" class="minwidth200imp" name="previewsite" value="'.$pagealias.'" disabled="disabled">'; - //print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">'; - $htmltext=$langs->trans("WEBSITE_PAGENAME", $pagealias); - print $form->textwithpicto('', $htmltext); - print '</div>'; + print '<div class="websiteinputurl">'; + print '<input type="text" id="previewpageurl" class="minwidth200imp" name="previewsite" value="'.$pagealias.'" disabled="disabled">'; + //print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">'; + $htmltext=$langs->trans("WEBSITE_PAGENAME", $pagealias); + print $form->textwithpicto('', $htmltext); + print '</div>'; - if (! empty($object->virtualhost)) - { - $urlext=$virtualurl.'/'.$pagealias.'.php'; - print '<a class="websitebuttonsitepreview" id="previewpageext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); - print '</a>'; - } - else - { - print '<a class="websitebuttonsitepreview" id="previewpageextnoclick" href="#">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); - print '</a>'; - } + if (! empty($object->virtualhost)) + { + $urlext=$virtualurl.'/'.$pagealias.'.php'; + print '<a class="websitebuttonsitepreview" id="previewpageext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext)).'">'; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); + print '</a>'; + } + else + { + print '<a class="websitebuttonsitepreview" id="previewpageextnoclick" href="#">'; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); + print '</a>'; + } - print '<a class="websitebuttonsitepreview" id="previewpage" href="'.$realpage.'&nocache='.dol_now().'" class="button" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview'); - print '</a>'; // View page in new Tab - //print '<input type="submit" class="button" name="previewpage" target="tab'.$website.'"value="'.$langs->trans("ViewPageInNewTab").'">'; + print '<a class="websitebuttonsitepreview" id="previewpage" href="'.$realpage.'&nocache='.dol_now().'" class="button" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">'; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview'); + print '</a>'; // View page in new Tab + //print '<input type="submit" class="button" name="previewpage" target="tab'.$website.'"value="'.$langs->trans("ViewPageInNewTab").'">'; - // TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext - } - if (! in_array($action, array('editcss','editmenu','create'))) - { - if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">'; - if (preg_match('/^create/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; - if (preg_match('/^edit/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; - } + // TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext + } + if (! in_array($action, array('editcss','editmenu','create'))) + { + if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">'; + if (preg_match('/^create/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; + if (preg_match('/^edit/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; + } - print '</div>'; + print '</div>'; - if ($action == 'preview') - { - // Adding jquery code to change on the fly url of preview ext - if (! empty($conf->use_javascript_ajax)) - { - print '<script type="text/javascript" language="javascript"> + if ($action == 'preview') + { + // Adding jquery code to change on the fly url of preview ext + if (! empty($conf->use_javascript_ajax)) + { + print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { jQuery("#previewsiteext,#previewpageext").click(function() { newurl=jQuery("#previewsiteurl").val(); @@ -417,17 +417,17 @@ if (count($object->records) > 0) }); }); </script>'; - } - } - } + } + } + } } else { - print '<div class="websiteselection">'; - $langs->load("errors"); - print $langs->trans("ErrorModuleSetupNotComplete"); - print '<div>'; - $action=''; + print '<div class="websiteselection">'; + $langs->load("errors"); + print $langs->trans("ErrorModuleSetupNotComplete"); + print '<div>'; + $action=''; } @@ -437,21 +437,21 @@ $head = array(); if ($action == 'editcontent') { - /* + /* * Editing global variables not related to a specific theme */ - $csscontent = @file_get_contents($filecss); + $csscontent = @file_get_contents($filecss); - $contentforedit = ''; - /*$contentforedit.='<style scoped>'."\n"; // "scoped" means "apply to parent element only". Not yet supported by browsers + $contentforedit = ''; + /*$contentforedit.='<style scoped>'."\n"; // "scoped" means "apply to parent element only". Not yet supported by browsers $contentforedit.=$csscontent; $contentforedit.='</style>'."\n";*/ - $contentforedit .= $objectpage->content; + $contentforedit .= $objectpage->content; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('PAGE_CONTENT',$contentforedit,'',500,'Full','',true,true,true,ROWS_5,'90%'); - $doleditor->Create(0, '', false); + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('PAGE_CONTENT',$contentforedit,'',500,'Full','',true,true,true,ROWS_5,'90%'); + $doleditor->Create(0, '', false); } print "</div>\n</form>\n"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c385fe9a6ae..1de02c5df7f 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -170,7 +170,7 @@ if (empty($reshook)) $result = $object->set_reopen($user); if ($result > 0) { - setEventMessages($langs->trans('OrderReopened', $object->ref), null); + setEventMessages($langs->trans('OrderReopened', $object->ref), null); } else { @@ -264,12 +264,12 @@ if (empty($reshook)) $object->modelpdf = GETPOST('model'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->fk_account = GETPOST('fk_account', 'int'); + $object->fk_account = GETPOST('fk_account', 'int'); $object->availability_id = GETPOST('availability_id'); $object->demand_reason_id = GETPOST('demand_reason_id'); $object->date_livraison = $datelivraison; - $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); - $object->warehouse_id = GETPOST('warehouse_id', 'int'); + $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); + $object->warehouse_id = GETPOST('warehouse_id', 'int'); $object->fk_delivery_address = GETPOST('fk_address'); $object->contactid = GETPOST('contactid'); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); @@ -279,8 +279,8 @@ if (empty($reshook)) // Fill array 'array_options' with data from add form if (! $error) { - $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - if ($ret < 0) $error++; + $ret = $extrafields->setOptionalsFromPost($extralabels, $object); + if ($ret < 0) $error++; } // If creation from another object of another module (Example: origin=propal, originid=1) @@ -366,7 +366,7 @@ if (empty($reshook)) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if - // trigger used + // trigger used { $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_options = $lines[$i]->array_options; @@ -423,7 +423,7 @@ if (empty($reshook)) $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if ($reshook < 0) - $error++; + $error++; } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -491,10 +491,10 @@ if (empty($reshook)) } else if ($action == 'classifyunbilled' && $user->rights->commande->creer) { - $ret=$object->classifyUnBilled(); - if ($ret < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $ret=$object->classifyUnBilled(); + if ($ret < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } } // Positionne ref commande client @@ -502,7 +502,7 @@ if (empty($reshook)) $result = $object->set_ref_client($user, GETPOST('ref_client')); if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -510,7 +510,7 @@ if (empty($reshook)) $result = $object->set_remise($user, GETPOST('remise')); if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -563,7 +563,7 @@ if (empty($reshook)) else if ($action == 'setavailability' && $user->rights->commande->creer) { $result = $object->availability(GETPOST('availability_id')); if ($result < 0) - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } else if ($action == 'setdemandreason' && $user->rights->commande->creer) { @@ -596,36 +596,36 @@ if (empty($reshook)) // Set incoterm elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) - { - $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } + { + $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } // bank account else if ($action == 'setbankaccount' && $user->rights->commande->creer) { - $result=$object->setBankAccount(GETPOST('fk_account', 'int')); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result=$object->setBankAccount(GETPOST('fk_account', 'int')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } } // shipping method else if ($action == 'setshippingmethod' && $user->rights->commande->creer) { - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } } - // warehouse - else if ($action == 'setwarehouse' && $user->rights->commande->creer) { - $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } + // warehouse + else if ($action == 'setwarehouse' && $user->rights->commande->creer) { + $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } else if ($action == 'setremisepercent' && $user->rights->commande->creer) { $result = $object->set_remise($user, GETPOST('remise_percent')); @@ -898,18 +898,18 @@ if (empty($reshook)) unset($_POST['idprod']); unset($_POST['units']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); } else { setEventMessages($object->error, $object->errors, 'errors'); } @@ -1062,13 +1062,13 @@ if (empty($reshook)) } else if ($action == 'confirm_validate' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) ) { $idwarehouse = GETPOST('idwarehouse'); - $qualified_for_stock_change=0; + $qualified_for_stock_change=0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change=$object->hasProductsOrServices(2); @@ -1121,7 +1121,7 @@ if (empty($reshook)) else if ($action == 'confirm_modif' && $user->rights->commande->creer) { $idwarehouse = GETPOST('idwarehouse'); - $qualified_for_stock_change=0; + $qualified_for_stock_change=0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change=$object->hasProductsOrServices(2); @@ -1174,13 +1174,13 @@ if (empty($reshook)) } else if ($action == 'confirm_cancel' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) ) { $idwarehouse = GETPOST('idwarehouse'); - $qualified_for_stock_change=0; + $qualified_for_stock_change=0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change=$object->hasProductsOrServices(2); @@ -1223,7 +1223,7 @@ if (empty($reshook)) $hookmanager->initHooks(array('orderdao')); $parameters = array('id' => $object->id); $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by - // some hooks + // some hooks if (empty($reshook)) { $result = $object->insertExtraFields(); if ($result < 0) { @@ -1393,10 +1393,10 @@ if ($action == 'create' && $user->rights->commande->creer) $soc = $objectsrc->thirdparty; $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); - $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); + $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); $availability_id = (!empty($objectsrc->availability_id)?$objectsrc->availability_id:(!empty($soc->availability_id)?$soc->availability_id:0)); - $shipping_method_id = (! empty($objectsrc->shipping_method_id)?$objectsrc->shipping_method_id:(! empty($soc->shipping_method_id)?$soc->shipping_method_id:0)); - $warehouse_id = (! empty($objectsrc->warehouse_id)?$objectsrc->warehouse_id:(! empty($soc->warehouse_id)?$soc->warehouse_id:0)); + $shipping_method_id = (! empty($objectsrc->shipping_method_id)?$objectsrc->shipping_method_id:(! empty($soc->shipping_method_id)?$soc->shipping_method_id:0)); + $warehouse_id = (! empty($objectsrc->warehouse_id)?$objectsrc->warehouse_id:(! empty($soc->warehouse_id)?$soc->warehouse_id:0)); $demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0)); $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); @@ -1421,10 +1421,10 @@ if ($action == 'create' && $user->rights->commande->creer) { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; - $fk_account = $soc->fk_account; + $fk_account = $soc->fk_account; $availability_id = $soc->availability_id; - $shipping_method_id = $soc->shipping_method_id; - $warehouse_id = $soc->warehouse_id; + $shipping_method_id = $soc->shipping_method_id; + $warehouse_id = $soc->warehouse_id; $demand_reason_id = $soc->demand_reason_id; $remise_percent = $soc->remise_percent; $remise_absolue = 0; @@ -1537,12 +1537,12 @@ if ($action == 'create' && $user->rights->commande->creer) $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); print '</td></tr>'; - // Bank Account + // Bank Account if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled)) { print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; } // Delivery delay @@ -1550,21 +1550,21 @@ if ($action == 'create' && $user->rights->commande->creer) $form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1); print '</td></tr>'; - // Shipping Method - if (! empty($conf->expedition->enabled)) { - print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>'; - print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1); - print '</td></tr>'; - } + // Shipping Method + if (! empty($conf->expedition->enabled)) { + print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>'; + print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1); + print '</td></tr>'; + } - // Warehouse - if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct=new FormProduct($db); - print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>'; - print $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1); - print '</td></tr>'; - } + // Warehouse + if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct=new FormProduct($db); + print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>'; + print $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1); + print '</td></tr>'; + } // What trigger creation print '<tr><td>' . $langs->trans('Source') . '</td><td>'; @@ -1590,22 +1590,22 @@ if ($action == 'create' && $user->rights->commande->creer) { print '<tr>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>'; - print '<td class="maxwidthonsmartphone">'; - $incoterm_id = GETPOST('incoterm_id'); - $incoterm_location = GETPOST('location_incoterms'); - if (empty($incoterm_id)) - { - $incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms); - $incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms); - } - print $form->select_incoterms($incoterm_id, $incoterm_location); + print '<td class="maxwidthonsmartphone">'; + $incoterm_id = GETPOST('incoterm_id'); + $incoterm_location = GETPOST('location_incoterms'); + if (empty($incoterm_id)) + { + $incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms); + $incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms); + } + print $form->select_incoterms($incoterm_id, $incoterm_location); print '</td></tr>'; } // Other attributes $parameters = array('objectsrc' => $objectsrc, 'socid'=>$socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by - print $hookmanager->resPrint; + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } @@ -1623,8 +1623,8 @@ if ($action == 'create' && $user->rights->commande->creer) { print '<tr>'; print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>'; - print '<td class="maxwidthonsmartphone">'; - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print '<td class="maxwidthonsmartphone">'; + print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '</td></tr>'; } @@ -1918,69 +1918,69 @@ if ($action == 'create' && $user->rights->commande->creer) // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Thirdparty + $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherOrders").'</a>)'; - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='<br>'.$langs->trans('Project') . ' '; - if ($user->rights->commande->creer) - { - if ($action != 'classify') - $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; - $morehtmlref.='<input type="hidden" name="action" value="classin">'; - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; - $morehtmlref.='</form>'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; - $morehtmlref.=$proj->ref; - $morehtmlref.='</a>'; - } else { - $morehtmlref.=''; - } - } - } - $morehtmlref.='</div>'; + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='<br>'.$langs->trans('Project') . ' '; + if ($user->rights->commande->creer) + { + if ($action != 'classify') + $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; + $morehtmlref.='<input type="hidden" name="action" value="classin">'; + $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; + $morehtmlref.='</form>'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; + $morehtmlref.=$proj->ref; + $morehtmlref.='</a>'; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.='</div>'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '<div class="fichecenter">'; - print '<div class="fichehalfleft">'; - print '<div class="underbanner clearboth"></div>'; + print '<div class="fichecenter">'; + print '<div class="fichehalfleft">'; + print '<div class="underbanner clearboth"></div>'; - print '<table class="border" width="100%">'; + print '<table class="border" width="100%">'; if ($soc->outstanding_limit) { - // Outstanding Bill - print '<tr><td class="titlefield">'; - print $langs->trans('OutstandingBill'); - print '</td><td>'; - print price($soc->get_OutstandingBill()) . ' / '; - print price($soc->outstanding_limit, 0, '', 1, - 1, - 1, $conf->currency); - print '</td>'; - print '</tr>'; + // Outstanding Bill + print '<tr><td class="titlefield">'; + print $langs->trans('OutstandingBill'); + print '</td><td>'; + print price($soc->get_OutstandingBill()) . ' / '; + print price($soc->outstanding_limit, 0, '', 1, - 1, - 1, $conf->currency); + print '</td>'; + print '</tr>'; } // Relative and absolute discounts if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final - // invoice + // invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')"; @@ -2037,7 +2037,7 @@ if ($action == 'create' && $user->rights->commande->creer) } else { print $object->date ? dol_print_date($object->date, 'day') : ' '; if ($object->hasDelay() && ! empty($object->date_livraison)) { - print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); + print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } print '</td>'; @@ -2062,51 +2062,51 @@ if ($action == 'create' && $user->rights->commande->creer) } else { print $object->date_livraison ? dol_print_date($object->date_livraison, 'daytext') : ' '; if ($object->hasDelay() && ! empty($object->date_livraison)) { - print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); + print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } print '</td>'; print '</tr>'; - // Shipping Method - if (! empty($conf->expedition->enabled)) { - print '<tr><td height="10">'; - print '<table width="100%" class="nobordernopadding"><tr><td>'; - print $langs->trans('SendingMethod'); - print '</td>'; - if ($action != 'editshippingmethod' && $user->rights->commande->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td>'; - if ($action == 'editshippingmethod') { - $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1); - } else { - $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'none'); - } - print '</td>'; - print '</tr>'; - } + // Shipping Method + if (! empty($conf->expedition->enabled)) { + print '<tr><td height="10">'; + print '<table width="100%" class="nobordernopadding"><tr><td>'; + print $langs->trans('SendingMethod'); + print '</td>'; + if ($action != 'editshippingmethod' && $user->rights->commande->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td>'; + if ($action == 'editshippingmethod') { + $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1); + } else { + $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'none'); + } + print '</td>'; + print '</tr>'; + } - // Warehouse - if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct=new FormProduct($db); - print '<tr><td>'; - print '<table width="100%" class="nobordernopadding"><tr><td>'; - print $langs->trans('Warehouse'); - print '</td>'; - if ($action != 'editwarehouse' && $user->rights->commande->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editwarehouse&id='.$object->id.'">'.img_edit($langs->trans('SetWarehouse'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td>'; - if ($action == 'editwarehouse') { - $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1); - } else { - $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none'); - } - print '</td>'; - print '</tr>'; - } + // Warehouse + if (! empty($conf->expedition->enabled) && ! empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct=new FormProduct($db); + print '<tr><td>'; + print '<table width="100%" class="nobordernopadding"><tr><td>'; + print $langs->trans('Warehouse'); + print '</td>'; + if ($action != 'editwarehouse' && $user->rights->commande->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editwarehouse&id='.$object->id.'">'.img_edit($langs->trans('SetWarehouse'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td>'; + if ($action == 'editwarehouse') { + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1); + } else { + $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none'); + } + print '</td>'; + print '</tr>'; + } // Terms of payment print '<tr><td>'; @@ -2173,9 +2173,9 @@ if ($action == 'create' && $user->rights->commande->creer) print '</tr></table>'; print '</td><td>'; if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { - if($action == 'actualizemulticurrencyrate') { - list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); - } + if($action == 'actualizemulticurrencyrate') { + list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); + } $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); @@ -2243,30 +2243,30 @@ if ($action == 'create' && $user->rights->commande->creer) $totalVolume=$tmparray['volume']; if ($totalWeight || $totalVolume) { - print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>'; - print '<td>'; - print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no'); - print '</td></tr>'; - print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>'; - print '<td>'; - print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no'); - print '</td></tr>'; + print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>'; + print '<td>'; + print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no'); + print '</td></tr>'; + print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>'; + print '<td>'; + print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no'); + print '</td></tr>'; } - // TODO How record was recorded OrderMode (llx_c_input_method) + // TODO How record was recorded OrderMode (llx_c_input_method) // Incoterms if (!empty($conf->incoterm->enabled)) { print '<tr><td>'; - print '<table width="100%" class="nobordernopadding"><tr><td>'; - print $langs->trans('IncotermLabel'); - print '<td><td align="right">'; - if ($user->rights->commande->creer) print '<a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; - else print ' '; - print '</td></tr></table>'; - print '</td>'; - print '<td>'; + print '<table width="100%" class="nobordernopadding"><tr><td>'; + print $langs->trans('IncotermLabel'); + print '<td><td align="right">'; + if ($user->rights->commande->creer) print '<a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; + else print ' '; + print '</td></tr></table>'; + print '</td>'; + print '<td>'; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); @@ -2275,27 +2275,27 @@ if ($action == 'create' && $user->rights->commande->creer) { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id); } - print '</td></tr>'; + print '</td></tr>'; } - // Bank Account + // Bank Account if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled)) { - print '<tr><td class="nowrap">'; - print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; - print $langs->trans('BankAccount'); - print '<td>'; - if ($action != 'editbankaccount' && $user->rights->commande->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td>'; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print '</td>'; - print '</tr>'; + print '<tr><td class="nowrap">'; + print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; + print $langs->trans('BankAccount'); + print '<td>'; + if ($action != 'editbankaccount' && $user->rights->commande->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td>'; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print '</td>'; + print '</tr>'; } // Other attributes @@ -2312,20 +2312,20 @@ if ($action == 'create' && $user->rights->commande->creer) if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { - // Multicurrency Amount HT - print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount HT + print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount VAT - print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount VAT + print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount TTC - print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount TTC + print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; } // Total HT @@ -2357,7 +2357,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Margin Infos if (! empty($conf->margin->enabled)) { - $formmargin->displayMarginInfos($object); + $formmargin->displayMarginInfos($object); } @@ -2395,7 +2395,7 @@ if ($action == 'create' && $user->rights->commande->creer) include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } - print '<div class="div-table-responsive-no-min">'; + print '<div class="div-table-responsive-no-min">'; print '<table id="tablelines" class="noborder noshadow" width="100%">'; // Show object lines @@ -2421,7 +2421,7 @@ if ($action == 'create' && $user->rights->commande->creer) } } print '</table>'; - print '</div>'; + print '</div>'; print "</form>\n"; @@ -2435,7 +2435,7 @@ if ($action == 'create' && $user->rights->commande->creer) $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + // modified by hook if (empty($reshook)) { // Send if ($object->statut > Commande::STATUS_DRAFT) { @@ -2445,10 +2445,10 @@ if ($action == 'create' && $user->rights->commande->creer) print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">' . $langs->trans('SendByMail') . '</a></div>'; } - // Valid + // Valid if ($object->statut == Commande::STATUS_DRAFT && $object->total_ttc >= 0 && $numlines > 0 && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) ) { print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate">' . $langs->trans('Validate') . '</a></div>'; @@ -2459,8 +2459,8 @@ if ($action == 'create' && $user->rights->commande->creer) } // Create event if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a - // "workflow" action so should appears somewhere else on - // page. + // "workflow" action so should appears somewhere else on + // page. { print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>'; } @@ -2480,11 +2480,11 @@ if ($action == 'create' && $user->rights->commande->creer) // Create contract if ($conf->contrat->enabled && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { - $langs->load("contracts"); + $langs->load("contracts"); - if ($user->rights->contrat->creer) { - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a></div>'; - } + if ($user->rights->contrat->creer) { + print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a></div>'; + } } // Ship @@ -2527,9 +2527,9 @@ if ($action == 'create' && $user->rights->commande->creer) } } if ($object->statut > Commande::STATUS_DRAFT && $object->billed) { - if ($user->rights->commande->creer && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifyunbilled">' . $langs->trans("ClassifyUnBilled") . '</a></div>'; - } + if ($user->rights->commande->creer && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { + print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifyunbilled">' . $langs->trans("ClassifyUnBilled") . '</a></div>'; + } } // Clone if ($user->rights->commande->creer) { @@ -2538,8 +2538,8 @@ if ($action == 'create' && $user->rights->commande->creer) // Cancel order if ($object->statut == Commande::STATUS_VALIDATED && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->cloturer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->annuler))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->cloturer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->annuler))) ) { print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel">' . $langs->trans('Cancel') . '</a></div>'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 55b128bcb6a..53b3cc8880d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -307,11 +307,11 @@ if (empty($reshook)) $date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']); if (empty($date)) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); - header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate'); - exit; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate'); + exit; } - $object->date=$date; + $object->date=$date; $new_date_lim_reglement = $object->calculate_date_lim_reglement(); if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement; if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date; @@ -323,7 +323,7 @@ if (empty($reshook)) { $object->fetch($id); $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - $object->date_pointoftax=$date_pointoftax; + $object->date_pointoftax=$date_pointoftax; $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); } @@ -369,14 +369,14 @@ if (empty($reshook)) // Set incoterm elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) - { - $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); - } + { + $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); + } // bank account else if ($action == 'setbankaccount' && $user->rights->facture->creer) { - $result=$object->setBankAccount(GETPOST('fk_account', 'int')); + $result=$object->setBankAccount(GETPOST('fk_account', 'int')); } else if ($action == 'setremisepercent' && $user->rights->facture->creer) @@ -451,8 +451,8 @@ if (empty($reshook)) // Classify to validated else if ($action == 'confirm_valid' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate))) ) { $idwarehouse = GETPOST('idwarehouse','int'); @@ -462,7 +462,7 @@ if (empty($reshook)) // Check parameters - // Check for mandatory fields defined into setup + // Check for mandatory fields defined into setup $array_to_check=array('IDPROF1','IDPROF2','IDPROF3','IDPROF4','IDPROF5','IDPROF6','EMAIL'); foreach($array_to_check as $key) { @@ -540,7 +540,7 @@ if (empty($reshook)) $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -554,7 +554,7 @@ if (empty($reshook)) // Go back to draft status (unvalidate) else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) ) { $idwarehouse = GETPOST('idwarehouse'); @@ -831,7 +831,7 @@ if (empty($reshook)) $object->fk_project = $_POST['projectid']; $object->cond_reglement_id = $_POST['cond_reglement_id']; $object->mode_reglement_id = $_POST['mode_reglement_id']; - $object->fk_account = GETPOST('fk_account', 'int'); + $object->fk_account = GETPOST('fk_account', 'int'); $object->remise_absolue = $_POST['remise_absolue']; $object->remise_percent = $_POST['remise_percent']; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); @@ -883,7 +883,7 @@ if (empty($reshook)) $object->fk_project = $_POST['projectid']; $object->cond_reglement_id = 0; $object->mode_reglement_id = $_POST['mode_reglement_id']; - $object->fk_account = GETPOST('fk_account', 'int'); + $object->fk_account = GETPOST('fk_account', 'int'); $object->remise_absolue = $_POST['remise_absolue']; $object->remise_percent = $_POST['remise_percent']; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); @@ -899,62 +899,62 @@ if (empty($reshook)) if (GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) { - $facture_source = new Facture($db); // fetch origin object - if ($facture_source->fetch($object->fk_facture_source)>0) - { - $fk_parent_line = 0; + $facture_source = new Facture($db); // fetch origin object + if ($facture_source->fetch($object->fk_facture_source)>0) + { + $fk_parent_line = 0; - foreach($facture_source->lines as $line) - { - // Reset fk_parent_line for no child products and special product - if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { - $fk_parent_line = 0; - } + foreach($facture_source->lines as $line) + { + // Reset fk_parent_line for no child products and special product + if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { + $fk_parent_line = 0; + } - $line->fk_facture = $object->id; - $line->fk_parent_line = $fk_parent_line; + $line->fk_facture = $object->id; + $line->fk_parent_line = $fk_parent_line; - $line->subprice = -$line->subprice; // invert price for object - $line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here - $line->total_ht = -$line->total_ht; - $line->total_tva = -$line->total_tva; - $line->total_ttc = -$line->total_ttc; - $line->total_localtax1 = -$line->total_localtax1; - $line->total_localtax2 = -$line->total_localtax2; + $line->subprice = -$line->subprice; // invert price for object + $line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here + $line->total_ht = -$line->total_ht; + $line->total_tva = -$line->total_tva; + $line->total_ttc = -$line->total_ttc; + $line->total_localtax1 = -$line->total_localtax1; + $line->total_localtax2 = -$line->total_localtax2; - $line->multicurrency_subprice = -$line->multicurrency_subprice; - $line->multicurrency_total_ht = -$line->multicurrency_total_ht; - $line->multicurrency_total_tva = -$line->multicurrency_total_tva; - $line->multicurrency_total_ttc = -$line->multicurrency_total_ttc; + $line->multicurrency_subprice = -$line->multicurrency_subprice; + $line->multicurrency_total_ht = -$line->multicurrency_total_ht; + $line->multicurrency_total_tva = -$line->multicurrency_total_tva; + $line->multicurrency_total_ttc = -$line->multicurrency_total_ttc; - $result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked + $result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked - $object->lines[] = $line; // insert new line in current object + $object->lines[] = $line; // insert new line in current object - // Defined the new fk_parent_line - if ($result > 0 && $line->product_type == 9) { - $fk_parent_line = $result; - } - } + // Defined the new fk_parent_line + if ($result > 0 && $line->product_type == 9) { + $fk_parent_line = $result; + } + } - $object->update_price(1); - } + $object->update_price(1); + } } - if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) - { - $facture_source = new Facture($db); // fetch origin object if not previously defined - if ($facture_source->fetch($object->fk_facture_source)>0) - { - $totalpaye = $facture_source->getSommePaiement(); - $totalcreditnotes = $facture_source->getSumCreditNotesUsed(); - $totaldeposits = $facture_source->getSumDepositsUsed(); - $remain_to_pay = abs($facture_source->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits); + if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) + { + $facture_source = new Facture($db); // fetch origin object if not previously defined + if ($facture_source->fetch($object->fk_facture_source)>0) + { + $totalpaye = $facture_source->getSommePaiement(); + $totalcreditnotes = $facture_source->getSumCreditNotesUsed(); + $totaldeposits = $facture_source->getSumDepositsUsed(); + $remain_to_pay = abs($facture_source->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits); - $object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'),$remain_to_pay,1,0,0,0,0,0,'','','TTC'); - } - } + $object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'),$remain_to_pay,1,0,0,0,0,0,'','','TTC'); + } + } } } @@ -985,7 +985,7 @@ if (empty($reshook)) $object->fk_project = $_POST['projectid']; $object->cond_reglement_id = ($_POST['type'] == 3?1:$_POST['cond_reglement_id']); $object->mode_reglement_id = $_POST['mode_reglement_id']; - $object->fk_account = GETPOST('fk_account', 'int'); + $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = $_POST['amount']; $object->remise_absolue = $_POST['remise_absolue']; $object->remise_percent = $_POST['remise_percent']; @@ -1035,7 +1035,7 @@ if (empty($reshook)) $object->fk_project = $_POST['projectid']; $object->cond_reglement_id = ($_POST['type'] == 3?1:$_POST['cond_reglement_id']); $object->mode_reglement_id = $_POST['mode_reglement_id']; - $object->fk_account = GETPOST('fk_account', 'int'); + $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = $_POST['amount']; $object->remise_absolue = $_POST['remise_absolue']; $object->remise_percent = $_POST['remise_percent']; @@ -1117,7 +1117,7 @@ if (empty($reshook)) dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines or deposit lines"); $result = $srcobject->fetch($object->origin_id); - // If deposit invoice + // If deposit invoice if ($_POST['type'] == Facture::TYPE_DEPOSIT) { $typeamount = GETPOST('typedeposit', 'alpha'); @@ -1167,8 +1167,8 @@ if (empty($reshook)) if ($totalamount != 0) { if ($numlines > 0) $numlines = $numlines-1; - $tva_tx = $lines[$numlines]->tva_tx; - if (! empty($lines[$numlines]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$numlines]->vat_src_code.')'; + $tva_tx = $lines[$numlines]->tva_tx; + if (! empty($lines[$numlines]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$numlines]->vat_src_code.')'; $amountdeposit[$tva_tx] = ($totalamount * $valuedeposit) / 100; } else { $amountdeposit[0] = 0; @@ -1205,7 +1205,7 @@ if (empty($reshook)) 0, // date_start 0, // date_end 0, - $lines[$i]->info_bits, // info_bits + $lines[$i]->info_bits, // info_bits 0, 'HT', 0, @@ -1367,8 +1367,8 @@ if (empty($reshook)) // modified by hook if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - $error++; + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + $error++; } } else { @@ -1540,16 +1540,16 @@ if (empty($reshook)) setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error ++; } - if (!$prod_entry_mode) - { - if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) - { - setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors'); - $error ++; - } - } + if (!$prod_entry_mode) + { + if (GETPOST('type') < 0 && ! GETPOST('search_idprod')) + { + setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors'); + $error ++; + } + } if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error ++; } if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not '' @@ -1634,8 +1634,8 @@ if (empty($reshook)) $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility { - if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; if (empty($tva_tx)) $tva_npr=0; } } @@ -1790,18 +1790,18 @@ if (empty($reshook)) unset($_POST['idprod']); unset($_POST['units']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); unset($_POST['situations']); unset($_POST['progress']); @@ -1966,18 +1966,18 @@ if (empty($reshook)) unset($_POST['idprod']); unset($_POST['units']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); unset($_POST['situations']); unset($_POST['progress']); @@ -2020,10 +2020,10 @@ if (empty($reshook)) $trackid='inv'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - // Actions to build doc - $upload_dir = $conf->facture->dir_output; - $permissioncreate=$user->rights->facture->creer; - include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + // Actions to build doc + $upload_dir = $conf->facture->dir_output; + $permissioncreate=$user->rights->facture->creer; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'update_extras') { @@ -2195,7 +2195,7 @@ if ($action == 'create') $cond_reglement_id = (! empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(! empty($soc->cond_reglement_id)?$soc->cond_reglement_id:0)); $mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); - $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); + $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); $remise_percent = (! empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(! empty($soc->remise_percent)?$soc->remise_percent:0)); $remise_absolue = (! empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(! empty($soc->remise_absolue)?$soc->remise_absolue:0)); $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); @@ -2238,14 +2238,14 @@ if ($action == 'create') if ($origin == 'contrat') { - $langs->load("admin"); - $text=$langs->trans("ToCreateARecurringInvoice"); - $text.=' '.$langs->trans("ToCreateARecurringInvoiceGene", $langs->transnoentitiesnoconv("MenuFinancial"), $langs->transnoentitiesnoconv("BillsCustomers"), $langs->transnoentitiesnoconv("ListOfTemplates")); - if (empty($conf->global->INVOICE_DISABLE_AUTOMATIC_RECURRING_INVOICE)) - { - $text.=' '.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')); - } - print info_admin($text, 0, 0, 0).'<br>'; + $langs->load("admin"); + $text=$langs->trans("ToCreateARecurringInvoice"); + $text.=' '.$langs->trans("ToCreateARecurringInvoiceGene", $langs->transnoentitiesnoconv("MenuFinancial"), $langs->transnoentitiesnoconv("BillsCustomers"), $langs->transnoentitiesnoconv("ListOfTemplates")); + if (empty($conf->global->INVOICE_DISABLE_AUTOMATIC_RECURRING_INVOICE)) + { + $text.=' '.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')); + } + print info_admin($text, 0, 0, 0).'<br>'; } print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; @@ -2303,7 +2303,7 @@ if ($action == 'create') }); </script>'; } - print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; + print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; print '</td>'; } print '</tr>' . "\n"; @@ -2313,16 +2313,16 @@ if ($action == 'create') // Overwrite value if creation of invoice is from a predefined invoice if (empty($origin) && empty($originid) && GETPOST('fac_rec','int') > 0) { - $invoice_predefined = new FactureRec($db); - $invoice_predefined->fetch(GETPOST('fac_rec','int')); + $invoice_predefined = new FactureRec($db); + $invoice_predefined->fetch(GETPOST('fac_rec','int')); - $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later - if (empty($projectid)) $projectid = $invoice_predefined->fk_project; - $cond_reglement_id = $invoice_predefined->cond_reglement_id; - $mode_reglement_id = $invoice_predefined->mode_reglement_id; - $fk_account = $invoice_predefined->fk_account; - $note_public = $invoice_predefined->note_public; - $note_private = $invoice_predefined->note_private; + $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later + if (empty($projectid)) $projectid = $invoice_predefined->fk_project; + $cond_reglement_id = $invoice_predefined->cond_reglement_id; + $mode_reglement_id = $invoice_predefined->mode_reglement_id; + $fk_account = $invoice_predefined->fk_account; + $note_public = $invoice_predefined->note_public; + $note_private = $invoice_predefined->note_private; $sql = 'SELECT r.rowid, r.titre, r.total_ttc'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r'; @@ -2345,17 +2345,17 @@ if ($action == 'create') print '<option value="' . $objp->rowid . '"'; if (GETPOST('fac_rec') == $objp->rowid) { - print ' selected'; - $exampletemplateinvoice->fetch(GETPOST('fac_rec')); + print ' selected'; + $exampletemplateinvoice->fetch(GETPOST('fac_rec')); } print '>' . $objp->titre . ' (' . price($objp->total_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; $i ++; } print '</select>'; // Option to reload page to retrieve customer informations. Note, this clear other input - if (!empty($conf->global->RELOAD_PAGE_ON_TEMPLATE_CHANGE)) - { - print '<script type="text/javascript"> + if (!empty($conf->global->RELOAD_PAGE_ON_TEMPLATE_CHANGE)) + { + print '<script type="text/javascript"> $(document).ready(function() { $("#fac_rec").change(function() { var fac_rec = $(this).val(); @@ -2365,7 +2365,7 @@ if ($action == 'create') }); }); </script>'; - } + } print '</td></tr>'; } $db->free($resql); @@ -2433,9 +2433,9 @@ if ($action == 'create') // Deposit if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) { - print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; - $tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> '; - print '<script type="text/javascript" language="javascript"> + print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; + $tmp='<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOST('type') == 3 ? ' checked' : '') . '> '; + print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { jQuery("#typedeposit, #valuedeposit").click(function() { jQuery("#radio_deposit").prop("checked", true); @@ -2443,21 +2443,21 @@ if ($action == 'create') }); </script>'; - $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); - print '<table class="nobordernopadding"><tr><td>'; - print $desc; - print '</td>'; - if (($origin == 'propal') || ($origin == 'commande')) - { - print '<td class="nowrap" style="padding-left: 5px">'; - $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); - print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); - print '</td>'; - print '<td class="nowrap" style="padding-left: 5px">' . $langs->trans('Value') . ':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="' . GETPOST('valuedeposit', 'int') . '"/>'; - } - print '</td></tr></table>'; + $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); + print '<table class="nobordernopadding"><tr><td>'; + print $desc; + print '</td>'; + if (($origin == 'propal') || ($origin == 'commande')) + { + print '<td class="nowrap" style="padding-left: 5px">'; + $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); + print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); + print '</td>'; + print '<td class="nowrap" style="padding-left: 5px">' . $langs->trans('Value') . ':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="' . GETPOST('valuedeposit', 'int') . '"/>'; + } + print '</td></tr></table>'; - print '</div></div>'; + print '</div></div>'; } } @@ -2490,33 +2490,33 @@ if ($action == 'create') // Replacement if (empty($conf->global->INVOICE_DISABLE_REPLACEMENT)) { - print '<!-- replacement line -->'; - print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; - $tmp='<input type="radio" name="type" id="radio_replacement" value="1"' . (GETPOST('type') == 1 ? ' checked' : ''); - if (! $options) $tmp.=' disabled'; - $tmp.='> '; - print '<script type="text/javascript" language="javascript"> + print '<!-- replacement line -->'; + print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; + $tmp='<input type="radio" name="type" id="radio_replacement" value="1"' . (GETPOST('type') == 1 ? ' checked' : ''); + if (! $options) $tmp.=' disabled'; + $tmp.='> '; + print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { jQuery("#fac_replacement").change(function() { jQuery("#radio_replacement").prop("checked", true); }); }); </script>'; - $text = $tmp.$langs->trans("InvoiceReplacementAsk") . ' '; - $text .= '<select class="flat" name="fac_replacement" id="fac_replacement"'; - if (! $options) - $text .= ' disabled'; - $text .= '>'; - if ($options) { - $text .= '<option value="-1"> </option>'; - $text .= $options; - } else { - $text .= '<option value="-1">' . $langs->trans("NoReplacableInvoice") . '</option>'; - } - $text .= '</select>'; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); - print $desc; - print '</div></div>'; + $text = $tmp.$langs->trans("InvoiceReplacementAsk") . ' '; + $text .= '<select class="flat" name="fac_replacement" id="fac_replacement"'; + if (! $options) + $text .= ' disabled'; + $text .= '>'; + if ($options) { + $text .= '<option value="-1"> </option>'; + $text .= $options; + } else { + $text .= '<option value="-1">' . $langs->trans("NoReplacableInvoice") . '</option>'; + } + $text .= '</select>'; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); + print $desc; + print '</div></div>'; } } else @@ -2534,15 +2534,15 @@ if ($action == 'create') { if ($socid > 0) { - // Credit note - if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) - { - print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; - $tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : ''); - if (! $optionsav) $tmp.=' disabled'; - $tmp.= '> '; - // Show credit note options only if we checked credit note - print '<script type="text/javascript" language="javascript"> + // Credit note + if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) + { + print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; + $tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : ''); + if (! $optionsav) $tmp.=' disabled'; + $tmp.= '> '; + // Show credit note options only if we checked credit note + print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { if (! jQuery("#radio_creditnote").is(":checked")) { @@ -2556,29 +2556,29 @@ if ($action == 'create') }); }); </script>'; - $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; - // $text.='<input type="text" value="">'; - $text .= '<select class="flat valignmiddle" name="fac_avoir" id="fac_avoir"'; - if (! $optionsav) - $text .= ' disabled'; - $text .= '>'; - if ($optionsav) { - $text .= '<option value="-1"></option>'; - $text .= $optionsav; - } else { - $text .= '<option value="-1">' . $langs->trans("NoInvoiceToCorrect") . '</option>'; - } - $text .= '</select>'; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); - print $desc; + $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; + // $text.='<input type="text" value="">'; + $text .= '<select class="flat valignmiddle" name="fac_avoir" id="fac_avoir"'; + if (! $optionsav) + $text .= ' disabled'; + $text .= '>'; + if ($optionsav) { + $text .= '<option value="-1"></option>'; + $text .= $optionsav; + } else { + $text .= '<option value="-1">' . $langs->trans("NoInvoiceToCorrect") . '</option>'; + } + $text .= '</select>'; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + print $desc; - print '<div id="credit_note_options" class="clearboth">'; - print '    <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; - print '<br>    <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; - print '</div>'; + print '<div id="credit_note_options" class="clearboth">'; + print '    <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; + print '<br>    <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; + print '</div>'; - print '</div></div>'; - } + print '</div></div>'; + } } else { @@ -2652,14 +2652,14 @@ if ($action == 'create') $form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id', 'CRDT'); print '</td></tr>'; - // Bank Account + // Bank Account if (isset($_POST['fk_account'])) { $fk_account = $_POST['fk_account']; } - print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; + print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; // Project if (! empty($conf->projet->enabled) && $socid > 0) @@ -2676,22 +2676,22 @@ if ($action == 'create') { print '<tr>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>'; - print '<td colspan="2" class="maxwidthonsmartphone">'; - $incoterm_id = GETPOST('incoterm_id'); - $incoterm_location = GETPOST('location_incoterms'); - if (empty($incoterm_id)) - { - $incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms); - $incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms); - } - print $form->select_incoterms($incoterm_id, $incoterm_location); + print '<td colspan="2" class="maxwidthonsmartphone">'; + $incoterm_id = GETPOST('incoterm_id'); + $incoterm_location = GETPOST('location_incoterms'); + if (empty($incoterm_id)) + { + $incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms); + $incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms); + } + print $form->select_incoterms($incoterm_id, $incoterm_location); print '</td></tr>'; } // Other attributes $parameters = array('objectsrc' => $objectsrc,'colspan' => ' colspan="2"', 'cols'=>2); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } @@ -2709,8 +2709,8 @@ if ($action == 'create') { print '<tr>'; print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>'; - print '<td colspan="2" class="maxwidthonsmartphone">'; - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print '<td colspan="2" class="maxwidthonsmartphone">'; + print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '</td></tr>'; } @@ -2718,28 +2718,28 @@ if ($action == 'create') $htmltext=''; if (GETPOST('fac_rec','int') > 0) { - $dateexample=($datefacture ? $datefacture : $dateinvoice); - if (empty($dateexample)) $dateexample=dol_now(); - $substitutionarray=array( - '__TOTAL_HT__' => $langs->trans("AmountHT").' ('.$langs->trans("Example").': '.price($exampletemplateinvoice->total_ht).')', - '__TOTAL_TTC__' => $langs->trans("AmountTTC").' ('.$langs->trans("Example").': '.price($exampletemplateinvoice->total_ttc).')', - '__INVOICE_PREVIOUS_MONTH__' => $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%m').')', - '__INVOICE_MONTH__' => $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%m').')', - '__INVOICE_NEXT_MONTH__' => $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'),'%m').')', - '__INVOICE_PREVIOUS_MONTH_TEXT__' => $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%B').')', - '__INVOICE_MONTH_TEXT__' => $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%B').')', - '__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')', - '__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'),'%Y').')', - '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')', - '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')' - ); + $dateexample=($datefacture ? $datefacture : $dateinvoice); + if (empty($dateexample)) $dateexample=dol_now(); + $substitutionarray=array( + '__TOTAL_HT__' => $langs->trans("AmountHT").' ('.$langs->trans("Example").': '.price($exampletemplateinvoice->total_ht).')', + '__TOTAL_TTC__' => $langs->trans("AmountTTC").' ('.$langs->trans("Example").': '.price($exampletemplateinvoice->total_ttc).')', + '__INVOICE_PREVIOUS_MONTH__' => $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%m').')', + '__INVOICE_MONTH__' => $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%m').')', + '__INVOICE_NEXT_MONTH__' => $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'),'%m').')', + '__INVOICE_PREVIOUS_MONTH_TEXT__' => $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'),'%B').')', + '__INVOICE_MONTH_TEXT__' => $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%B').')', + '__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')', + '__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'),'%Y').')', + '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')', + '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')' + ); - $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; - foreach($substitutionarray as $key => $val) - { - $htmltext.=$key.' = '.$langs->trans($val).'<br>'; - } - $htmltext.='</i>'; + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; + foreach($substitutionarray as $key => $val) + { + $htmltext.=$key.' = '.$langs->trans($val).'<br>'; + } + $htmltext.='</i>'; } // Public note @@ -2810,8 +2810,8 @@ if ($action == 'create') $cntinvoice=count($objectsrc->linkedObjects['facture']); if ($cntinvoice>=1) { - setEventMessages('WarningBillExist', null, 'warnings'); - echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; + setEventMessages('WarningBillExist', null, 'warnings'); + echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; } echo '</td></tr>'; print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>'; @@ -3179,34 +3179,34 @@ else if ($id > 0 || ! empty($ref)) // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref.='<br>'.$langs->trans('Project') . ' '; - if ($user->rights->facture->creer) - { - if ($action != 'classify') - $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; - $morehtmlref.='<input type="hidden" name="action" value="classin">'; - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; - $morehtmlref.='</form>'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; - $morehtmlref.=$proj->ref; - $morehtmlref.='</a>'; - } else { - $morehtmlref.=''; - } - } + $langs->load("projects"); + $morehtmlref.='<br>'.$langs->trans('Project') . ' '; + if ($user->rights->facture->creer) + { + if ($action != 'classify') + $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; + $morehtmlref.='<input type="hidden" name="action" value="classin">'; + $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; + $morehtmlref.='</form>'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; + $morehtmlref.=$proj->ref; + $morehtmlref.='</a>'; + } else { + $morehtmlref.=''; + } + } } $morehtmlref.='</div>'; @@ -3259,7 +3259,7 @@ else if ($id > 0 || ! empty($ref)) $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, $object->id); if ($result > 0){ - print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>'; + print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>'; } } print '</td></tr>'; @@ -3501,16 +3501,16 @@ else if ($id > 0 || ! empty($ref)) print $langs->trans('BankAccount'); print '<td>'; if (($action != 'editbankaccount') && $user->rights->facture->creer && ! empty($object->brouillon)) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; print '</tr></table>'; print '</td><td>'; if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print "</td>"; print '</tr>'; @@ -3568,14 +3568,14 @@ else if ($id > 0 || ! empty($ref)) if (!empty($conf->incoterm->enabled)) { print '<tr><td>'; - print '<table width="100%" class="nobordernopadding"><tr><td>'; - print $langs->trans('IncotermLabel'); - print '<td><td align="right">'; - if ($user->rights->facture->creer) print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; - else print ' '; - print '</td></tr></table>'; - print '</td>'; - print '<td>'; + print '<table width="100%" class="nobordernopadding"><tr><td>'; + print $langs->trans('IncotermLabel'); + print '<td><td align="right">'; + if ($user->rights->facture->creer) print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; + else print ' '; + print '</td></tr></table>'; + print '</td>'; + print '<td>'; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); @@ -3584,7 +3584,7 @@ else if ($id > 0 || ! empty($ref)) { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id); } - print '</td></tr>'; + print '</td></tr>'; } // Other attributes @@ -3602,20 +3602,20 @@ else if ($id > 0 || ! empty($ref)) if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { - // Multicurrency Amount HT - print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; - print '<td class="nowrap amountcard">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount HT + print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; + print '<td class="nowrap amountcard">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount VAT - print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; - print '<td class="nowrap amountcard">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount VAT + print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; + print '<td class="nowrap amountcard">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount TTC - print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; - print '<td class="nowrap amountcard">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount TTC + print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; + print '<td class="nowrap amountcard">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; } // Amount @@ -3629,40 +3629,40 @@ else if ($id > 0 || ! empty($ref)) // Amount Local Taxes if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) // Localtax1 { - print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; - print '<td class="nowrap amountcard">' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; + print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; + print '<td class="nowrap amountcard">' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; } if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) // Localtax2 { - print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; - print '<td class=nowrap amountcard">' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; + print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; + print '<td class=nowrap amountcard">' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; } // Revenue stamp if ($selleruserevenustamp) // Test company use revenue stamp { - print '<tr><td>'; - print '<table class="nobordernopadding" width="100%"><tr><td>'; - print $langs->trans('RevenueStamp'); - print '</td>'; - if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer) - { - print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>'; - } - print '</tr></table>'; - print '</td><td>'; - if ($action == 'editrevenuestamp') { - print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; - print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; - print '<input type="hidden" name="action" value="setrevenuestamp">'; - print $formother->select_revenue_stamp(GETPOST('revenuestamp'), 'revenuestamp', $mysoc->country_code); - // print '<input type="text" class="flat" size="4" name="revenuestamp" value="'.price2num($object->revenuestamp).'">'; - print ' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; - print '</form>'; - } else { - print price($object->revenuestamp, 1, '', 1, - 1, - 1, $conf->currency); - } - print '</td></tr>'; + print '<tr><td>'; + print '<table class="nobordernopadding" width="100%"><tr><td>'; + print $langs->trans('RevenueStamp'); + print '</td>'; + if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer) + { + print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrevenuestamp&facid=' . $object->id . '">' . img_edit($langs->trans('SetRevenuStamp'), 1) . '</a></td>'; + } + print '</tr></table>'; + print '</td><td>'; + if ($action == 'editrevenuestamp') { + print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; + print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; + print '<input type="hidden" name="action" value="setrevenuestamp">'; + print $formother->select_revenue_stamp(GETPOST('revenuestamp'), 'revenuestamp', $mysoc->country_code); + // print '<input type="text" class="flat" size="4" name="revenuestamp" value="'.price2num($object->revenuestamp).'">'; + print ' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; + print '</form>'; + } else { + print price($object->revenuestamp, 1, '', 1, - 1, - 1, $conf->currency); + } + print '</td></tr>'; } // Total with tax @@ -3675,165 +3675,165 @@ else if ($id > 0 || ! empty($ref)) $sign = 1; if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = - 1; - $nbrows = 8; - $nbcols = 3; - if (! empty($conf->projet->enabled)) - $nbrows ++; - if (! empty($conf->banque->enabled)) { - $nbrows ++; - $nbcols ++; - } - if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) - $nbrows ++; - if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) - $nbrows ++; - if ($selleruserevenustamp) - $nbrows ++; - if (! empty($conf->multicurrency->enabled)) - $nbrows += 5; - if (! empty($conf->incoterm->enabled)) - $nbrows += 1; + $nbrows = 8; + $nbcols = 3; + if (! empty($conf->projet->enabled)) + $nbrows ++; + if (! empty($conf->banque->enabled)) { + $nbrows ++; + $nbcols ++; + } + if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) + $nbrows ++; + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) + $nbrows ++; + if ($selleruserevenustamp) + $nbrows ++; + if (! empty($conf->multicurrency->enabled)) + $nbrows += 5; + if (! empty($conf->incoterm->enabled)) + $nbrows += 1; - if ($object->type == Facture::TYPE_SITUATION && ! empty($conf->global->INVOICE_USE_SITUATION)) - { - if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) - print '<table class="noborder situationstable" width="100%">'; + if ($object->type == Facture::TYPE_SITUATION && ! empty($conf->global->INVOICE_USE_SITUATION)) + { + if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) + print '<table class="noborder situationstable" width="100%">'; - if (count($object->tab_previous_situation_invoice) > 0) { - // List of previous invoices - print '<tr class="liste_titre">'; - print '<td>' . $langs->trans('ListOfPreviousSituationInvoices') . '</td>'; - print '<td></td>'; - if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; - print '<td align="right">' . $langs->trans('AmountHT') . '</td>'; - print '<td align="right">' . $langs->trans('AmountTTC') . '</td>'; - print '<td width="18"> </td>'; - print '</tr>'; + if (count($object->tab_previous_situation_invoice) > 0) { + // List of previous invoices + print '<tr class="liste_titre">'; + print '<td>' . $langs->trans('ListOfPreviousSituationInvoices') . '</td>'; + print '<td></td>'; + if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; + print '<td align="right">' . $langs->trans('AmountHT') . '</td>'; + print '<td align="right">' . $langs->trans('AmountTTC') . '</td>'; + print '<td width="18"> </td>'; + print '</tr>'; - $total_prev_ht = $total_prev_ttc = 0; - foreach ($object->tab_previous_situation_invoice as $prev_invoice) { - $totalpaye = $prev_invoice->getSommePaiement(); - $total_prev_ht += $prev_invoice->total_ht; - $total_prev_ttc += $prev_invoice->total_ttc; - print '<tr class="oddeven">'; - print '<td>' . $prev_invoice->getNomUrl(1) . '</td>'; - print '<td></td>'; - if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; - print '<td align="right">' . price($prev_invoice->total_ht) . '</td>'; - print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>'; - print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>'; - print '</tr>'; + $total_prev_ht = $total_prev_ttc = 0; + foreach ($object->tab_previous_situation_invoice as $prev_invoice) { + $totalpaye = $prev_invoice->getSommePaiement(); + $total_prev_ht += $prev_invoice->total_ht; + $total_prev_ttc += $prev_invoice->total_ttc; + print '<tr class="oddeven">'; + print '<td>' . $prev_invoice->getNomUrl(1) . '</td>'; + print '<td></td>'; + if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; + print '<td align="right">' . price($prev_invoice->total_ht) . '</td>'; + print '<td align="right">' . price($prev_invoice->total_ttc) . '</td>'; + print '<td align="right">' . $prev_invoice->getLibStatut(3, $totalpaye) . '</td>'; + print '</tr>'; - } + } - print '<tr class="oddeven">'; - print '<td></td>'; - print '<td></td>'; - if (! empty($conf->banque->enabled)) print '<td></td>'; - print '<td align="right"><b>' . price($total_prev_ht) . '</b></td>'; - print '<td align="right"><b>' . price($total_prev_ttc) . '</b></td>'; - print '<td width="18"> </td>'; - print '</tr>'; - } + print '<tr class="oddeven">'; + print '<td></td>'; + print '<td></td>'; + if (! empty($conf->banque->enabled)) print '<td></td>'; + print '<td align="right"><b>' . price($total_prev_ht) . '</b></td>'; + print '<td align="right"><b>' . price($total_prev_ttc) . '</b></td>'; + print '<td width="18"> </td>'; + print '</tr>'; + } - if (count($object->tab_next_situation_invoice) > 0) { - // List of next invoices - print '<tr class="liste_titre">'; - print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>'; - print '<td></td>'; - if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; - print '<td align="right">' . $langs->trans('AmountHT') . '</td>'; - print '<td align="right">' . $langs->trans('AmountTTC') . '</td>'; - print '<td width="18"> </td>'; - print '</tr>'; + if (count($object->tab_next_situation_invoice) > 0) { + // List of next invoices + print '<tr class="liste_titre">'; + print '<td>' . $langs->trans('ListOfNextSituationInvoices') . '</td>'; + print '<td></td>'; + if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; + print '<td align="right">' . $langs->trans('AmountHT') . '</td>'; + print '<td align="right">' . $langs->trans('AmountTTC') . '</td>'; + print '<td width="18"> </td>'; + print '</tr>'; - $total_next_ht = $total_next_ttc = 0; + $total_next_ht = $total_next_ttc = 0; - foreach ($object->tab_next_situation_invoice as $next_invoice) { - $totalpaye = $next_invoice->getSommePaiement(); - $total_next_ht += $next_invoice->total_ht; - $total_next_ttc += $next_invoice->total_ttc; - print '<tr class="oddeven">'; - print '<td>' . $next_invoice->getNomUrl(1) . '</td>'; - print '<td></td>'; - if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; - print '<td align="right">' . price($next_invoice->total_ht) . '</td>'; - print '<td align="right">' . price($next_invoice->total_ttc) . '</td>'; - print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>'; - print '</tr>'; + foreach ($object->tab_next_situation_invoice as $next_invoice) { + $totalpaye = $next_invoice->getSommePaiement(); + $total_next_ht += $next_invoice->total_ht; + $total_next_ttc += $next_invoice->total_ttc; + print '<tr class="oddeven">'; + print '<td>' . $next_invoice->getNomUrl(1) . '</td>'; + print '<td></td>'; + if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; + print '<td align="right">' . price($next_invoice->total_ht) . '</td>'; + print '<td align="right">' . price($next_invoice->total_ttc) . '</td>'; + print '<td align="right">' . $next_invoice->getLibStatut(3, $totalpaye) . '</td>'; + print '</tr>'; - } + } - print '<tr class="oddeven">'; - print '<td colspan="2" align="right"></td>'; - if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; + print '<tr class="oddeven">'; + print '<td colspan="2" align="right"></td>'; + if (! empty($conf->banque->enabled)) print '<td align="right"></td>'; - print '<td align="right"><b>' . price($total_next_ht) . '</b></td>'; - print '<td align="right"><b>' . price($total_next_ttc) . '</b></td>'; - print '<td width="18"> </td>'; - print '</tr>'; - } + print '<td align="right"><b>' . price($total_next_ht) . '</b></td>'; + print '<td align="right"><b>' . price($total_next_ttc) . '</b></td>'; + print '<td width="18"> </td>'; + print '</tr>'; + } - if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) - print '</table>'; - } + if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) + print '</table>'; + } - // List of payments already done + // List of payments already done - print '<table class="noborder paymenttable" width="100%">'; + print '<table class="noborder paymenttable" width="100%">'; - print '<tr class="liste_titre">'; - print '<td class="liste_titre">' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>'; - print '<td class="liste_titre">' . $langs->trans('Date') . '</td>'; - print '<td class="liste_titre">' . $langs->trans('Type') . '</td>'; - if (! empty($conf->banque->enabled)) { - print '<td class="liste_titre" align="right">' . $langs->trans('BankAccount') . '</td>'; - } - print '<td class="liste_titre" align="right">' . $langs->trans('Amount') . '</td>'; - print '<td class="liste_titre" width="18"> </td>'; - print '</tr>'; + print '<tr class="liste_titre">'; + print '<td class="liste_titre">' . ($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>'; + print '<td class="liste_titre">' . $langs->trans('Date') . '</td>'; + print '<td class="liste_titre">' . $langs->trans('Type') . '</td>'; + if (! empty($conf->banque->enabled)) { + print '<td class="liste_titre" align="right">' . $langs->trans('BankAccount') . '</td>'; + } + print '<td class="liste_titre" align="right">' . $langs->trans('Amount') . '</td>'; + print '<td class="liste_titre" width="18"> </td>'; + print '</tr>'; - // Payments already done (from payment on this invoice) - $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; - $sql .= ' c.code as payment_code, c.libelle as payment_label,'; - $sql .= ' pf.amount,'; - $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_paiement as c, ' . MAIN_DB_PREFIX . 'paiement_facture as pf, ' . MAIN_DB_PREFIX . 'paiement as p'; - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; - $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; - $sql .= ' AND c.entity IN (' . getEntity('c_paiement').')'; - $sql .= ' ORDER BY p.datep, p.tms'; + // Payments already done (from payment on this invoice) + $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; + $sql .= ' c.code as payment_code, c.libelle as payment_label,'; + $sql .= ' pf.amount,'; + $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; + $sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_paiement as c, ' . MAIN_DB_PREFIX . 'paiement_facture as pf, ' . MAIN_DB_PREFIX . 'paiement as p'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank as b ON p.fk_bank = b.rowid'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; + $sql .= ' WHERE pf.fk_facture = ' . $object->id . ' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid'; + $sql .= ' AND c.entity IN (' . getEntity('c_paiement').')'; + $sql .= ' ORDER BY p.datep, p.tms'; - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $i = 0; - // if ($object->type != 2) - // { - if ($num > 0) { - while ($i < $num) { - $objp = $db->fetch_object($result); + // if ($object->type != 2) + // { + if ($num > 0) { + while ($i < $num) { + $objp = $db->fetch_object($result); - $paymentstatic->id = $objp->rowid; - $paymentstatic->datepaye = $db->jdate($objp->dp); - $paymentstatic->ref = $objp->ref; - $paymentstatic->num_paiement = $objp->num_paiement; - $paymentstatic->payment_code = $objp->payment_code; + $paymentstatic->id = $objp->rowid; + $paymentstatic->datepaye = $db->jdate($objp->dp); + $paymentstatic->ref = $objp->ref; + $paymentstatic->num_paiement = $objp->num_paiement; + $paymentstatic->payment_code = $objp->payment_code; - print '<tr class="oddeven"><td>'; - print $paymentstatic->getNomUrl(1); - print '</td>'; - print '<td>' . dol_print_date($db->jdate($objp->dp), 'day') . '</td>'; - $label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label; - print '<td>' . $label . ' ' . $objp->num_paiement . '</td>'; - if (! empty($conf->banque->enabled)) - { - $bankaccountstatic->id = $objp->baid; - $bankaccountstatic->ref = $objp->baref; - $bankaccountstatic->label = $objp->baref; + print '<tr class="oddeven"><td>'; + print $paymentstatic->getNomUrl(1); + print '</td>'; + print '<td>' . dol_print_date($db->jdate($objp->dp), 'day') . '</td>'; + $label = ($langs->trans("PaymentType" . $objp->payment_code) != ("PaymentType" . $objp->payment_code)) ? $langs->trans("PaymentType" . $objp->payment_code) : $objp->payment_label; + print '<td>' . $label . ' ' . $objp->num_paiement . '</td>'; + if (! empty($conf->banque->enabled)) + { + $bankaccountstatic->id = $objp->baid; + $bankaccountstatic->ref = $objp->baref; + $bankaccountstatic->label = $objp->baref; $bankaccountstatic->number = $objp->banumber; if (! empty($conf->accounting->enabled)) { @@ -3845,155 +3845,155 @@ else if ($id > 0 || ! empty($ref)) } print '<td align="right">'; - if ($bankaccountstatic->id) - print $bankaccountstatic->getNomUrl(1, 'transactions'); - print '</td>'; - } - print '<td align="right">' . price($sign * $objp->amount) . '</td>'; - print '<td> </td>'; - print '</tr>'; - $i ++; - } - } - /*else { + if ($bankaccountstatic->id) + print $bankaccountstatic->getNomUrl(1, 'transactions'); + print '</td>'; + } + print '<td align="right">' . price($sign * $objp->amount) . '</td>'; + print '<td> </td>'; + print '</tr>'; + $i ++; + } + } + /*else { print '<tr class="oddeven"><td colspan="' . $nbcols . '" class="opacitymedium">' . $langs->trans("None") . '</td><td></td><td></td></tr>'; }*/ - // } - $db->free($result); - } else { - dol_print_error($db); - } + // } + $db->free($result); + } else { + dol_print_error($db); + } - if ($object->type != Facture::TYPE_CREDIT_NOTE) { - // Total already paid - print '<tr><td colspan="' . $nbcols . '" align="right">'; - if ($object->type != Facture::TYPE_DEPOSIT) - print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); - else - print $langs->trans('AlreadyPaid'); - print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>'; + if ($object->type != Facture::TYPE_CREDIT_NOTE) { + // Total already paid + print '<tr><td colspan="' . $nbcols . '" align="right">'; + if ($object->type != Facture::TYPE_DEPOSIT) + print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); + else + print $langs->trans('AlreadyPaid'); + print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>'; - $resteapayeraffiche = $resteapayer; - $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + $resteapayeraffiche = $resteapayer; + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; - // Loop on each credit note or deposit amount applied - $creditnoteamount = 0; - $depositamount = 0; - $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; - $sql .= " re.description, re.fk_facture_source"; - $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; - $sql .= " WHERE fk_facture = " . $object->id; - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - $invoice = new Facture($db); - while ($i < $num) { - $obj = $db->fetch_object($resql); - $invoice->fetch($obj->fk_facture_source); - print '<tr><td colspan="' . $nbcols . '" align="right">'; - if ($invoice->type == Facture::TYPE_CREDIT_NOTE) - print $langs->trans("CreditNote") . ' '; - if ($invoice->type == Facture::TYPE_DEPOSIT) - print $langs->trans("Deposit") . ' '; - print $invoice->getNomUrl(0); - print ' :</td>'; - print '<td align="right">' . price($obj->amount_ttc) . '</td>'; - print '<td align="right">'; - print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>'; - print '</td></tr>'; - $i ++; - if ($invoice->type == Facture::TYPE_CREDIT_NOTE) - $creditnoteamount += $obj->amount_ttc; - if ($invoice->type == Facture::TYPE_DEPOSIT) - $depositamount += $obj->amount_ttc; - } - } else { - dol_print_error($db); - } + // Loop on each credit note or deposit amount applied + $creditnoteamount = 0; + $depositamount = 0; + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql .= " re.description, re.fk_facture_source"; + $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; + $sql .= " WHERE fk_facture = " . $object->id; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + $invoice = new Facture($db); + while ($i < $num) { + $obj = $db->fetch_object($resql); + $invoice->fetch($obj->fk_facture_source); + print '<tr><td colspan="' . $nbcols . '" align="right">'; + if ($invoice->type == Facture::TYPE_CREDIT_NOTE) + print $langs->trans("CreditNote") . ' '; + if ($invoice->type == Facture::TYPE_DEPOSIT) + print $langs->trans("Deposit") . ' '; + print $invoice->getNomUrl(0); + print ' :</td>'; + print '<td align="right">' . price($obj->amount_ttc) . '</td>'; + print '<td align="right">'; + print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>'; + print '</td></tr>'; + $i ++; + if ($invoice->type == Facture::TYPE_CREDIT_NOTE) + $creditnoteamount += $obj->amount_ttc; + if ($invoice->type == Facture::TYPE_DEPOSIT) + $depositamount += $obj->amount_ttc; + } + } else { + dol_print_error($db); + } - // Paye partiellement 'escompte' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { - print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; - print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1); - print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; - $resteapayeraffiche = 0; - $cssforamountpaymentcomplete = ''; - } - // Paye partiellement ou Abandon 'badcustomer' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { - print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; - print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1); - print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; - // $resteapayeraffiche=0; - $cssforamountpaymentcomplete = ''; - } - // Paye partiellement ou Abandon 'product_returned' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { - print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; - print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1); - print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; - $resteapayeraffiche = 0; - $cssforamountpaymentcomplete = ''; - } - // Paye partiellement ou Abandon 'abandon' - if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { - print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; - $text = $langs->trans("HelpAbandonOther"); - if ($object->close_note) - $text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note; - print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1); - print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; - $resteapayeraffiche = 0; - $cssforamountpaymentcomplete = ''; - } + // Paye partiellement 'escompte' + if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { + print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; + print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1); + print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; + $resteapayeraffiche = 0; + $cssforamountpaymentcomplete = ''; + } + // Paye partiellement ou Abandon 'badcustomer' + if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { + print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; + print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1); + print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; + // $resteapayeraffiche=0; + $cssforamountpaymentcomplete = ''; + } + // Paye partiellement ou Abandon 'product_returned' + if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { + print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; + print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1); + print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; + $resteapayeraffiche = 0; + $cssforamountpaymentcomplete = ''; + } + // Paye partiellement ou Abandon 'abandon' + if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'abandon') { + print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">'; + $text = $langs->trans("HelpAbandonOther"); + if ($object->close_note) + $text .= '<br><br><b>' . $langs->trans("Reason") . '</b>:' . $object->close_note; + print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1); + print '</td><td align="right">' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . '</td><td> </td></tr>'; + $resteapayeraffiche = 0; + $cssforamountpaymentcomplete = ''; + } - // Billed - print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($object->total_ttc) . '</td><td> </td></tr>'; + // Billed + print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($object->total_ttc) . '</td><td> </td></tr>'; - // Remainder to pay - print '<tr><td colspan="' . $nbcols . '" align="right">'; - if ($resteapayeraffiche >= 0) - print $langs->trans('RemainderToPay'); - else - print $langs->trans('ExcessReceived'); - print ' :</td>'; - print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>'; - print '<td class="nowrap"> </td></tr>'; - } - else // Credit note - { - $cssforamountpaymentcomplete=''; + // Remainder to pay + print '<tr><td colspan="' . $nbcols . '" align="right">'; + if ($resteapayeraffiche >= 0) + print $langs->trans('RemainderToPay'); + else + print $langs->trans('ExcessReceived'); + print ' :</td>'; + print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($resteapayeraffiche) . '</td>'; + print '<td class="nowrap"> </td></tr>'; + } + else // Credit note + { + $cssforamountpaymentcomplete=''; - // Total already paid back - print '<tr><td colspan="' . $nbcols . '" align="right">'; - print $langs->trans('AlreadyPaidBack'); - print ' :</td><td align="right">' . price($sign * $totalpaye) . '</td><td> </td></tr>'; + // Total already paid back + print '<tr><td colspan="' . $nbcols . '" align="right">'; + print $langs->trans('AlreadyPaidBack'); + print ' :</td><td align="right">' . price($sign * $totalpaye) . '</td><td> </td></tr>'; - // Billed - print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($sign * $object->total_ttc) . '</td><td> </td></tr>'; + // Billed + print '<tr><td colspan="' . $nbcols . '" align="right">' . $langs->trans("Billed") . ' :</td><td align="right">' . price($sign * $object->total_ttc) . '</td><td> </td></tr>'; - // Remainder to pay back - print '<tr><td colspan="' . $nbcols . '" align="right">'; - if ($resteapayeraffiche <= 0) - print $langs->trans('RemainderToPayBack'); - else - print $langs->trans('ExcessPaydBack'); - print ' :</td>'; - print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>'; - print '<td class="nowrap"> </td></tr>'; + // Remainder to pay back + print '<tr><td colspan="' . $nbcols . '" align="right">'; + if ($resteapayeraffiche <= 0) + print $langs->trans('RemainderToPayBack'); + else + print $langs->trans('ExcessPaydBack'); + print ' :</td>'; + print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>'; + print '<td class="nowrap"> </td></tr>'; - // Sold credit note - // print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>'; - // print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * - // $object->total_ttc).'</b></td><td> </td></tr>'; - } + // Sold credit note + // print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>'; + // print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * + // $object->total_ttc).'</b></td><td> </td></tr>'; + } - print '</table>'; + print '</table>'; // Margin Infos if (! empty($conf->margin->enabled)) { - $formmargin->displayMarginInfos($object); + $formmargin->displayMarginInfos($object); } print '</div>'; @@ -4084,7 +4084,7 @@ else if ($id > 0 || ! empty($ref)) '; if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } print '<div class="div-table-responsive-no-min">'; @@ -4110,7 +4110,7 @@ else if ($id > 0 || ! empty($ref)) } print "</table>\n"; - print "</div>"; + print "</div>"; print "</form>\n"; @@ -4138,8 +4138,8 @@ else if ($id > 0 || ! empty($ref)) { if (! $objectidnext && $object->is_last_in_cycle()) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) { print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>'; } else { @@ -4166,7 +4166,7 @@ else if ($id > 0 || ! empty($ref)) || ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id)) || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))) && ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data - && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->invoice_advance->reopen))) // A paid invoice (partially or completely) + && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->invoice_advance->reopen))) // A paid invoice (partially or completely) { if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice { @@ -4179,7 +4179,7 @@ else if ($id > 0 || ! empty($ref)) // Validate if ($object->statut == Facture::STATUS_DRAFT && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (! empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate))) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->validate))) { print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=valid">' . $langs->trans('Validate') . '</a></div>'; } @@ -4200,22 +4200,22 @@ else if ($id > 0 || ! empty($ref)) // Request a direct debit order if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0) { - if ($resteapayer > 0) - { - if ($user->rights->prelevement->bons->creer) - { - $langs->load("withdrawals"); - print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("MakeWithdrawRequest")).'">'.$langs->trans("MakeWithdrawRequest").'</a>'; - } - else - { - //print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("MakeWithdrawRequest").'</a>'; - } - } - else - { - //print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AmountMustBePositive")).'">'.$langs->trans("MakeWithdrawRequest").'</a>'; - } + if ($resteapayer > 0) + { + if ($user->rights->prelevement->bons->creer) + { + $langs->load("withdrawals"); + print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("MakeWithdrawRequest")).'">'.$langs->trans("MakeWithdrawRequest").'</a>'; + } + else + { + //print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("MakeWithdrawRequest").'</a>'; + } + } + else + { + //print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AmountMustBePositive")).'">'.$langs->trans("MakeWithdrawRequest").'</a>'; + } } // Create payment diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index deffb252d9c..fbdabad8fa0 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -34,8 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - //require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; @@ -129,526 +129,526 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if (GETPOST('cancel','alpha')) $action=''; + if (GETPOST('cancel','alpha')) $action=''; - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - // Set note - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + // Set note + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once - include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - // Do we click on purge search criteria ? - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers - { - $search_ref=''; - $search_societe=''; - $search_montant_ht=''; - $search_montant_vat=''; - $search_montant_ttc=''; - $search_montant_mode=''; - $search_montant_term=''; - $day=''; - $year=''; - $month=''; - $day_date_when=''; - $year_date_when=''; - $month_date_when=''; - $search_recurring=''; - $search_frequency=''; - $search_unit_frequency=''; - $search_array_options=array(); - } + // Do we click on purge search criteria ? + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers + { + $search_ref=''; + $search_societe=''; + $search_montant_ht=''; + $search_montant_vat=''; + $search_montant_ttc=''; + $search_montant_mode=''; + $search_montant_term=''; + $day=''; + $year=''; + $month=''; + $day_date_when=''; + $year_date_when=''; + $month_date_when=''; + $search_recurring=''; + $search_frequency=''; + $search_unit_frequency=''; + $search_array_options=array(); + } - // Mass actions - /*$objectclass='MyObject'; + // Mass actions + /*$objectclass='MyObject'; $objectlabel='MyObject'; $permtoread = $user->rights->mymodule->read; $permtodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ - // Create predefined invoice - if ($action == 'add') - { - if (! GETPOST('titre')) - { - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), null, 'errors'); - $action = "create"; - $error++; - } + // Create predefined invoice + if ($action == 'add') + { + if (! GETPOST('titre')) + { + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), null, 'errors'); + $action = "create"; + $error++; + } - $frequency=GETPOST('frequency', 'int'); - $reyear=GETPOST('reyear'); - $remonth=GETPOST('remonth'); - $reday=GETPOST('reday'); - $rehour=GETPOST('rehour'); - $remin=GETPOST('remin'); - $nb_gen_max=GETPOST('nb_gen_max', 'int'); - //if (empty($nb_gen_max)) $nb_gen_max =0; + $frequency=GETPOST('frequency', 'int'); + $reyear=GETPOST('reyear'); + $remonth=GETPOST('remonth'); + $reday=GETPOST('reday'); + $rehour=GETPOST('rehour'); + $remin=GETPOST('remin'); + $nb_gen_max=GETPOST('nb_gen_max', 'int'); + //if (empty($nb_gen_max)) $nb_gen_max =0; - if (GETPOST('frequency')) - { - if (empty($reyear) || empty($remonth) || empty($reday)) - { - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Date")), null, 'errors'); - $action = "create"; - $error++; - } - if ($nb_gen_max === '') - { - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("MaxPeriodNumber")), null, 'errors'); - $action = "create"; - $error++; - } - } + if (GETPOST('frequency')) + { + if (empty($reyear) || empty($remonth) || empty($reday)) + { + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Date")), null, 'errors'); + $action = "create"; + $error++; + } + if ($nb_gen_max === '') + { + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("MaxPeriodNumber")), null, 'errors'); + $action = "create"; + $error++; + } + } - if (! $error) - { - $object->titre = GETPOST('titre', 'alpha'); - $object->note_private = GETPOST('note_private','none'); - $object->note_public = GETPOST('note_public','none'); - $object->usenewprice = GETPOST('usenewprice'); + if (! $error) + { + $object->titre = GETPOST('titre', 'alpha'); + $object->note_private = GETPOST('note_private','none'); + $object->note_public = GETPOST('note_public','none'); + $object->usenewprice = GETPOST('usenewprice'); - $object->frequency = $frequency; - $object->unit_frequency = GETPOST('unit_frequency', 'alpha'); - $object->nb_gen_max = $nb_gen_max; - $object->auto_validate = GETPOST('auto_validate', 'int'); + $object->frequency = $frequency; + $object->unit_frequency = GETPOST('unit_frequency', 'alpha'); + $object->nb_gen_max = $nb_gen_max; + $object->auto_validate = GETPOST('auto_validate', 'int'); - $object->fk_project = $projectid; + $object->fk_project = $projectid; - $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); - $object->date_when = $date_next_execution; + $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); + $object->date_when = $date_next_execution; - // Get first contract linked to invoice used to generate template - if ($id > 0) - { - $srcObject = new Facture($db); - $srcObject->fetch(GETPOST('facid','int')); + // Get first contract linked to invoice used to generate template + if ($id > 0) + { + $srcObject = new Facture($db); + $srcObject->fetch(GETPOST('facid','int')); - $srcObject->fetchObjectLinked(); + $srcObject->fetchObjectLinked(); - if (! empty($srcObject->linkedObjectsIds['contrat'])) - { - $contractidid = reset($srcObject->linkedObjectsIds['contrat']); + if (! empty($srcObject->linkedObjectsIds['contrat'])) + { + $contractidid = reset($srcObject->linkedObjectsIds['contrat']); - $object->origin = 'contrat'; - $object->origin_id = $contractidid; - $object->linked_objects[$object->origin] = $object->origin_id; - } - } + $object->origin = 'contrat'; + $object->origin_id = $contractidid; + $object->linked_objects[$object->origin] = $object->origin_id; + } + } - $db->begin(); + $db->begin(); - $oldinvoice = new Facture($db); - $oldinvoice->fetch($id); + $oldinvoice = new Facture($db); + $oldinvoice->fetch($id); - $result = $object->create($user, $oldinvoice->id); - if ($result > 0) - { - $result=$oldinvoice->delete($user, 1); - if ($result < 0) - { - $error++; - setEventMessages($oldinvoice->error, $oldinvoice->errors, 'errors'); - $action = "create"; - } - } - else - { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - $action = "create"; - } + $result = $object->create($user, $oldinvoice->id); + if ($result > 0) + { + $result=$oldinvoice->delete($user, 1); + if ($result < 0) + { + $error++; + setEventMessages($oldinvoice->error, $oldinvoice->errors, 'errors'); + $action = "create"; + } + } + else + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + $action = "create"; + } - if (! $error) - { - $db->commit(); + if (! $error) + { + $db->commit(); - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); - exit; - } - else - { - $db->rollback(); + header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); + exit; + } + else + { + $db->rollback(); - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - $action = "create"; - } - } - } + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + $action = "create"; + } + } + } - // Delete - if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer) - { - $object->delete($user); - header("Location: " . $_SERVER['PHP_SELF'] ); - exit; - } + // Delete + if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer) + { + $object->delete($user); + header("Location: " . $_SERVER['PHP_SELF'] ); + exit; + } - // Update field - // Set condition - if ($action == 'setconditions' && $user->rights->facture->creer) - { - $result=$object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); + // Update field + // Set condition + if ($action == 'setconditions' && $user->rights->facture->creer) + { + $result=$object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); - } - // Set mode - elseif ($action == 'setmode' && $user->rights->facture->creer) - { - $result=$object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); - } - // Set project - elseif ($action == 'classin' && $user->rights->facture->creer) - { - $object->setProject(GETPOST('projectid', 'int')); - } - // Set bank account - elseif ($action == 'setref' && $user->rights->facture->creer) - { - //var_dump(GETPOST('ref', 'alpha'));exit; - $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); - if ($result > 0) - { - $object->titre = GETPOST('ref', 'alpha'); - $object->ref = $object->titre; - } - else dol_print_error($db, $object->error, $object->errors); - } - // Set bank account - elseif ($action == 'setbankaccount' && $user->rights->facture->creer) - { - $result=$object->setBankAccount(GETPOST('fk_account', 'int')); - } - // Set frequency and unit frequency - elseif ($action == 'setfrequency' && $user->rights->facture->creer) - { - $object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha')); - } - // Set next date of execution - elseif ($action == 'setdate_when' && $user->rights->facture->creer) - { - $date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')); - if (!empty($date)) $object->setNextDate($date); - } - // Set max period - elseif ($action == 'setnb_gen_max' && $user->rights->facture->creer) - { - $object->setMaxPeriod(GETPOST('nb_gen_max', 'int')); - } - // Set auto validate - elseif ($action == 'setauto_validate' && $user->rights->facture->creer) - { - $object->setAutoValidate(GETPOST('auto_validate', 'int')); - } + } + // Set mode + elseif ($action == 'setmode' && $user->rights->facture->creer) + { + $result=$object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + } + // Set project + elseif ($action == 'classin' && $user->rights->facture->creer) + { + $object->setProject(GETPOST('projectid', 'int')); + } + // Set bank account + elseif ($action == 'setref' && $user->rights->facture->creer) + { + //var_dump(GETPOST('ref', 'alpha'));exit; + $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); + if ($result > 0) + { + $object->titre = GETPOST('ref', 'alpha'); + $object->ref = $object->titre; + } + else dol_print_error($db, $object->error, $object->errors); + } + // Set bank account + elseif ($action == 'setbankaccount' && $user->rights->facture->creer) + { + $result=$object->setBankAccount(GETPOST('fk_account', 'int')); + } + // Set frequency and unit frequency + elseif ($action == 'setfrequency' && $user->rights->facture->creer) + { + $object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha')); + } + // Set next date of execution + elseif ($action == 'setdate_when' && $user->rights->facture->creer) + { + $date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')); + if (!empty($date)) $object->setNextDate($date); + } + // Set max period + elseif ($action == 'setnb_gen_max' && $user->rights->facture->creer) + { + $object->setMaxPeriod(GETPOST('nb_gen_max', 'int')); + } + // Set auto validate + elseif ($action == 'setauto_validate' && $user->rights->facture->creer) + { + $object->setAutoValidate(GETPOST('auto_validate', 'int')); + } - // Delete line - if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer) - { - $object->fetch($id); - $object->fetch_thirdparty(); + // Delete line + if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->facture->creer) + { + $object->fetch($id); + $object->fetch_thirdparty(); - $db->begin(); + $db->begin(); - $line=new FactureLigneRec($db); + $line=new FactureLigneRec($db); - // For triggers - $line->id = $lineid; + // For triggers + $line->id = $lineid; - if ($line->delete($user) > 0) - { - $result=$object->update_price(1); + if ($line->delete($user) > 0) + { + $result=$object->update_price(1); - if ($result > 0) - { - $db->commit(); - $object->fetch($object->id); // Reload lines - } - else - { - $db->rollback(); - setEventMessages($db->lasterror(), null, 'errors'); - } - } - else - { - $db->rollback(); - setEventMessages($line->error, $line->errors, 'errors'); - } - } - else if ($action == 'update_extras') - { - // Fill array 'array_options' with data from update form - $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); - if ($ret < 0) - $error ++; + if ($result > 0) + { + $db->commit(); + $object->fetch($object->id); // Reload lines + } + else + { + $db->rollback(); + setEventMessages($db->lasterror(), null, 'errors'); + } + } + else + { + $db->rollback(); + setEventMessages($line->error, $line->errors, 'errors'); + } + } + else if ($action == 'update_extras') + { + // Fill array 'array_options' with data from update form + $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + if ($ret < 0) + $error ++; - if (! $error) { + if (! $error) { - $result = $object->insertExtraFields(); - if ($result < 0) { - $error ++; - } - } else if ($reshook < 0) - $error ++; + $result = $object->insertExtraFields(); + if ($result < 0) { + $error ++; + } + } else if ($reshook < 0) + $error ++; - if ($error) { - $action = 'edit_extras'; - setEventMessages($object->error, $object->errors, 'errors'); - } - } + if ($error) { + $action = 'edit_extras'; + setEventMessages($object->error, $object->errors, 'errors'); + } + } - // Add a new line - if ($action == 'addline' && $user->rights->facture->creer) - { - $langs->load('errors'); - $error = 0; + // Add a new line + if ($action == 'addline' && $user->rights->facture->creer) + { + $langs->load('errors'); + $error = 0; - // Set if we used free entry or predefined product - $predef=''; - $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); - $price_ht = GETPOST('price_ht'); - if (GETPOST('prod_entry_mode') == 'free') - { - $idprod=0; - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - } - else - { - $idprod=GETPOST('idprod', 'int'); - $tva_tx = ''; - } + // Set if we used free entry or predefined product + $predef=''; + $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); + if (GETPOST('prod_entry_mode') == 'free') + { + $idprod=0; + $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); + } + else + { + $idprod=GETPOST('idprod', 'int'); + $tva_tx = ''; + } - $qty = GETPOST('qty' . $predef); - $remise_percent = GETPOST('remise_percent' . $predef); + $qty = GETPOST('qty' . $predef); + $remise_percent = GETPOST('remise_percent' . $predef); - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - // Unset extrafield - if (is_array($extralabelsline)) - { - // Get extra fields - foreach ($extralabelsline as $key => $value) { - unset($_POST["options_" . $key . $predef]); - } - } + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + // Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key . $predef]); + } + } - if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { - setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; - } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); - $error ++; - } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); - $error ++; - } - if ($qty == '') { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error ++; - } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); - $error ++; - } - if ($qty < 0) { - $langs->load("errors"); - setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; - } + if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { + setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error ++; + } + if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); + $error ++; + } + if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); + $error ++; + } + if ($qty == '') { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error ++; + } + if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); + $error ++; + } + if ($qty < 0) { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); + $error ++; + } - if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) - { - $ret = $object->fetch($id); - if ($ret < 0) { - dol_print_error($db, $object->error); - exit(); - } - $ret = $object->fetch_thirdparty(); + if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) + { + $ret = $object->fetch($id); + if ($ret < 0) { + dol_print_error($db, $object->error); + exit(); + } + $ret = $object->fetch_thirdparty(); - // Clean parameters - $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); - $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); - $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); + // Clean parameters + $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); + $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); + $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); - // Define special_code for special lines - $special_code = 0; - // if (empty($_POST['qty'])) $special_code=3; // Options should not exists on invoices + // Define special_code for special lines + $special_code = 0; + // if (empty($_POST['qty'])) $special_code=3; // Options should not exists on invoices - // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $tva_tx par celui du produit - // Ecrase $base_price_type par celui du produit - // Replaces $fk_unit with the product's - if (! empty($idprod)) - { - $prod = new Product($db); - $prod->fetch($idprod); + // Ecrase $pu par celui du produit + // Ecrase $desc par celui du produit + // Ecrase $tva_tx par celui du produit + // Ecrase $base_price_type par celui du produit + // Replaces $fk_unit with the product's + if (! empty($idprod)) + { + $prod = new Product($db); + $prod->fetch($idprod); - $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); + $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); - // Update if prices fields are defined - $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); - $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); - if (empty($tva_tx)) $tva_npr=0; + // Update if prices fields are defined + $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); + $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); + if (empty($tva_tx)) $tva_npr=0; - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; - // We define price for product - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) - { - $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; - $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; - $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; - $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility - { - if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; - if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; - if (empty($tva_tx)) $tva_npr=0; - } - } - elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) - { - require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + // We define price for product + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + { + $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility + { + if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; + if (empty($tva_tx)) $tva_npr=0; + } + } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; - $prodcustprice = new Productcustomerprice($db); + $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); - if ($result) - { - if (count($prodcustprice->lines) > 0) - { - $pu_ht = price($prodcustprice->lines[0]->price); - $pu_ttc = price($prodcustprice->lines[0]->price_ttc); - $price_base_type = $prodcustprice->lines[0]->price_base_type; - $tva_tx = $prodcustprice->lines[0]->tva_tx; - } - } - } + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + if ($result) + { + if (count($prodcustprice->lines) > 0) + { + $pu_ht = price($prodcustprice->lines[0]->price); + $pu_ttc = price($prodcustprice->lines[0]->price_ttc); + $price_base_type = $prodcustprice->lines[0]->price_base_type; + $tva_tx = $prodcustprice->lines[0]->tva_tx; + } + } + } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx)); - // if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ? - if (! empty($price_ht)) - { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); - } - // On reevalue prix selon taux tva car taux tva transaction peut etre different - // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - elseif ($tmpvat != $tmpprodvat) - { - if ($price_base_type != 'HT') - { - $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); - } - else - { - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); - } - } + // if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ? + if (! empty($price_ht)) + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); + } + // On reevalue prix selon taux tva car taux tva transaction peut etre different + // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). + elseif ($tmpvat != $tmpprodvat) + { + if ($price_base_type != 'HT') + { + $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); + } + else + { + $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); + } + } - $desc = ''; + $desc = ''; - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) - { - $outputlangs = $langs; - $newlang = ''; - if (empty($newlang) && GETPOST('lang_id','aZ09')) - $newlang = GETPOST('lang_id','aZ09'); - if (empty($newlang)) - $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $outputlangs = $langs; + $newlang = ''; + if (empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); + if (empty($newlang)) + $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } - $desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; - } - else - { - $desc = $prod->description; - } + $desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; + } + else + { + $desc = $prod->description; + } - $desc = dol_concatdesc($desc, $product_desc); + $desc = dol_concatdesc($desc, $product_desc); - // Add custom code and origin country into description - if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) - { - $tmptxt = '('; - if (! empty($prod->customcode)) - $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; - if (! empty($prod->customcode) && ! empty($prod->country_code)) - $tmptxt .= ' - '; - if (! empty($prod->country_code)) - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); - $tmptxt .= ')'; - $desc = dol_concatdesc($desc, $tmptxt); + // Add custom code and origin country into description + if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) + { + $tmptxt = '('; + if (! empty($prod->customcode)) + $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; + if (! empty($prod->customcode) && ! empty($prod->country_code)) + $tmptxt .= ' - '; + if (! empty($prod->country_code)) + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); + $tmptxt .= ')'; + $desc = dol_concatdesc($desc, $tmptxt); - } + } - $type = $prod->type; - $fk_unit = $prod->fk_unit; + $type = $prod->type; + $fk_unit = $prod->fk_unit; - } - else - { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); - $tva_tx = str_replace('*', '', $tva_tx); - if (empty($tva_tx)) $tva_npr=0; - $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); - $desc = $product_desc; - $type = GETPOST('type'); - $fk_unit= GETPOST('units', 'alpha'); - } + } + else + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); + $tva_tx = str_replace('*', '', $tva_tx); + if (empty($tva_tx)) $tva_npr=0; + $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); + $desc = $product_desc; + $type = GETPOST('type'); + $fk_unit= GETPOST('units', 'alpha'); + } - // Margin - $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); - $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value + // Margin + $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); + $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value - // Local Taxes - $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); - $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr); + // Local Taxes + $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); + $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr); - $info_bits = 0; - if ($tva_npr) - $info_bits |= 0x01; + $info_bits = 0; + if ($tva_npr) + $info_bits |= 0x01; - if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) - { - $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); - setEventMessages($mesg, null, 'errors'); - } - else - { - // Insert line - $result = $object->addline($desc, $pu_ht, $qty, $tva_tx,$localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit); + if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) + { + $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); + setEventMessages($mesg, null, 'errors'); + } + else + { + // Insert line + $result = $object->addline($desc, $pu_ht, $qty, $tva_tx,$localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit); - if ($result > 0) - { - /*if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + if ($result > 0) + { + /*if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; @@ -665,114 +665,114 @@ if (empty($reshook)) $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); }*/ - $object->fetch($object->id); // Reload lines + $object->fetch($object->id); // Reload lines - unset($_POST['prod_entry_mode']); + unset($_POST['prod_entry_mode']); - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['multicurrency_price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - unset($_POST['np_marginRate']); - unset($_POST['np_markRate']); - unset($_POST['dp_desc']); - unset($_POST['idprod']); - unset($_POST['units']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); + unset($_POST['dp_desc']); + unset($_POST['idprod']); + unset($_POST['units']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); - unset($_POST['situations']); - unset($_POST['progress']); - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + unset($_POST['situations']); + unset($_POST['progress']); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } - $action = ''; - } - } - } + $action = ''; + } + } + } - elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha')) - { - if (! $object->fetch($id) > 0) dol_print_error($db); - $object->fetch_thirdparty(); + elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha')) + { + if (! $object->fetch($id) > 0) dol_print_error($db); + $object->fetch_thirdparty(); - // Clean parameters - $date_start = ''; - $date_end = ''; - //$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - //$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - $description = dol_htmlcleanlastbr(GETPOST('product_desc','none') ? GETPOST('product_desc','none') : GETPOST('desc','none')); - $pu_ht = GETPOST('price_ht'); - $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); - $qty = GETPOST('qty'); + // Clean parameters + $date_start = ''; + $date_end = ''; + //$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + //$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + $description = dol_htmlcleanlastbr(GETPOST('product_desc','none') ? GETPOST('product_desc','none') : GETPOST('desc','none')); + $pu_ht = GETPOST('price_ht'); + $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); + $qty = GETPOST('qty'); - // Define info_bits - $info_bits = 0; - if (preg_match('/\*/', $vat_rate)) - $info_bits |= 0x01; + // Define info_bits + $info_bits = 0; + if (preg_match('/\*/', $vat_rate)) + $info_bits |= 0x01; - // Define vat_rate - $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); - $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); + // Define vat_rate + $vat_rate = str_replace('*', '', $vat_rate); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); - // Add buying price - $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); - $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value + // Add buying price + $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); + $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); - $objectline = new FactureLigneRec($db); - if ($objectline->fetch(GETPOST('lineid'))) - { - $objectline->array_options=$array_options; - $result=$objectline->insertExtraFields(); - if ($result < 0) - { - setEventMessages($langs->trans('Error').$result, null, 'errors'); - } - } + $objectline = new FactureLigneRec($db); + if ($objectline->fetch(GETPOST('lineid'))) + { + $objectline->array_options=$array_options; + $result=$objectline->insertExtraFields(); + if ($result < 0) + { + setEventMessages($langs->trans('Error').$result, null, 'errors'); + } + } - // Unset extrafield - if (is_array($extralabelsline)) - { - // Get extra fields - foreach ($extralabelsline as $key => $value) - { - unset($_POST["options_" . $key]); - } - } + // Unset extrafield + if (is_array($extralabelsline)) + { + // Get extra fields + foreach ($extralabelsline as $key => $value) + { + unset($_POST["options_" . $key]); + } + } - // Define special_code for special lines - $special_code=GETPOST('special_code'); - if (! GETPOST('qty')) $special_code=3; + // Define special_code for special lines + $special_code=GETPOST('special_code'); + if (! GETPOST('qty')) $special_code=3; - /*$line = new FactureLigne($db); + /*$line = new FactureLigne($db); $line->fetch(GETPOST('lineid')); $percent = $line->get_prev_progress($object->id); @@ -784,69 +784,69 @@ if (empty($reshook)) $result = -1; }*/ - // Check minimum price - $productid = GETPOST('productid', 'int'); - if (! empty($productid)) - { - $product = new Product($db); - $product->fetch($productid); + // Check minimum price + $productid = GETPOST('productid', 'int'); + if (! empty($productid)) + { + $product = new Product($db); + $product->fetch($productid); - $type = $product->type; + $type = $product->type; - $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) - $price_min = $product->multiprices_min [$object->thirdparty->price_level]; + $price_min = $product->price_min; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + $price_min = $product->multiprices_min [$object->thirdparty->price_level]; - $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); + $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); - // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { - setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); - $error ++; - } - } else { - $type = GETPOST('type'); - $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); + // Check price is not lower than minimum (check is done only for standard or replacement invoices) + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { + setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); + $error ++; + } + } else { + $type = GETPOST('type'); + $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); - // Check parameters - if (GETPOST('type') < 0) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); - $error ++; - } - } - if ($qty < 0) { - $langs->load("errors"); - setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); - $error ++; - } + // Check parameters + if (GETPOST('type') < 0) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); + $error ++; + } + } + if ($qty < 0) { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); + $error ++; + } - // Update line - if (! $error) - { - $result = $object->updateline( - GETPOST('lineid'), - $description, - $pu_ht, - $qty, - $vat_rate, - $localtax1_rate, - $localtax1_rate, - GETPOST('productid'), - GETPOST('remise_percent'), - 'HT', - $info_bits, - 0, - 0, - $type, - 0, - $special_code, - $label, - GETPOST('units') - ); + // Update line + if (! $error) + { + $result = $object->updateline( + GETPOST('lineid'), + $description, + $pu_ht, + $qty, + $vat_rate, + $localtax1_rate, + $localtax1_rate, + GETPOST('productid'), + GETPOST('remise_percent'), + 'HT', + $info_bits, + 0, + 0, + $type, + 0, + $special_code, + $label, + GETPOST('units') + ); - if ($result >= 0) - { - /*if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + if ($result >= 0) + { + /*if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language $outputlangs = $langs; $newlang = ''; @@ -863,50 +863,50 @@ if (empty($reshook)) $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); }*/ - $object->fetch($object->id); // Reload lines + $object->fetch($object->id); // Reload lines - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['productid']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['multicurrency_price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - unset($_POST['np_marginRate']); - unset($_POST['np_markRate']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); - unset($_POST['dp_desc']); - unset($_POST['idprod']); - unset($_POST['units']); + unset($_POST['dp_desc']); + unset($_POST['idprod']); + unset($_POST['units']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); - unset($_POST['situations']); - unset($_POST['progress']); - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } + unset($_POST['situations']); + unset($_POST['progress']); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } } @@ -987,7 +987,7 @@ if ($action == 'create') $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; foreach($substitutionarray as $key => $val) { - $htmltext.=$key.' = '.$langs->trans($val).'<br>'; + $htmltext.=$key.' = '.$langs->trans($val).'<br>'; } $htmltext.='</i>'; @@ -998,20 +998,20 @@ if ($action == 'create') print '</td>'; print '<td colspan="2">'; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); - print $doleditor->Create(1); + print $doleditor->Create(1); // Private note if (empty($user->societe_id)) { - print '<tr>'; - print '<td class="tdtop">'; - print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'); - print '</td>'; - print '<td valign="top" colspan="2">'; - $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); - print $doleditor->Create(1); - // print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea> - print '</td></tr>'; + print '<tr>'; + print '<td class="tdtop">'; + print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'); + print '</td>'; + print '<td valign="top" colspan="2">'; + $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + print $doleditor->Create(1); + // print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea> + print '</td></tr>'; } // Author @@ -1083,7 +1083,7 @@ if ($action == 'create') print "</table>"; - dol_fiche_end(); + dol_fiche_end(); $title = $langs->trans("ProductsAndServices"); @@ -1102,10 +1102,10 @@ if ($action == 'create') // Show object lines if (! empty($object->lines)) { - $disableedit=1; - $disablemove=1; - $disableremove=1; - $ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice + $disableedit=1; + $disablemove=1; + $disableremove=1; + $ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice } print "</table>\n"; @@ -1125,9 +1125,9 @@ if ($action == 'create') print "</table>\n"; print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'">'; - print '     '; - print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">'; - print '</div>'; + print '     '; + print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">'; + print '</div>'; print "</form>\n"; } else @@ -1171,53 +1171,53 @@ else if ($action != 'editref') $morehtmlref.=$form->editfieldkey($object->ref, 'ref', $object->ref, $object, $user->rights->facture->creer, '', '', 0, 2); else $morehtmlref.= $form->editfieldval('', 'ref', $object->ref, $object, $user->rights->facture->creer, 'string'); - $morehtmlref.='<div class="refidno">'; - // Ref customer - //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1); - //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='<br>'.$langs->trans('Project') . ' '; - if ($user->rights->facture->creer) - { - if ($action != 'classify') - $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; - $morehtmlref.='<input type="hidden" name="action" value="classin">'; - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; - $morehtmlref.='</form>'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; - $morehtmlref.=$proj->ref; - $morehtmlref.='</a>'; - } else { - $morehtmlref.=''; - } - } - } - $morehtmlref.='</div>'; + $morehtmlref.='<div class="refidno">'; + // Ref customer + //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', 0, 1); + //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='<br>'.$langs->trans('Project') . ' '; + if ($user->rights->facture->creer) + { + if ($action != 'classify') + $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; + $morehtmlref.='<input type="hidden" name="action" value="classin">'; + $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; + $morehtmlref.='</form>'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; + $morehtmlref.=$proj->ref; + $morehtmlref.='</a>'; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.='</div>'; - dol_banner_tab($object, 'ref', $linkback, 1, 'titre', 'none', $morehtmlref, '', 0, '', $morehtmlright); + dol_banner_tab($object, 'ref', $linkback, 1, 'titre', 'none', $morehtmlref, '', 0, '', $morehtmlright); - print '<div class="fichecenter">'; - print '<div class="fichehalfleft">'; - print '<div class="underbanner clearboth"></div>'; + print '<div class="fichecenter">'; + print '<div class="fichehalfleft">'; + print '<div class="underbanner clearboth"></div>'; - print '<table class="border" width="100%">'; + print '<table class="border" width="100%">'; print '<tr><td class="titlefield">'.$langs->trans("Author").'</td><td colspan="3">'.$author->getFullName($langs)."</td></tr>"; @@ -1309,7 +1309,7 @@ else $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; foreach($substitutionarray as $key => $val) { - $htmltext.=$key.' = '.$langs->trans($val).'<br>'; + $htmltext.=$key.' = '.$langs->trans($val).'<br>'; } $htmltext.='</i>'; @@ -1337,16 +1337,16 @@ else print $langs->trans('RIB'); print '<td>'; if (($action != 'editbankaccount') && $user->rights->facture->creer && ! empty($object->brouillon)) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print "</td>"; print '</tr>'; @@ -1356,12 +1356,12 @@ else $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - print '</table>'; + print '</table>'; - print '</div>'; - print '<div class="fichehalfright">'; - print '<div class="ficheaddleft">'; - print '<div class="underbanner clearboth"></div>'; + print '</div>'; + print '<div class="fichehalfright">'; + print '<div class="ficheaddleft">'; + print '<div class="underbanner clearboth"></div>'; /* @@ -1397,13 +1397,13 @@ else } else { - if ($object->frequency > 0) - { + if ($object->frequency > 0) + { print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); - } - else - { - print $langs->trans("NotARecurringInvoiceTemplate"); + } + else + { + print $langs->trans("NotARecurringInvoiceTemplate"); } } print '</td></tr>'; @@ -1412,16 +1412,16 @@ else print '<tr><td>'; if ($action == 'date_when' || $object->frequency > 0) { - print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); + print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); } else { - print $langs->trans("NextDateToExecution"); + print $langs->trans("NextDateToExecution"); } print '</td><td>'; if ($action == 'date_when' || $object->frequency > 0) { - print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); + print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); } print '</td>'; print '</tr>'; @@ -1430,20 +1430,20 @@ else print '<tr><td>'; if ($action == 'nb_gen_max' || $object->frequency > 0) { - print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer); + print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer); } else { - print $langs->trans("MaxPeriodNumber"); + print $langs->trans("MaxPeriodNumber"); } print '</td><td>'; if ($action == 'nb_gen_max' || $object->frequency > 0) { - print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', $object, $user->rights->facture->creer); + print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', $object, $user->rights->facture->creer); } else { - print ''; + print ''; } print '</td>'; print '</tr>'; @@ -1451,51 +1451,51 @@ else // Status of generated invoices print '<tr><td>'; if ($action == 'auto_validate' || $object->frequency > 0) - print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer); + print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer); else - print $langs->trans("StatusOfGeneratedInvoices"); + print $langs->trans("StatusOfGeneratedInvoices"); print '</td><td>'; - $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); + $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); if ($action == 'auto_validate' || $object->frequency > 0) { - print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer, $select); + print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer, $select); } print '</td>'; print '</tr>'; print '</table>'; - // Frequencry/Recurring section - if ($object->frequency > 0) - { - print '<br>'; + // Frequencry/Recurring section + if ($object->frequency > 0) + { + print '<br>'; - if (empty($conf->cron->enabled)) - { - print info_admin($langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name"))); - } + if (empty($conf->cron->enabled)) + { + print info_admin($langs->trans("EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name"))); + } - print '<div class="underbanner clearboth"></div>'; - print '<table class="border centpercent">'; + print '<div class="underbanner clearboth"></div>'; + print '<table class="border centpercent">'; - // Nb of generation already done - print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; - print '<td>'; - print $object->nb_gen_done?$object->nb_gen_done:'0'; - print '</td>'; - print '</tr>'; + // Nb of generation already done + print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; + print '<td>'; + print $object->nb_gen_done?$object->nb_gen_done:'0'; + print '</td>'; + print '</tr>'; - // Date last - print '<tr><td>'; - print $langs->trans("DateLastGeneration"); - print '</td><td>'; - print dol_print_date($object->date_last_gen, 'dayhour'); - print '</td>'; - print '</tr>'; + // Date last + print '<tr><td>'; + print $langs->trans("DateLastGeneration"); + print '</td><td>'; + print dol_print_date($object->date_last_gen, 'dayhour'); + print '</td>'; + print '</tr>'; - print '</table>'; + print '</table>'; - print '<br>'; + print '<br>'; } print '</div>'; @@ -1514,7 +1514,7 @@ else '; if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } print '<div class="div-table-responsive-no-min">'; @@ -1522,22 +1522,22 @@ else // Show object lines if (! empty($object->lines)) { - //$disableedit=1; - //$disablemove=1; - $ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice + //$disableedit=1; + //$disablemove=1; + $ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice } // Form to add new line if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline') { - if ($action != 'editline') - { - // Add free products/services - $object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice + if ($action != 'editline') + { + // Add free products/services + $object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice - $parameters = array(); - $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - } + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + } } print "</table>\n"; @@ -1570,13 +1570,13 @@ else else { print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; - } - } + } + } } else { print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("CreateBill").'</a></div>'; - } + } //} //if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) @@ -1594,12 +1594,12 @@ else // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice')); + $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '</div></div>'; + print '</div></div>'; } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 8c8a3c2fc11..2122c958e34 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -109,16 +109,16 @@ if (empty($reshook)) if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) { - $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment')); + $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment')); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - setEventMessages($object->error, $object->errors, 'errors'); - } + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + setEventMessages($object->error, $object->errors, 'errors'); + } } else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) @@ -130,47 +130,47 @@ if (empty($reshook)) } if (! $error) { - $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment'))); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } } // Si ajout champ produit predefini if (GETPOST('mode')=='predefined') { - $date_start=''; - $date_end=''; - if (GETPOST('date_startmonth') && GETPOST('date_startday') && GETPOST('date_startyear')) - { - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - } - if (GETPOST('date_endmonth') && GETPOST('date_endday') && GETPOST('date_endyear')) - { - $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - } + $date_start=''; + $date_end=''; + if (GETPOST('date_startmonth') && GETPOST('date_startday') && GETPOST('date_startyear')) + { + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + } + if (GETPOST('date_endmonth') && GETPOST('date_endday') && GETPOST('date_endyear')) + { + $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + } } // Si ajout champ produit libre if (GETPOST('mode')=='libre') { - $date_start_sl=''; - $date_end_sl=''; - if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) - { - $date_start_sl=dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear')); - } - if (GETPOST('date_end_slmonth') && GETPOST('date_end_slday') && GETPOST('date_end_slyear')) - { - $date_end_sl=dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear')); - } + $date_start_sl=''; + $date_end_sl=''; + if (GETPOST('date_start_slmonth') && GETPOST('date_start_slday') && GETPOST('date_start_slyear')) + { + $date_start_sl=dol_mktime(GETPOST('date_start_slhour'), GETPOST('date_start_slmin'), 0, GETPOST('date_start_slmonth'), GETPOST('date_start_slday'), GETPOST('date_start_slyear')); + } + if (GETPOST('date_end_slmonth') && GETPOST('date_end_slday') && GETPOST('date_end_slyear')) + { + $date_end_sl=dol_mktime(GETPOST('date_end_slhour'), GETPOST('date_end_slmin'), 0, GETPOST('date_end_slmonth'), GETPOST('date_end_slday'), GETPOST('date_end_slyear')); + } } // Param dates @@ -181,23 +181,23 @@ if (empty($reshook)) $date_end_real_update=''; if (GETPOST('date_start_updatemonth') && GETPOST('date_start_updateday') && GETPOST('date_start_updateyear')) { - $date_start_update=dol_mktime(GETPOST('date_start_updatehour'), GETPOST('date_start_updatemin'), 0, GETPOST('date_start_updatemonth'), GETPOST('date_start_updateday'), GETPOST('date_start_updateyear')); + $date_start_update=dol_mktime(GETPOST('date_start_updatehour'), GETPOST('date_start_updatemin'), 0, GETPOST('date_start_updatemonth'), GETPOST('date_start_updateday'), GETPOST('date_start_updateyear')); } if (GETPOST('date_end_updatemonth') && GETPOST('date_end_updateday') && GETPOST('date_end_updateyear')) { - $date_end_update=dol_mktime(GETPOST('date_end_updatehour'), GETPOST('date_end_updatemin'), 0, GETPOST('date_end_updatemonth'), GETPOST('date_end_updateday'), GETPOST('date_end_updateyear')); + $date_end_update=dol_mktime(GETPOST('date_end_updatehour'), GETPOST('date_end_updatemin'), 0, GETPOST('date_end_updatemonth'), GETPOST('date_end_updateday'), GETPOST('date_end_updateyear')); } if (GETPOST('date_start_real_updatemonth') && GETPOST('date_start_real_updateday') && GETPOST('date_start_real_updateyear')) { - $date_start_real_update=dol_mktime(GETPOST('date_start_real_updatehour'), GETPOST('date_start_real_updatemin'), 0, GETPOST('date_start_real_updatemonth'), GETPOST('date_start_real_updateday'), GETPOST('date_start_real_updateyear')); + $date_start_real_update=dol_mktime(GETPOST('date_start_real_updatehour'), GETPOST('date_start_real_updatemin'), 0, GETPOST('date_start_real_updatemonth'), GETPOST('date_start_real_updateday'), GETPOST('date_start_real_updateyear')); } if (GETPOST('date_end_real_updatemonth') && GETPOST('date_end_real_updateday') && GETPOST('date_end_real_updateyear')) { - $date_end_real_update=dol_mktime(GETPOST('date_end_real_updatehour'), GETPOST('date_end_real_updatemin'), 0, GETPOST('date_end_real_updatemonth'), GETPOST('date_end_real_updateday'), GETPOST('date_end_real_updateyear')); + $date_end_real_update=dol_mktime(GETPOST('date_end_real_updatehour'), GETPOST('date_end_real_updatemin'), 0, GETPOST('date_end_real_updatemonth'), GETPOST('date_end_real_updateday'), GETPOST('date_end_real_updateyear')); } if (GETPOST('remonth') && GETPOST('reday') && GETPOST('reyear')) { - $datecontrat = dol_mktime(GETPOST('rehour'), GETPOST('remin'), 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $datecontrat = dol_mktime(GETPOST('rehour'), GETPOST('remin'), 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); } // Add contract @@ -228,74 +228,74 @@ if (empty($reshook)) if (! $error) { $object->socid = $socid; - $object->date_contrat = $datecontrat; + $object->date_contrat = $datecontrat; - $object->commercial_suivi_id = GETPOST('commercial_suivi_id','int'); - $object->commercial_signature_id = GETPOST('commercial_signature_id','int'); + $object->commercial_suivi_id = GETPOST('commercial_suivi_id','int'); + $object->commercial_signature_id = GETPOST('commercial_signature_id','int'); - $object->note_private = GETPOST('note_private','alpha'); - $object->note_public = GETPOST('note_public','alpha'); - $object->fk_project = GETPOST('projectid','int'); - $object->remise_percent = GETPOST('remise_percent','alpha'); - $object->ref = GETPOST('ref','alpha'); - $object->ref_customer = GETPOST('ref_customer','alpha'); - $object->ref_supplier = GETPOST('ref_supplier','alpha'); + $object->note_private = GETPOST('note_private','alpha'); + $object->note_public = GETPOST('note_public','alpha'); + $object->fk_project = GETPOST('projectid','int'); + $object->remise_percent = GETPOST('remise_percent','alpha'); + $object->ref = GETPOST('ref','alpha'); + $object->ref_customer = GETPOST('ref_customer','alpha'); + $object->ref_supplier = GETPOST('ref_supplier','alpha'); - // If creation from another object of another module (Example: origin=propal, originid=1) - if (! empty($origin) && ! empty($originid)) - { - // Parse element/subelement (ex: project_task) - $element = $subelement = $origin; - if (preg_match('/^([^_]+)_([^_]+)/i',$origin,$regs)) - { - $element = $regs[1]; - $subelement = $regs[2]; - } + // If creation from another object of another module (Example: origin=propal, originid=1) + if (! empty($origin) && ! empty($originid)) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $origin; + if (preg_match('/^([^_]+)_([^_]+)/i',$origin,$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } - // For compatibility - if ($element == 'order') { $element = $subelement = 'commande'; } - if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + // For compatibility + if ($element == 'order') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } - $object->origin = $origin; - $object->origin_id = $originid; + $object->origin = $origin; + $object->origin_id = $originid; - // Possibility to add external linked objects with hooks - $object->linked_objects[$object->origin] = $object->origin_id; - if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) - { - $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); - } + // Possibility to add external linked objects with hooks + $object->linked_objects[$object->origin] = $object->origin_id; + if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) + { + $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); + } - $id = $object->create($user); - if ($id < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $id = $object->create($user); + if ($id < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } - if ($id > 0) - { - dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + if ($id > 0) + { + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - $classname = ucfirst($subelement); - $srcobject = new $classname($db); + $classname = ucfirst($subelement); + $srcobject = new $classname($db); - dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); - $result=$srcobject->fetch($object->origin_id); - if ($result > 0) - { - $srcobject->fetch_thirdparty(); + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); + $result=$srcobject->fetch($object->origin_id); + if ($result > 0) + { + $srcobject->fetch_thirdparty(); $lines = $srcobject->lines; - if (empty($lines) && method_exists($srcobject,'fetch_lines')) - { - $srcobject->fetch_lines(); - $lines = $srcobject->lines; - } + if (empty($lines) && method_exists($srcobject,'fetch_lines')) + { + $srcobject->fetch_lines(); + $lines = $srcobject->lines; + } - $fk_parent_line=0; - $num=count($lines); + $fk_parent_line=0; + $num=count($lines); - for ($i=0;$i<$num;$i++) - { - $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + for ($i=0;$i<$num;$i++) + { + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); if ($product_type == 1 || (! empty($conf->global->CONTRACT_SUPPORT_PRODUCTS) && in_array($product_type, array(0,1)))) { // TODO Exclude also deee // service prédéfini @@ -330,8 +330,8 @@ if (empty($reshook)) $desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; } else { - $desc = dol_htmlentitiesbr($lines[$i]->desc); - } + $desc = dol_htmlentitiesbr($lines[$i]->desc); + } $txtva = $lines[$i]->vat_src_code ? $lines[$i]->tva_tx . ' (' . $lines[$i]->vat_src_code . ')' : $lines[$i]->tva_tx; @@ -339,72 +339,72 @@ if (empty($reshook)) $localtax1_tx = get_localtax($txtva, 1, $object->thirdparty); $localtax2_tx = get_localtax($txtva, 2, $object->thirdparty); - $result = $object->addline( - $desc, - $lines[$i]->subprice, - $lines[$i]->qty, - $txtva, - $localtax1_tx, - $localtax2_tx, - $lines[$i]->fk_product, - $lines[$i]->remise_percent, - $lines[$i]->date_start, - $lines[$i]->date_end, - 'HT', - 0, - $lines[$i]->info_bits, - $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht, - array(), - $lines[$i]->fk_unit - ); + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $txtva, + $localtax1_tx, + $localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $lines[$i]->date_start, + $lines[$i]->date_end, + 'HT', + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht, + array(), + $lines[$i]->fk_unit + ); - if ($result < 0) - { - $error++; - break; - } + if ($result < 0) + { + $error++; + break; + } } - } - } - else - { - setEventMessages($srcobject->error, $srcobject->errors, 'errors'); - $error++; - } + } + } + else + { + setEventMessages($srcobject->error, $srcobject->errors, 'errors'); + $error++; + } - // Hooks - $parameters = array('objFrom' => $srcobject); - $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook - if ($reshook < 0) - $error++; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } - } - else - { - $result = $object->create($user); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - setEventMessages($object->error, $object->errors, 'errors'); - } - $action='create'; + // Hooks + $parameters = array('objFrom' => $srcobject); + $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if ($reshook < 0) + $error++; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } } - } + else + { + $result = $object->create($user); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + setEventMessages($object->error, $object->errors, 'errors'); + } + $action='create'; + } + } } else if ($action == 'classin' && $user->rights->contrat->creer) { - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('projectid')); } // Add a new line @@ -429,72 +429,72 @@ if (empty($reshook)) $qty = GETPOST('qty'.$predef); $remise_percent = GETPOST('remise_percent'.$predef); - if ($qty == '') - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); - $error++; - } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); - $error++; - } + if ($qty == '') + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); + $error++; + } + if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); + $error++; + } - $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); - $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); - if (!empty($date_start) && !empty($date_end) && $date_start > $date_end) - { - setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); - $error++; - } + $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); + $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); + if (!empty($date_start) && !empty($date_end) && $date_start > $date_end) + { + setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); + $error++; + } - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - // Unset extrafield - if (is_array($extralabelsline)) { - // Get extra fields - foreach ($extralabelsline as $key => $value) { - unset($_POST["options_" . $key]); - } - } + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + // Unset extrafield + if (is_array($extralabelsline)) { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key]); + } + } - if (! $error) - { + if (! $error) + { // Clean parameters $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); - // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $tva_tx par celui du produit - // Ecrase $base_price_type par celui du produit - if ($idprod > 0) - { - $prod = new Product($db); - $prod->fetch($idprod); + // Ecrase $pu par celui du produit + // Ecrase $desc par celui du produit + // Ecrase $tva_tx par celui du produit + // Ecrase $base_price_type par celui du produit + if ($idprod > 0) + { + $prod = new Product($db); + $prod->fetch($idprod); - // Update if prices fields are defined - $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); - $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); - if (empty($tva_tx)) $tva_npr=0; + // Update if prices fields are defined + $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); + $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); + if (empty($tva_tx)) $tva_npr=0; - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; - // On defini prix unitaire - if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level) - { - $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; - $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; - $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; - $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; - } - elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + // On defini prix unitaire + if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level) + { + $pu_ht = $prod->multiprices[$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; + } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; @@ -517,35 +517,35 @@ if (empty($reshook)) $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx)); // On reevalue prix selon taux tva car taux tva transaction peut etre different - // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tmpvat != $tmpprodvat) - { - if ($price_base_type != 'HT') - { - $pu_ht = price2num($pu_ttc / (1 + ($tmpvat/100)), 'MU'); - } - else - { - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat/100)), 'MU'); - } - } + // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). + if ($tmpvat != $tmpprodvat) + { + if ($price_base_type != 'HT') + { + $pu_ht = price2num($pu_ttc / (1 + ($tmpvat/100)), 'MU'); + } + else + { + $pu_ttc = price2num($pu_ht * (1 + ($tmpvat/100)), 'MU'); + } + } - $desc=$prod->description; - $desc=dol_concatdesc($desc,$product_desc); - $fk_unit = $prod->fk_unit; - } - else + $desc=$prod->description; + $desc=dol_concatdesc($desc,$product_desc); + $fk_unit = $prod->fk_unit; + } + else { - $pu_ht=GETPOST('price_ht'); - $price_base_type = 'HT'; - $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0 - $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; - $desc=$product_desc; + $pu_ht=GETPOST('price_ht'); + $price_base_type = 'HT'; + $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0 + $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; + $desc=$product_desc; $fk_unit= GETPOST('units', 'alpha'); - } + } - $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty,$mysoc,$tva_npr); - $localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty,$mysoc,$tva_npr); + $localtax1_tx=get_localtax($tva_tx,1,$object->thirdparty,$mysoc,$tva_npr); + $localtax2_tx=get_localtax($tva_tx,2,$object->thirdparty,$mysoc,$tva_npr); // ajout prix achat $fk_fournprice = $_POST['fournprice']; @@ -554,41 +554,41 @@ if (empty($reshook)) else $pa_ht = null; - $info_bits=0; - if ($tva_npr) $info_bits |= 0x01; + $info_bits=0; + if ($tva_npr) $info_bits |= 0x01; - if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) - { - $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); - $result = -1 ; - } - else + if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))) { - // Insert line - $result = $object->addline( - $desc, - $pu_ht, - $qty, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $idprod, - $remise_percent, - $date_start, - $date_end, - $price_base_type, - $pu_ttc, - $info_bits, - $fk_fournprice, - $pa_ht, - $array_options, - $fk_unit - ); - } + $object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)); + $result = -1 ; + } + else + { + // Insert line + $result = $object->addline( + $desc, + $pu_ht, + $qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + $remise_percent, + $date_start, + $date_end, + $price_base_type, + $pu_ttc, + $info_bits, + $fk_fournprice, + $pa_ht, + $array_options, + $fk_unit + ); + } - if ($result > 0) - { - // Define output language + if ($result > 0) + { + // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && ! empty($conf->global->CONTRACT_ADDON_PDF)) // No generation if default type not defined { $outputlangs = $langs; @@ -624,159 +624,159 @@ if (empty($reshook)) unset($_POST['dp_desc']); unset($_POST['idprod']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } - } + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } } else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha')) { - if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) - { - setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); - $action = 'editline'; - $_GET['rowid'] = GETPOST('elrowid'); - $error++; - } + if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) + { + setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); + $action = 'editline'; + $_GET['rowid'] = GETPOST('elrowid'); + $error++; + } - if (!$error) { - $objectline = new ContratLigne($db); - if ($objectline->fetch(GETPOST('elrowid'))) - { - $db->begin(); + if (!$error) { + $objectline = new ContratLigne($db); + if ($objectline->fetch(GETPOST('elrowid'))) + { + $db->begin(); - if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture; - if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture; + if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture; + if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture; - $vat_rate = GETPOST('eltva_tx'); - // Define info_bits - $info_bits = 0; - if (preg_match('/\*/', $vat_rate)) - $info_bits |= 0x01; + $vat_rate = GETPOST('eltva_tx'); + // Define info_bits + $info_bits = 0; + if (preg_match('/\*/', $vat_rate)) + $info_bits |= 0x01; - // Define vat_rate - $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_tx=get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); - $localtax2_tx=get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); + // Define vat_rate + $vat_rate = str_replace('*', '', $vat_rate); + $localtax1_tx=get_localtax($vat_rate, 1, $object->thirdparty, $mysoc); + $localtax2_tx=get_localtax($vat_rate, 2, $object->thirdparty, $mysoc); - $txtva = $vat_rate; + $txtva = $vat_rate; - // Clean vat code - $vat_src_code=''; - if (preg_match('/\((.*)\)/', $txtva, $reg)) - { - $vat_src_code = $reg[1]; - $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. - } + // Clean vat code + $vat_src_code=''; + if (preg_match('/\((.*)\)/', $txtva, $reg)) + { + $vat_src_code = $reg[1]; + $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. + } - // ajout prix d'achat - $fk_fournprice = $_POST['fournprice']; - if ( ! empty($_POST['buying_price']) ) - $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; + // ajout prix d'achat + $fk_fournprice = $_POST['fournprice']; + if ( ! empty($_POST['buying_price']) ) + $pa_ht = $_POST['buying_price']; + else + $pa_ht = null; - $fk_unit = GETPOST('unit', 'alpha'); + $fk_unit = GETPOST('unit', 'alpha'); - $objectline->description=GETPOST('product_desc','none'); - $objectline->price_ht=GETPOST('elprice'); - $objectline->subprice=GETPOST('elprice'); - $objectline->qty=GETPOST('elqty'); - $objectline->remise_percent=GETPOST('elremise_percent'); - $objectline->tva_tx=($txtva?$txtva:0); // Field may be disabled, so we use vat rate 0 - $objectline->vat_src_code=$vat_src_code; - $objectline->localtax1_tx=is_numeric($localtax1_tx)?$localtax1_tx:0; - $objectline->localtax2_tx=is_numeric($localtax2_tx)?$localtax2_tx:0; - $objectline->date_ouverture_prevue=$date_start_update; - $objectline->date_ouverture=$date_start_real_update; - $objectline->date_fin_validite=$date_end_update; - $objectline->date_cloture=$date_end_real_update; - $objectline->fk_user_cloture=$user->id; - $objectline->fk_fournprice=$fk_fournprice; - $objectline->pa_ht=$pa_ht; + $objectline->description=GETPOST('product_desc','none'); + $objectline->price_ht=GETPOST('elprice'); + $objectline->subprice=GETPOST('elprice'); + $objectline->qty=GETPOST('elqty'); + $objectline->remise_percent=GETPOST('elremise_percent'); + $objectline->tva_tx=($txtva?$txtva:0); // Field may be disabled, so we use vat rate 0 + $objectline->vat_src_code=$vat_src_code; + $objectline->localtax1_tx=is_numeric($localtax1_tx)?$localtax1_tx:0; + $objectline->localtax2_tx=is_numeric($localtax2_tx)?$localtax2_tx:0; + $objectline->date_ouverture_prevue=$date_start_update; + $objectline->date_ouverture=$date_start_real_update; + $objectline->date_fin_validite=$date_end_update; + $objectline->date_cloture=$date_end_real_update; + $objectline->fk_user_cloture=$user->id; + $objectline->fk_fournprice=$fk_fournprice; + $objectline->pa_ht=$pa_ht; - if ($fk_unit > 0) { - $objectline->fk_unit = GETPOST('unit'); - } else { - $objectline->fk_unit = null; - } + if ($fk_unit > 0) { + $objectline->fk_unit = GETPOST('unit'); + } else { + $objectline->fk_unit = null; + } - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - $objectline->array_options=$array_options; + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + $objectline->array_options=$array_options; - // TODO verifier price_min si fk_product et multiprix + // TODO verifier price_min si fk_product et multiprix - $result=$objectline->update($user); - if ($result > 0) - { - $db->commit(); - } - else - { - setEventMessages($objectline->error, $objectline->errors, 'errors'); - $db->rollback(); - } - } - else - { - setEventMessages($objectline->error, $objectline->errors, 'errors'); - } - } + $result=$objectline->update($user); + if ($result > 0) + { + $db->commit(); + } + else + { + setEventMessages($objectline->error, $objectline->errors, 'errors'); + $db->rollback(); + } + } + else + { + setEventMessages($objectline->error, $objectline->errors, 'errors'); + } + } } else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) { - $result = $object->deleteline(GETPOST('lineid'),$user); + $result = $object->deleteline(GETPOST('lineid'),$user); - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) { - $result = $object->validate($user); + $result = $object->validate($user); } else if ($action == 'reopen' && $user->rights->contrat->creer) { - $result = $object->reopen($user); + $result = $object->reopen($user); } // Close all lines else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) { - $object->closeAll($user); + $object->closeAll($user); } // Close all lines else if ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer) { - $object->activateAll($user); + $object->activateAll($user); } else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) @@ -848,7 +848,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } - $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); + $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $action = 'editref_supplier'; @@ -857,10 +857,10 @@ if (empty($reshook)) exit; } } - else { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); - exit; - } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } } elseif ($action=='setref_customer') { @@ -873,8 +873,8 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } - $result = $object->setValueFrom('ref_customer', GETPOST('ref_customer','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); - if ($result < 0) { + $result = $object->setValueFrom('ref_customer', GETPOST('ref_customer','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $action = 'editref_customer'; } else { @@ -882,58 +882,58 @@ if (empty($reshook)) exit; } } - else { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); - exit; - } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } } elseif ($action=='setref') { - $cancelbutton = GETPOST('cancel','alpha'); + $cancelbutton = GETPOST('cancel','alpha'); - if (!$cancelbutton) { - $result = $object->fetch($id); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + if (!$cancelbutton) { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } - $result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = 'editref'; - } else { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); - exit; - } - } - else { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); - exit; - } + $result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'editref'; + } else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } } elseif ($action=='setdate_contrat') { - $cancelbutton = GETPOST('cancel','alpha'); + $cancelbutton = GETPOST('cancel','alpha'); - if (!$cancelbutton) { - $result = $object->fetch($id); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + if (!$cancelbutton) { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } $datacontrat=dol_mktime(GETPOST('date_contrathour'), GETPOST('date_contratmin'), 0, GETPOST('date_contratmonth'), GETPOST('date_contratday'), GETPOST('date_contratyear')); - $result = $object->setValueFrom('date_contrat', $datacontrat, '', null, 'date', '', $user, 'CONTRACT_MODIFY'); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = 'editdate_contrat'; - } else { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); - exit; - } - } - else { - header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); - exit; - } + $result = $object->setValueFrom('date_contrat', $datacontrat, '', null, 'date', '', $user, 'CONTRACT_MODIFY'); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'editdate_contrat'; + } else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); + exit; + } + } + else { + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); + exit; + } } @@ -1051,74 +1051,74 @@ if ($action == 'create') { print load_fiche_titre($langs->trans('AddContract'),'','title_commercial.png'); - $soc = new Societe($db); - if ($socid>0) $soc->fetch($socid); + $soc = new Societe($db); + if ($socid>0) $soc->fetch($socid); - if (GETPOST('origin') && GETPOST('originid')) - { - // Parse element/subelement (ex: project_task) - $element = $subelement = GETPOST('origin'); - if (preg_match('/^([^_]+)_([^_]+)/i',GETPOST('origin'),$regs)) - { - $element = $regs[1]; - $subelement = $regs[2]; - } + if (GETPOST('origin') && GETPOST('originid')) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = GETPOST('origin'); + if (preg_match('/^([^_]+)_([^_]+)/i',GETPOST('origin'),$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } - if ($element == 'project') - { - $projectid=GETPOST('originid'); - } - else - { - // For compatibility - if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } - if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + if ($element == 'project') + { + $projectid=GETPOST('originid'); + } + else + { + // For compatibility + if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } - dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); - $classname = ucfirst($subelement); - $objectsrc = new $classname($db); - $objectsrc->fetch(GETPOST('originid')); - if (empty($objectsrc->lines) && method_exists($objectsrc,'fetch_lines')) $objectsrc->fetch_lines(); - $objectsrc->fetch_thirdparty(); + $classname = ucfirst($subelement); + $objectsrc = new $classname($db); + $objectsrc->fetch(GETPOST('originid')); + if (empty($objectsrc->lines) && method_exists($objectsrc,'fetch_lines')) $objectsrc->fetch_lines(); + $objectsrc->fetch_thirdparty(); - $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); + $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); - $soc = $objectsrc->thirdparty; + $soc = $objectsrc->thirdparty; - $note_private = (! empty($objectsrc->note_private) ? $objectsrc->note_private : ''); - $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); + $note_private = (! empty($objectsrc->note_private) ? $objectsrc->note_private : ''); + $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); - // Object source contacts list - $srccontactslist = $objectsrc->liste_contact(-1,'external',1); - } - } - else { + // Object source contacts list + $srccontactslist = $objectsrc->liste_contact(-1,'external',1); + } + } + else { $projectid = GETPOST('projectid','int'); $note_private = GETPOST("note_private"); $note_public = GETPOST("note_public"); } - $object->date_contrat = dol_now(); + $object->date_contrat = dol_now(); - print '<form name="form_contract" action="'.$_SERVER["PHP_SELF"].'" method="post">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<form name="form_contract" action="'.$_SERVER["PHP_SELF"].'" method="post">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="add">'; - print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; - print '<input type="hidden" name="remise_percent" value="0">'; + print '<input type="hidden" name="action" value="add">'; + print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; + print '<input type="hidden" name="remise_percent" value="0">'; - dol_fiche_head(); + dol_fiche_head(); - print '<table class="border" width="100%">'; + print '<table class="border" width="100%">'; - // Ref + // Ref print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'; - if (! empty($modCodeContract->code_auto)) { - $tmpcode=$langs->trans("Draft"); - } else { - $tmpcode='<input name="ref" class="maxwidth100" maxlength="128" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">'; - } + if (! empty($modCodeContract->code_auto)) { + $tmpcode=$langs->trans("Draft"); + } else { + $tmpcode='<input name="ref" class="maxwidth100" maxlength="128" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">'; + } print $tmpcode; print '</td></tr>'; @@ -1130,7 +1130,7 @@ if ($action == 'create') print '<tr><td>'.$langs->trans('RefSupplier').'</td>'; print '<td><input type="text" class="maxwidth150" name="ref_supplier" id="ref_supplier" value="'.dol_escape_htmltag(GETPOST('ref_supplier','alpha')).'"></td></tr>'; - // Thirdparty + // Thirdparty print '<tr>'; print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>'; if ($socid>0) @@ -1144,7 +1144,7 @@ if ($action == 'create') { print '<td>'; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); - print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; + print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; print '</td>'; } print '</tr>'."\n"; @@ -1163,75 +1163,75 @@ if ($action == 'create') print '</td></tr>'; } - // Commercial suivi - print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>'; - print $form->select_dolusers(GETPOST("commercial_suivi_id")?GETPOST("commercial_suivi_id"):$user->id,'commercial_suivi_id',1,''); - print '</td></tr>'; + // Commercial suivi + print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>'; + print $form->select_dolusers(GETPOST("commercial_suivi_id")?GETPOST("commercial_suivi_id"):$user->id,'commercial_suivi_id',1,''); + print '</td></tr>'; - // Commercial signature - print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>'; - print $form->select_dolusers(GETPOST("commercial_signature_id")?GETPOST("commercial_signature_id"):$user->id,'commercial_signature_id',1,''); - print '</td></tr>'; + // Commercial signature + print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>'; + print $form->select_dolusers(GETPOST("commercial_signature_id")?GETPOST("commercial_signature_id"):$user->id,'commercial_signature_id',1,''); + print '</td></tr>'; - print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>'; - $form->select_date($datecontrat,'',0,0,'',"contrat"); - print "</td></tr>"; + print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>'; + $form->select_date($datecontrat,'',0,0,'',"contrat"); + print "</td></tr>"; - // Project - if (! empty($conf->projet->enabled)) - { - $formproject=new FormProjets($db); + // Project + if (! empty($conf->projet->enabled)) + { + $formproject=new FormProjets($db); - print '<tr><td>'.$langs->trans("Project").'</td><td>'; - $formproject->select_projects(($soc->id>0?$soc->id:-1),$projectid,"projectid",0,0,1,1); - print "</td></tr>"; - } - - print '<tr><td>'.$langs->trans("NotePublic").'</td><td class="tdtop">'; - $doleditor=new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, '90%'); - print $doleditor->Create(1); - print '</td></tr>'; - - if (empty($user->societe_id)) - { - print '<tr><td>'.$langs->trans("NotePrivate").'</td><td class="tdtop">'; - $doleditor=new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, '90%'); - print $doleditor->Create(1); - print '</td></tr>'; - } - - // Other attributes - $parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"', 'cols'=>3); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - // Other attributes - if (empty($reshook) && ! empty($extrafields->attribute_label)) { - print $object->showOptionals($extrafields, 'edit'); - } - - print "</table>\n"; - - dol_fiche_end(); - - print '<div class="center">'; - print '<input type="submit" class="button" value="'.$langs->trans("Create").'">'; - print '     '; - print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">'; - print '</div>'; - - if (is_object($objectsrc)) - { - print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">'; - print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; - - if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) - { - print '<br>'.$langs->trans("Note").': '.$langs->trans("OnlyLinesWithTypeServiceAreUsed"); - } + print '<tr><td>'.$langs->trans("Project").'</td><td>'; + $formproject->select_projects(($soc->id>0?$soc->id:-1),$projectid,"projectid",0,0,1,1); + print "</td></tr>"; } - print "</form>\n"; + print '<tr><td>'.$langs->trans("NotePublic").'</td><td class="tdtop">'; + $doleditor=new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, '90%'); + print $doleditor->Create(1); + print '</td></tr>'; + + if (empty($user->societe_id)) + { + print '<tr><td>'.$langs->trans("NotePrivate").'</td><td class="tdtop">'; + $doleditor=new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, '90%'); + print $doleditor->Create(1); + print '</td></tr>'; + } + + // Other attributes + $parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"', 'cols'=>3); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Other attributes + if (empty($reshook) && ! empty($extrafields->attribute_label)) { + print $object->showOptionals($extrafields, 'edit'); + } + + print "</table>\n"; + + dol_fiche_end(); + + print '<div class="center">'; + print '<input type="submit" class="button" value="'.$langs->trans("Create").'">'; + print '     '; + print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">'; + print '</div>'; + + if (is_object($objectsrc)) + { + print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">'; + print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; + + if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) + { + print '<br>'.$langs->trans("Note").': '.$langs->trans("OnlyLinesWithTypeServiceAreUsed"); + } + } + + print "</form>\n"; } else /* *************************************************************************** */ @@ -1240,105 +1240,105 @@ else /* */ /* *************************************************************************** */ { - $now=dol_now(); + $now=dol_now(); - if ($object->id > 0) - { - $object->fetch_thirdparty(); + if ($object->id > 0) + { + $object->fetch_thirdparty(); - $result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed - if ($result < 0) dol_print_error($db,$object->error); + $result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed + if ($result < 0) dol_print_error($db,$object->error); - $nbofservices=count($object->lines); + $nbofservices=count($object->lines); - $author = new User($db); - $author->fetch($object->user_author_id); + $author = new User($db); + $author->fetch($object->user_author_id); - $commercial_signature = new User($db); - $commercial_signature->fetch($object->commercial_signature_id); + $commercial_signature = new User($db); + $commercial_signature->fetch($object->commercial_signature_id); - $commercial_suivi = new User($db); - $commercial_suivi->fetch($object->commercial_suivi_id); + $commercial_suivi = new User($db); + $commercial_suivi->fetch($object->commercial_suivi_id); - $head = contract_prepare_head($object); + $head = contract_prepare_head($object); - $hselected = 0; + $hselected = 0; - dol_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); + dol_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); - /* + /* * Confirmation de la suppression du contrat */ - if ($action == 'delete') - { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); + if ($action == 'delete') + { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); - } + } - /* + /* * Confirmation de la validation */ - if ($action == 'valid') - { - $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV' && !empty($modCodeContract->code_auto)) - { - $numref = $object->getNextNumRef($object->thirdparty); - } - else - { - $numref = $object->ref; - } + if ($action == 'valid') + { + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV' && !empty($modCodeContract->code_auto)) + { + $numref = $object->getNextNumRef($object->thirdparty); + } + else + { + $numref = $object->ref; + } - $text=$langs->trans('ConfirmValidateContract',$numref); + $text=$langs->trans('ConfirmValidateContract',$numref); - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); - } + } - /* + /* * Confirmation de la fermeture */ - if ($action == 'close') - { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); + if ($action == 'close') + { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); - } - if ($action == 'activate') - { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ActivateAllOnContract"),$langs->trans("ConfirmActivateAllOnContract"),"confirm_activate",'',0,1); + } + if ($action == 'activate') + { + print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ActivateAllOnContract"),$langs->trans("ConfirmActivateAllOnContract"),"confirm_activate",'',0,1); - } + } - /* + /* * Contrat */ - if (! empty($object->brouillon) && $user->rights->contrat->creer) - { - print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="setremise">'; - } + if (! empty($object->brouillon) && $user->rights->contrat->creer) + { + print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="setremise">'; + } - // Clone confirmation - if ($action == 'clone') { - $formquestion = array(array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)'))); - print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneContract'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); - } + // Clone confirmation + if ($action == 'clone') { + $formquestion = array(array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)'))); + print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneContract'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } // Contract card - $linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; + $linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; - $morehtmlref=''; - if (! empty($modCodeContract->code_auto)) { - $morehtmlref.=$object->ref; - } else { - $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,$object,$user->rights->contrat->creer,'string','',0,3); - $morehtmlref.=$form->editfieldval("",'ref',$object->ref,$object,$user->rights->contrat->creer,'string','',0,2); - } + $morehtmlref=''; + if (! empty($modCodeContract->code_auto)) { + $morehtmlref.=$object->ref; + } else { + $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,$object,$user->rights->contrat->creer,'string','',0,3); + $morehtmlref.=$form->editfieldval("",'ref',$object->ref,$object,$user->rights->contrat->creer,'string','',0,2); + } $morehtmlref.='<div class="refidno">'; // Ref customer @@ -1349,64 +1349,64 @@ else $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='<br>'.$langs->trans('Project') . ' '; - if ($user->rights->contrat->creer) - { - if ($action != 'classify') - $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; - $morehtmlref.='<input type="hidden" name="action" value="classin">'; - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; - $morehtmlref.='</form>'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; - $morehtmlref.=$proj->ref; - $morehtmlref.='</a>'; - } else { - $morehtmlref.=''; - } - } - } - $morehtmlref.='</div>'; + $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='<br>'.$langs->trans('Project') . ' '; + if ($user->rights->contrat->creer) + { + if ($action != 'classify') + $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; + $morehtmlref.='<input type="hidden" name="action" value="classin">'; + $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + $morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; + $morehtmlref.='</form>'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; + $morehtmlref.=$proj->ref; + $morehtmlref.='</a>'; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.='</div>'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'none', $morehtmlref); - print '<div class="fichecenter">'; - print '<div class="underbanner clearboth"></div>'; + print '<div class="fichecenter">'; + print '<div class="underbanner clearboth"></div>'; - print '<table class="border" width="100%">'; + print '<table class="border" width="100%">'; - // Ligne info remises tiers - print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">'; - if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$object->thirdparty->getAvailableDiscounts(); - print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); - else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.'; - print '</td></tr>'; + // Ligne info remises tiers + print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">'; + if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$object->thirdparty->remise_percent); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $absolute_discount=$object->thirdparty->getAvailableDiscounts(); + print '. '; + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; - // Date - print '<tr>'; + // Date + print '<tr>'; print '<td class="titlefield">'; print $form->editfieldkey("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer); print '</td><td>'; @@ -1414,577 +1414,577 @@ else print '</td>'; print '</tr>'; - // Other attributes - $cols = 3; - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + // Other attributes + $cols = 3; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - print "</table>"; + print "</table>"; - print '</div>'; + print '</div>'; - if (! empty($object->brouillon) && $user->rights->contrat->creer) - { - print '</form>'; - } + if (! empty($object->brouillon) && $user->rights->contrat->creer) + { + print '</form>'; + } - echo '<br>'; + echo '<br>'; - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - $blocname = 'contacts'; - $title = $langs->trans('ContactsAddresses'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $blocname = 'contacts'; + $title = $langs->trans('ContactsAddresses'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } - if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $blocname = 'notes'; - $title = $langs->trans('Notes'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $blocname = 'notes'; + $title = $langs->trans('Notes'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } - $colorb='666666'; + $colorb='666666'; - $arrayothercontracts=$object->getListOfContracts('others'); + $arrayothercontracts=$object->getListOfContracts('others'); - /* + /* * Lines of contracts */ $productstatic=new Product($db); - $usemargins=0; + $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; - $var=false; + $var=false; // Title line for service - $cursorline=1; - while ($cursorline <= $nbofservices) - { - print '<form name="update" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="updateline">'; - print '<input type="hidden" name="elrowid" value="'.$object->lines[$cursorline-1]->id.'">'; - print '<input type="hidden" name="idprod" value="'.(!empty($object->lines[$cursorline-1]->fk_product) ? $object->lines[$cursorline-1]->fk_product : 0).'">'; - print '<input type="hidden" name="fournprice" value="'.(!empty($object->lines[$cursorline-1]->fk_fournprice) ? $object->lines[$cursorline-1]->fk_fournprice : 0).'">'; + $cursorline=1; + while ($cursorline <= $nbofservices) + { + print '<form name="update" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="updateline">'; + print '<input type="hidden" name="elrowid" value="'.$object->lines[$cursorline-1]->id.'">'; + print '<input type="hidden" name="idprod" value="'.(!empty($object->lines[$cursorline-1]->fk_product) ? $object->lines[$cursorline-1]->fk_product : 0).'">'; + print '<input type="hidden" name="fournprice" value="'.(!empty($object->lines[$cursorline-1]->fk_fournprice) ? $object->lines[$cursorline-1]->fk_fournprice : 0).'">'; - // Area with common detail of line - print '<table class="notopnoleftnoright allwidth tableforservicepart1" width="100%">'; + // Area with common detail of line + print '<table class="notopnoleftnoright allwidth tableforservicepart1" width="100%">'; - $sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.product_type, cd.description, cd.price_ht, cd.qty,"; - $sql.= " cd.tva_tx, cd.vat_src_code, cd.remise_percent, cd.info_bits, cd.subprice, cd.multicurrency_subprice,"; - $sql.= " cd.date_ouverture_prevue as date_debut, cd.date_ouverture as date_debut_reelle,"; - $sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,"; - $sql.= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,"; - $sql.= " cd.fk_unit,"; - $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; - $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; - $sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id; + $sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.product_type, cd.description, cd.price_ht, cd.qty,"; + $sql.= " cd.tva_tx, cd.vat_src_code, cd.remise_percent, cd.info_bits, cd.subprice, cd.multicurrency_subprice,"; + $sql.= " cd.date_ouverture_prevue as date_debut, cd.date_ouverture as date_debut_reelle,"; + $sql.= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,"; + $sql.= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,"; + $sql.= " cd.fk_unit,"; + $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; + $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as cd"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; + $sql.= " WHERE cd.rowid = ".$object->lines[$cursorline-1]->id; - $result = $db->query($sql); - if ($result) - { - $total = 0; + $result = $db->query($sql); + if ($result) + { + $total = 0; - print '<tr class="liste_titre'.($cursorline?' liste_titre_add':'').'">'; - print '<td>'.$langs->trans("ServiceNb",$cursorline).'</td>'; - print '<td width="80" align="center">'.$langs->trans("VAT").'</td>'; - print '<td width="80" align="right">'.$langs->trans("PriceUHT").'</td>'; - if (!empty($conf->multicurrency->enabled)) { - print '<td width="80" align="right">'.$langs->trans("PriceUHTCurrency").'</td>'; - } - print '<td width="30" align="center">'.$langs->trans("Qty").'</td>'; - if ($conf->global->PRODUCT_USE_UNITS) print '<td width="30" align="left">'.$langs->trans("Unit").'</td>'; - print '<td width="50" align="right">'.$langs->trans("ReductionShort").'</td>'; + print '<tr class="liste_titre'.($cursorline?' liste_titre_add':'').'">'; + print '<td>'.$langs->trans("ServiceNb",$cursorline).'</td>'; + print '<td width="80" align="center">'.$langs->trans("VAT").'</td>'; + print '<td width="80" align="right">'.$langs->trans("PriceUHT").'</td>'; + if (!empty($conf->multicurrency->enabled)) { + print '<td width="80" align="right">'.$langs->trans("PriceUHTCurrency").'</td>'; + } + print '<td width="30" align="center">'.$langs->trans("Qty").'</td>'; + if ($conf->global->PRODUCT_USE_UNITS) print '<td width="30" align="left">'.$langs->trans("Unit").'</td>'; + print '<td width="50" align="right">'.$langs->trans("ReductionShort").'</td>'; if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print '<td width="50" align="right">'.$langs->trans("BuyingPrice").'</td>'; - print '<td width="30"> </td>'; - print "</tr>\n"; + print '<td width="30"> </td>'; + print "</tr>\n"; - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($result); - // + // - if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) - { - print '<tr '.$bcnd[$var].' valign="top">'; - // Label - if ($objp->fk_product > 0) - { - print '<td>'; - $productstatic->id=$objp->fk_product; - $productstatic->type=$objp->ptype; - $productstatic->ref=$objp->pref; + if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) + { + print '<tr '.$bcnd[$var].' valign="top">'; + // Label + if ($objp->fk_product > 0) + { + print '<td>'; + $productstatic->id=$objp->fk_product; + $productstatic->type=$objp->ptype; + $productstatic->ref=$objp->pref; $productstatic->entity=$objp->pentity; $productstatic->label=$objp->plabel; $text = $productstatic->getNomUrl(1,'',20); - if ($objp->plabel) - { - $text .= ' - '; - //$productstatic->ref=$objp->label; - //$text .= $productstatic->getNomUrl(0,'',16); - $text .= $objp->plabel; - } - $description = $objp->description; + if ($objp->plabel) + { + $text .= ' - '; + //$productstatic->ref=$objp->label; + //$text .= $productstatic->getNomUrl(0,'',16); + $text .= $objp->plabel; + } + $description = $objp->description; - // Add description in form + // Add description in form if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { $text .= (! empty($objp->description) && $objp->description!=$objp->plabel)?'<br>'.dol_htmlentitiesbr($objp->description):''; $description = ''; // Already added into main visible desc } - echo $form->textwithtooltip($text,$description,3,'','',$cursorline,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); + echo $form->textwithtooltip($text,$description,3,'','',$cursorline,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); - print '</td>'; - } - else + print '</td>'; + } + else { - print '<td>'.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."</td>\n"; - } - // TVA - print '<td align="center">'; - print vatrate($objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), '%', $objp->info_bits); - print '</td>'; - // Price - print '<td align="right">'.($objp->subprice != '' ? price($objp->subprice) : '')."</td>\n"; - // Price multicurrency - if (!empty($conf->multicurrency->enabled)) { - print '<td align="right" class="linecoluht_currency nowrap">'.price($objp->multicurrency_subprice).'</td>'; - } - // Quantite - print '<td align="center">'.$objp->qty.'</td>'; - // Unit - if($conf->global->PRODUCT_USE_UNITS) print '<td align="left">'.$langs->trans($object->lines[$cursorline-1]->getLabelOfUnit()).'</td>'; - // Remise - if ($objp->remise_percent > 0) - { - print '<td align="right">'.$objp->remise_percent."%</td>\n"; - } - else - { - print '<td> </td>'; - } + print '<td>'.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."</td>\n"; + } + // TVA + print '<td align="center">'; + print vatrate($objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), '%', $objp->info_bits); + print '</td>'; + // Price + print '<td align="right">'.($objp->subprice != '' ? price($objp->subprice) : '')."</td>\n"; + // Price multicurrency + if (!empty($conf->multicurrency->enabled)) { + print '<td align="right" class="linecoluht_currency nowrap">'.price($objp->multicurrency_subprice).'</td>'; + } + // Quantite + print '<td align="center">'.$objp->qty.'</td>'; + // Unit + if($conf->global->PRODUCT_USE_UNITS) print '<td align="left">'.$langs->trans($object->lines[$cursorline-1]->getLabelOfUnit()).'</td>'; + // Remise + if ($objp->remise_percent > 0) + { + print '<td align="right">'.$objp->remise_percent."%</td>\n"; + } + else + { + print '<td> </td>'; + } // Margin if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) print '<td align="right" class="nowrap">'.price($objp->pa_ht).'</td>'; - // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) - print '<td align="right" class="nowrap">'; - if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) - { - print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=move&rowid='.$objp->rowid.'">'; - print img_picto($langs->trans("MoveToAnotherContract"),'uparrow'); - print '</a>'; - } - if ($user->rights->contrat->creer && ($object->statut >= 0)) - { - print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=editline&rowid='.$objp->rowid.'">'; - print img_edit(); - print '</a>'; - } - if ( $user->rights->contrat->creer && ($object->statut >= 0)) - { - print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=deleteline&rowid='.$objp->rowid.'">'; - print img_delete(); - print '</a>'; - } - print '</td>'; + // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) + print '<td align="right" class="nowrap">'; + if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) + { + print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=move&rowid='.$objp->rowid.'">'; + print img_picto($langs->trans("MoveToAnotherContract"),'uparrow'); + print '</a>'; + } + if ($user->rights->contrat->creer && ($object->statut >= 0)) + { + print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=editline&rowid='.$objp->rowid.'">'; + print img_edit(); + print '</a>'; + } + if ( $user->rights->contrat->creer && ($object->statut >= 0)) + { + print '<a style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=deleteline&rowid='.$objp->rowid.'">'; + print img_delete(); + print '</a>'; + } + print '</td>'; - print "</tr>\n"; + print "</tr>\n"; - // Dates of service planed and real - if ($objp->subprice >= 0) - { - $colspan = 6; + // Dates of service planed and real + if ($objp->subprice >= 0) + { + $colspan = 6; - if ($conf->margin->enabled && $conf->global->PRODUCT_USE_UNITS) { - $colspan = 8; - } elseif ($conf->margin->enabled || $conf->global->PRODUCT_USE_UNITS) { - $colspan = 7; - } + if ($conf->margin->enabled && $conf->global->PRODUCT_USE_UNITS) { + $colspan = 8; + } elseif ($conf->margin->enabled || $conf->global->PRODUCT_USE_UNITS) { + $colspan = 7; + } - print '<tr '.$bcnd[$var].'>'; - print '<td colspan="'.$colspan.'">'; + print '<tr '.$bcnd[$var].'>'; + print '<td colspan="'.$colspan.'">'; - // Date planned - print $langs->trans("DateStartPlanned").': '; - if ($objp->date_debut) - { - print dol_print_date($db->jdate($objp->date_debut), 'day'); - // Warning si date prevu passee et pas en service - if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) { - $warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24; - $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); - print " ".img_warning($textlate); - } - } - else print $langs->trans("Unknown"); - print '  -  '; - print $langs->trans("DateEndPlanned").': '; - if ($objp->date_fin) - { - print dol_print_date($db->jdate($objp->date_fin), 'day'); - if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) { - $warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24; - $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); - print " ".img_warning($textlate); - } - } - else print $langs->trans("Unknown"); + // Date planned + print $langs->trans("DateStartPlanned").': '; + if ($objp->date_debut) + { + print dol_print_date($db->jdate($objp->date_debut), 'day'); + // Warning si date prevu passee et pas en service + if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) { + $warning_delay=$conf->contrat->services->inactifs->warning_delay / 3600 / 24; + $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); + print " ".img_warning($textlate); + } + } + else print $langs->trans("Unknown"); + print '  -  '; + print $langs->trans("DateEndPlanned").': '; + if ($objp->date_fin) + { + print dol_print_date($db->jdate($objp->date_fin), 'day'); + if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) { + $warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24; + $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); + print " ".img_warning($textlate); + } + } + else print $langs->trans("Unknown"); - print '</td>'; - print '</tr>'; - } + print '</td>'; + print '</tr>'; + } - // Display lines extrafields - if (is_array($extralabelslines) && count($extralabelslines)>0) { - print '<tr '.$bcnd[$var].'>'; - $line = new ContratLigne($db); - $line->fetch_optionals($objp->rowid,$extralabelslines); - print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan)); - print '</tr>'; - } - } - // Ligne en mode update - else - { - // Ligne carac - print "<tr ".$bcnd[$var].">"; - print '<td>'; - if ($objp->fk_product) - { - $productstatic->id=$objp->fk_product; - $productstatic->type=$objp->ptype; - $productstatic->ref=$objp->pref; + // Display lines extrafields + if (is_array($extralabelslines) && count($extralabelslines)>0) { + print '<tr '.$bcnd[$var].'>'; + $line = new ContratLigne($db); + $line->fetch_optionals($objp->rowid,$extralabelslines); + print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan)); + print '</tr>'; + } + } + // Ligne en mode update + else + { + // Ligne carac + print "<tr ".$bcnd[$var].">"; + print '<td>'; + if ($objp->fk_product) + { + $productstatic->id=$objp->fk_product; + $productstatic->type=$objp->ptype; + $productstatic->ref=$objp->pref; $productstatic->entity=$objp->pentity; - print $productstatic->getNomUrl(1,'',20); - print $objp->label?' - '.dol_trunc($objp->label,16):''; - print '<br>'; - } - else - { - print $objp->label?$objp->label.'<br>':''; - } + print $productstatic->getNomUrl(1,'',20); + print $objp->label?' - '.dol_trunc($objp->label,16):''; + print '<br>'; + } + else + { + print $objp->label?$objp->label.'<br>':''; + } - // editeur wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); - $doleditor=new DolEditor('product_desc',$objp->description,'',92,'dolibarr_details','',false,true,$enable,$nbrows,'90%'); - $doleditor->Create(); + // editeur wysiwyg + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); + $doleditor=new DolEditor('product_desc',$objp->description,'',92,'dolibarr_details','',false,true,$enable,$nbrows,'90%'); + $doleditor->Create(); - print '</td>'; - print '<td align="right">'; - print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1); - print '</td>'; - print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>'; - print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>'; - if ($conf->global->PRODUCT_USE_UNITS) - { - print '<td align="left">'; - print $form->selectUnits($objp->fk_unit, "unit"); - print '</td>'; - } - print '<td align="right" class="nowrap"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>'; + print '</td>'; + print '<td align="right">'; + print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code?(' ('.$objp->vat_src_code.')'):''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1); + print '</td>'; + print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>'; + print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>'; + if ($conf->global->PRODUCT_USE_UNITS) + { + print '<td align="left">'; + print $form->selectUnits($objp->fk_unit, "unit"); + print '</td>'; + } + print '<td align="right" class="nowrap"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>'; if (! empty($usemargins)) { - print '<td align="right">'; - if ($objp->fk_product) print '<select id="fournprice" name="fournprice"></select>'; + print '<td align="right">'; + if ($objp->fk_product) print '<select id="fournprice" name="fournprice"></select>'; print '<input id="buying_price" type="text" size="5" name="buying_price" value="'.price($objp->pa_ht,0,'',0).'"></td>'; } - print '<td align="center">'; - print '<input type="submit" class="button" name="save" value="'.$langs->trans("Modify").'">'; - print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; - print '</td>'; + print '<td align="center">'; + print '<input type="submit" class="button" name="save" value="'.$langs->trans("Modify").'">'; + print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; + print '</td>'; - $colspan=6; - if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) $colspan++; - if($conf->global->PRODUCT_USE_UNITS) $colspan++; + $colspan=6; + if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) $colspan++; + if($conf->global->PRODUCT_USE_UNITS) $colspan++; - // Ligne dates prevues - print "<tr ".$bcnd[$var].">"; - print '<td colspan="'.$colspan.'">'; - print $langs->trans("DateStartPlanned").' '; - $form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update"); - print '   '.$langs->trans("DateEndPlanned").' '; - $form->select_date($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update"); - print '</td>'; + // Ligne dates prevues + print "<tr ".$bcnd[$var].">"; + print '<td colspan="'.$colspan.'">'; + print $langs->trans("DateStartPlanned").' '; + $form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update"); + print '   '.$langs->trans("DateEndPlanned").' '; + $form->select_date($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update"); + print '</td>'; - if (is_array($extralabelslines) && count($extralabelslines)>0) { - print '<tr '.$bcnd[$var].'>'; - $line = new ContratLigne($db); - $line->fetch_optionals($objp->rowid,$extralabelslines); - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan)); - print '</tr>'; - } + if (is_array($extralabelslines) && count($extralabelslines)>0) { + print '<tr '.$bcnd[$var].'>'; + $line = new ContratLigne($db); + $line->fetch_optionals($objp->rowid,$extralabelslines); + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan)); + print '</tr>'; + } - print '</tr>'; - } + print '</tr>'; + } - $db->free($result); - } - else + $db->free($result); + } + else { - dol_print_error($db); - } + dol_print_error($db); + } - if ($object->statut > 0) - { - print '<tr '.$bcnd[$var].'>'; - print '<td class="tdhrthin" colspan="'.($conf->margin->enabled?7:6).'"><hr class="opacitymedium tdhrthin"></td>'; - print "</tr>\n"; - } + if ($object->statut > 0) + { + print '<tr '.$bcnd[$var].'>'; + print '<td class="tdhrthin" colspan="'.($conf->margin->enabled?7:6).'"><hr class="opacitymedium tdhrthin"></td>'; + print "</tr>\n"; + } - print "</table>"; + print "</table>"; - print "</form>\n"; + print "</form>\n"; - /* + /* * Confirmation to delete service line of contract */ - if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) - { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); - if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; - } + if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); + if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; + } - /* + /* * Confirmation to move service toward another contract */ - if ($action == 'move' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) - { - $arraycontractid=array(); - foreach($arrayothercontracts as $contractcursor) - { - $arraycontractid[$contractcursor->id]=$contractcursor->ref; - } - //var_dump($arraycontractid); - // Cree un tableau formulaire - $formquestion=array( + if ($action == 'move' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) + { + $arraycontractid=array(); + foreach($arrayothercontracts as $contractcursor) + { + $arraycontractid[$contractcursor->id]=$contractcursor->ref; + } + //var_dump($arraycontractid); + // Cree un tableau formulaire + $formquestion=array( 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), - array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); + array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); - print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; - } + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion); + print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; + } - /* + /* * Confirmation de la validation activation */ - if ($action == 'active' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $object->lines[$cursorline-1]->id == GETPOST('ligne')) - { - $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - $comment = GETPOST('comment','alpha'); - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); - print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; - } + if ($action == 'active' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $object->lines[$cursorline-1]->id == GETPOST('ligne')) + { + $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); + $comment = GETPOST('comment','alpha'); + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1); + print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; + } - /* + /* * Confirmation de la validation fermeture */ - if ($action == 'closeline' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $object->lines[$cursorline-1]->id == GETPOST('ligne')) - { - $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - $comment = GETPOST('comment','alpha'); + if ($action == 'closeline' && ! $_REQUEST["cancel"] && $user->rights->contrat->activer && $object->lines[$cursorline-1]->id == GETPOST('ligne')) + { + $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); + $comment = GETPOST('comment','alpha'); - if (empty($dateactend)) - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEndReal")), null, 'errors'); - } - else - { - $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne','int')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); - } - print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; - } + if (empty($dateactend)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEndReal")), null, 'errors'); + } + else + { + $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne','int')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1); + } + print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>'; + } - // Area with status and activation info of line - if ($object->statut > 0) - { - print '<table class="notopnoleftnoright tableforservicepart2" width="100%">'; + // Area with status and activation info of line + if ($object->statut > 0) + { + print '<table class="notopnoleftnoright tableforservicepart2" width="100%">'; - print '<tr '.$bcnd[$var].'>'; - print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).'</td>'; - print '<td width="30" align="right">'; - if ($user->societe_id == 0) - { - if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline') - { - $tmpaction='activateline'; - $tmpactionpicto='play'; - $tmpactiontext=$langs->trans("Activate"); - if ($objp->statut == 4) - { - $tmpaction='unactivateline'; - $tmpactionpicto='playstop'; - $tmpactiontext=$langs->trans("Unactivate"); - } + print '<tr '.$bcnd[$var].'>'; + print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).'</td>'; + print '<td width="30" align="right">'; + if ($user->societe_id == 0) + { + if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline') + { + $tmpaction='activateline'; + $tmpactionpicto='play'; + $tmpactiontext=$langs->trans("Activate"); + if ($objp->statut == 4) + { + $tmpaction='unactivateline'; + $tmpactionpicto='playstop'; + $tmpactiontext=$langs->trans("Unactivate"); + } if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->desactiver)) { print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&ligne=' . $object->lines[$cursorline - 1]->id . '&action=' . $tmpaction . '">'; print img_picto($tmpactiontext, $tmpactionpicto); print '</a>'; } - } - } - print '</td>'; - print "</tr>\n"; + } + } + print '</td>'; + print "</tr>\n"; - print '<tr '.$bcnd[$var].'>'; + print '<tr '.$bcnd[$var].'>'; - print '<td>'; - // Si pas encore active - if (! $objp->date_debut_reelle) { - print $langs->trans("DateStartReal").': '; - if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle, 'day'); - else print $langs->trans("ContractStatusNotRunning"); - } - // Si active et en cours - if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) { - print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle, 'day'); - } - // Si desactive - if ($objp->date_debut_reelle && $objp->date_fin_reelle) { - print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle, 'day'); - print '  -  '; - print $langs->trans("DateEndReal").': '; - print dol_print_date($objp->date_fin_reelle, 'day'); - } - if (! empty($objp->comment)) print "<br>".$objp->comment; - print '</td>'; + print '<td>'; + // Si pas encore active + if (! $objp->date_debut_reelle) { + print $langs->trans("DateStartReal").': '; + if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle, 'day'); + else print $langs->trans("ContractStatusNotRunning"); + } + // Si active et en cours + if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) { + print $langs->trans("DateStartReal").': '; + print dol_print_date($objp->date_debut_reelle, 'day'); + } + // Si desactive + if ($objp->date_debut_reelle && $objp->date_fin_reelle) { + print $langs->trans("DateStartReal").': '; + print dol_print_date($objp->date_debut_reelle, 'day'); + print '  -  '; + print $langs->trans("DateEndReal").': '; + print dol_print_date($objp->date_fin_reelle, 'day'); + } + if (! empty($objp->comment)) print "<br>".$objp->comment; + print '</td>'; - print '<td align="center"> </td>'; + print '<td align="center"> </td>'; - print '</tr>'; - print '</table>'; - } + print '</tr>'; + print '</table>'; + } - // Form to activate line - if ($user->rights->contrat->activer && $action == 'activateline' && $object->lines[$cursorline-1]->id == GETPOST('ligne')) - { - print '<form name="active" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.GETPOST('ligne').'&action=active" method="post">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + // Form to activate line + if ($user->rights->contrat->activer && $action == 'activateline' && $object->lines[$cursorline-1]->id == GETPOST('ligne')) + { + print '<form name="active" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.GETPOST('ligne').'&action=active" method="post">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<table class="noborder tableforservicepart2'.($cursorline < $nbofservices ?' boxtablenobottom':'').'" width="100%">'; + print '<table class="noborder tableforservicepart2'.($cursorline < $nbofservices ?' boxtablenobottom':'').'" width="100%">'; - // Definie date debut et fin par defaut - $dateactstart = $objp->date_debut; - if (GETPOST('remonth')) $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - elseif (! $dateactstart) $dateactstart = time(); + // Definie date debut et fin par defaut + $dateactstart = $objp->date_debut; + if (GETPOST('remonth')) $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + elseif (! $dateactstart) $dateactstart = time(); - $dateactend = $objp->date_fin; - if (GETPOST('endmonth')) $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - elseif (! $dateactend) - { - if ($objp->fk_product > 0) - { - $product=new Product($db); - $product->fetch($objp->fk_product); - $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); - } - } + $dateactend = $objp->date_fin; + if (GETPOST('endmonth')) $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); + elseif (! $dateactend) + { + if ($objp->fk_product > 0) + { + $product=new Product($db); + $product->fetch($objp->fk_product); + $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + } + } - print '<tr '.$bc[false].'>'; - print '<td class="nohover">'.$langs->trans("DateServiceActivate").'</td><td class="nohover">'; - print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1); - print '</td>'; - print '<td class="nohover">'.$langs->trans("DateEndPlanned").'</td><td class="nohover">'; - print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1); - print '</td>'; - print '<td class="center nohover">'; - print '</td>'; + print '<tr '.$bc[false].'>'; + print '<td class="nohover">'.$langs->trans("DateServiceActivate").'</td><td class="nohover">'; + print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1); + print '</td>'; + print '<td class="nohover">'.$langs->trans("DateEndPlanned").'</td><td class="nohover">'; + print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1); + print '</td>'; + print '<td class="center nohover">'; + print '</td>'; - print '</tr>'; + print '</tr>'; - print '<tr '.$bc[false].'>'; - print '<td class="nohover">'.$langs->trans("Comment").'</td><td colspan="3" class="nohover" colspan="'.($conf->margin->enabled?4:3).'"><input size="80" type="text" name="comment" value="'.$_POST["comment"].'"></td>'; - print '<td class="nohover right">'; - print '<input type="submit" class="button" name="activate" value="'.$langs->trans("Activate").'">   '; - print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; - print '</td>'; - print '</tr>'; + print '<tr '.$bc[false].'>'; + print '<td class="nohover">'.$langs->trans("Comment").'</td><td colspan="3" class="nohover" colspan="'.($conf->margin->enabled?4:3).'"><input size="80" type="text" name="comment" value="'.$_POST["comment"].'"></td>'; + print '<td class="nohover right">'; + print '<input type="submit" class="button" name="activate" value="'.$langs->trans("Activate").'">   '; + print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; + print '</td>'; + print '</tr>'; - print '</table>'; + print '</table>'; - print '</form>'; - } + print '</form>'; + } - if ($user->rights->contrat->activer && $action == 'unactivateline' && $object->lines[$cursorline-1]->id == GETPOST('ligne')) - { - /** - * Disable a contract line - */ - print '<!-- Form to disabled a line -->'."\n"; - print '<form name="closeline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.$object->lines[$cursorline-1]->id.'" method="post">'; + if ($user->rights->contrat->activer && $action == 'unactivateline' && $object->lines[$cursorline-1]->id == GETPOST('ligne')) + { + /** + * Disable a contract line + */ + print '<!-- Form to disabled a line -->'."\n"; + print '<form name="closeline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&ligne='.$object->lines[$cursorline-1]->id.'" method="post">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="closeline">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="closeline">'; - print '<table class="noborder tableforservicepart2 boxtablenobottom" width="100%">'; + print '<table class="noborder tableforservicepart2 boxtablenobottom" width="100%">'; - // Definie date debut et fin par defaut - $dateactstart = $objp->date_debut_reelle; - if (GETPOST('remonth')) $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - elseif (! $dateactstart) $dateactstart = time(); + // Definie date debut et fin par defaut + $dateactstart = $objp->date_debut_reelle; + if (GETPOST('remonth')) $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + elseif (! $dateactstart) $dateactstart = time(); - $dateactend = $objp->date_fin_reelle; - if (GETPOST('endmonth')) $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - elseif (! $dateactend) - { - if ($objp->fk_product > 0) - { - $product=new Product($db); - $product->fetch($objp->fk_product); - $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); - } - } - $now=dol_now(); - if ($dateactend > $now) $dateactend=$now; + $dateactend = $objp->date_fin_reelle; + if (GETPOST('endmonth')) $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); + elseif (! $dateactend) + { + if ($objp->fk_product > 0) + { + $product=new Product($db); + $product->fetch($objp->fk_product); + $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + } + } + $now=dol_now(); + if ($dateactend > $now) $dateactend=$now; - print '<tr '.$bc[false].'><td colspan="2" class="nohover">'; - if ($objp->statut >= 4) - { - if ($objp->statut == 4) - { - print $langs->trans("DateEndReal").' '; - print $form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1,1); - } - } - print '</td>'; - print '<td class="center nohover">'; - print '</td></tr>'; + print '<tr '.$bc[false].'><td colspan="2" class="nohover">'; + if ($objp->statut >= 4) + { + if ($objp->statut == 4) + { + print $langs->trans("DateEndReal").' '; + print $form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1,1); + } + } + print '</td>'; + print '<td class="center nohover">'; + print '</td></tr>'; - print '<tr '.$bc[false].'>'; - print '<td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover"><input size="70" type="text" class="flat" name="comment" value="'.dol_escape_htmltag(GETPOST('comment', 'alpha')).'"></td>'; - print '<td class="nohover right">'; - print '<input type="submit" class="button" name="close" value="'.$langs->trans("Unactivate").'">   '; - print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; - print '</td>'; - print '</tr>'; + print '<tr '.$bc[false].'>'; + print '<td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover"><input size="70" type="text" class="flat" name="comment" value="'.dol_escape_htmltag(GETPOST('comment', 'alpha')).'"></td>'; + print '<td class="nohover right">'; + print '<input type="submit" class="button" name="close" value="'.$langs->trans("Unactivate").'">   '; + print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; + print '</td>'; + print '</tr>'; - print '</table>'; + print '</table>'; - print '</form>'; - } + print '</form>'; + } - $cursorline++; - } + $cursorline++; + } // Form to add new line - if ($user->rights->contrat->creer && ($object->statut == 0)) - { - $dateSelector=1; + if ($user->rights->contrat->creer && ($object->statut == 0)) + { + $dateSelector=1; print "\n"; print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline')?'#add':'#line_'.GETPOST('lineid')).'" method="POST"> @@ -1994,15 +1994,15 @@ else <input type="hidden" name="id" value="'.$object->id.'"> '; - print '<div class="div-table-responsive-no-min">'; + print '<div class="div-table-responsive-no-min">'; print '<table id="tablelines" class="noborder noshadow" width="100%">'; // Array with (n*2)+1 lines - // Trick to not show product entries - $savproductenabled=$conf->product->enabled; - if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $conf->product->enabled = 0; + // Trick to not show product entries + $savproductenabled=$conf->product->enabled; + if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $conf->product->enabled = 0; - // Form to add new line - if ($action != 'editline') + // Form to add new line + if ($action != 'editline') { $var = true; @@ -2015,129 +2015,129 @@ else $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } - // Restore correct setup - $conf->product->enabled = $savproductenabled; + // Restore correct setup + $conf->product->enabled = $savproductenabled; - print '</table>'; - print '</div>'; - print '</form>'; - } + print '</table>'; + print '</div>'; + print '</form>'; + } dol_fiche_end(); - /* + /* * Buttons */ - if ($user->societe_id == 0) - { - print '<div class="tabsAction">'; + if ($user->societe_id == 0) + { + print '<div class="tabsAction">'; - $parameters=array(); - $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $parameters=array(); + $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) - { - // Send - if ($object->statut == 1) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>'; - } else - print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">' . $langs->trans('SendByMail') . '</a></div>'; - } + if (empty($reshook)) + { + // Send + if ($object->statut == 1) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { + print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>'; + } else + print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">' . $langs->trans('SendByMail') . '</a></div>'; + } - if ($object->statut == 0 && $nbofservices) - { - if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>'; - else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>'; - } - if ($object->statut == 1) - { - if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>'; - else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>'; - } + if ($object->statut == 0 && $nbofservices) + { + if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>'; + else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>'; + } + if ($object->statut == 1) + { + if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>'; + else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>'; + } - if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) - { - $langs->load("bills"); - if ($user->rights->facture->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateBill").'</a></div>'; - else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateBill").'</a></div>'; - } + if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + { + $langs->load("bills"); + if ($user->rights->facture->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateBill").'</a></div>'; + else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateBill").'</a></div>'; + } - if (! empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) - { - $langs->load("orders"); - if ($user->rights->commande->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateOrder").'</a></div>'; - else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateOrder").'</a></div>'; - } + if (! empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + { + $langs->load("orders"); + if ($user->rights->commande->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateOrder").'</a></div>'; + else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("CreateOrder").'</a></div>'; + } - // Clone - if ($user->rights->contrat->creer) { - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a></div>'; - } + // Clone + if ($user->rights->contrat->creer) { + print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a></div>'; + } - if ($object->nbofservicesclosed > 0) - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=activate">'.$langs->trans("ActivateAllContracts").'</a></div>'; - } - if ($object->nbofservicesclosed < $nbofservices) - { - //if (! $numactive) - //{ - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("CloseAllContracts").'</a></div>'; - //} - //else - //{ - // print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("CloseRefusedBecauseOneServiceActive").'">'.$langs->trans("Close").'</a></div>'; - //} - } + if ($object->nbofservicesclosed > 0) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=activate">'.$langs->trans("ActivateAllContracts").'</a></div>'; + } + if ($object->nbofservicesclosed < $nbofservices) + { + //if (! $numactive) + //{ + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("CloseAllContracts").'</a></div>'; + //} + //else + //{ + // print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("CloseRefusedBecauseOneServiceActive").'">'.$langs->trans("Close").'</a></div>'; + //} + } - // On peut supprimer entite si - // - Droit de creer + mode brouillon (erreur creation) - // - Droit de supprimer - if (($user->rights->contrat->creer && $object->statut == 0) || $user->rights->contrat->supprimer) - { - print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a></div>'; - } - else - { - print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("Delete").'</a></div>'; - } - } + // On peut supprimer entite si + // - Droit de creer + mode brouillon (erreur creation) + // - Droit de supprimer + if (($user->rights->contrat->creer && $object->statut == 0) || $user->rights->contrat->supprimer) + { + print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a></div>'; + } + else + { + print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("Delete").'</a></div>'; + } + } - print "</div>"; - } + print "</div>"; + } - // Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } - if ($action != 'presend') - { - print '<div class="fichecenter"><div class="fichehalfleft">'; + if ($action != 'presend') + { + print '<div class="fichecenter"><div class="fichehalfleft">'; - /* + /* * Documents generes */ - $filename = dol_sanitizeFileName($object->ref); - $filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref); - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->contrat->creer; - $delallowed = $user->rights->contrat->supprimer; + $filename = dol_sanitizeFileName($object->ref); + $filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref); + $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $genallowed = $user->rights->contrat->creer; + $delallowed = $user->rights->contrat->supprimer; - $var = true; + $var = true; - print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('contrat')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '</div><div class="fichehalfright"><div class="ficheaddleft">'; + print '</div><div class="fichehalfright"><div class="ficheaddleft">'; // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; @@ -2145,8 +2145,8 @@ else $somethingshown = $formactions->showactions($object, 'contract', $socid, 1); - print '</div></div></div>'; - } + print '</div></div></div>'; + } // Presend form $modelmail='contract'; @@ -2155,7 +2155,7 @@ else $trackid = 'con'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; - } + } } diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 66e37744cc7..d2082bfba01 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -267,22 +267,22 @@ class EmailSenderProfile extends CommonObject function getNomUrl($withpicto=0) { global $db, $conf, $langs; - global $dolibarr_main_authentication, $dolibarr_main_demo; - global $menumanager; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; - $result = ''; - $companylink = ''; + $result = ''; + $companylink = ''; - $url=''; - //$url = dol_buildpath('/monmodule/emailsenderprofile_card.php',1).'?id='.$this->id; + $url=''; + //$url = dol_buildpath('/monmodule/emailsenderprofile_card.php',1).'?id='.$this->id; $linkstart = ''; $linkend=''; - if ($withpicto) - { - $result.=($linkstart.img_object($label, 'label', 'class="classfortooltip"').$linkend); - if ($withpicto != 2) $result.=' '; + if ($withpicto) + { + $result.=($linkstart.img_object($label, 'label', 'class="classfortooltip"').$linkend); + if ($withpicto != 2) $result.=' '; } $result.= $linkstart . $this->label . $linkend; return $result; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7559179c87d..f105ef78263 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -34,289 +34,289 @@ */ class FormFile { - private $db; + private $db; - public $error; - public $numoffiles; - public $infofiles; // Used to return informations by function getDocumentsLink + public $error; + public $numoffiles; + public $infofiles; // Used to return informations by function getDocumentsLink - /** + /** * Constructor * * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - $this->numoffiles=0; - return 1; - } + */ + function __construct($db) + { + $this->db = $db; + $this->numoffiles=0; + return 1; + } - /** - * Show form to upload a new file + /** + * Show form to upload a new file * - * @param string $url Url - * @param string $title Title zone (Title or '' or 'none') - * @param int $addcancel 1=Add 'Cancel' button - * @param int $sectionid If upload must be done inside a particular ECM section - * @param int $perm Value of permission to allow upload - * @param int $size Length of input file area. Deprecated. - * @param Object $object Object to use (when attachment is done on an element) - * @param string $options Add an option column - * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. - * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' - * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files - * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) - * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') - * @return int <0 if KO, >0 if OK - */ - function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='') - { - global $conf,$langs, $hookmanager; - $hookmanager->initHooks(array('formfile')); + * @param string $url Url + * @param string $title Title zone (Title or '' or 'none') + * @param int $addcancel 1=Add 'Cancel' button + * @param int $sectionid If upload must be done inside a particular ECM section + * @param int $perm Value of permission to allow upload + * @param int $size Length of input file area. Deprecated. + * @param Object $object Object to use (when attachment is done on an element) + * @param string $options Add an option column + * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. + * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files + * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) + * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') + * @return int <0 if KO, >0 if OK + */ + function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='') + { + global $conf,$langs, $hookmanager; + $hookmanager->initHooks(array('formfile')); - if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0; + if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0; if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2)) - { - // TODO: Check this works with 2 forms on same page - // TODO: Check this works with GED module, otherwise, force useajax to 0 - // TODO: This does not support option savingdocmask - // TODO: This break feature to upload links too - return $this->_formAjaxFileUpload($object); - } - else - { - //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed - if (!$perm && !empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - return 1; - } + { + // TODO: Check this works with 2 forms on same page + // TODO: Check this works with GED module, otherwise, force useajax to 0 + // TODO: This does not support option savingdocmask + // TODO: This break feature to upload links too + return $this->_formAjaxFileUpload($object); + } + else + { + //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed + if (!$perm && !empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { + return 1; + } - $maxlength=$size; + $maxlength=$size; - $out = "\n\n<!-- Start form attach new file -->\n"; + $out = "\n\n<!-- Start form attach new file -->\n"; - if (empty($title)) $title=$langs->trans("AttachANewFile"); - if ($title != 'none') $out.=load_fiche_titre($title, null, null); + if (empty($title)) $title=$langs->trans("AttachANewFile"); + if ($title != 'none') $out.=load_fiche_titre($title, null, null); - $out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">'; - $out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="">'; - $out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">'; - $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + $out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">'; + $out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="">'; + $out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">'; + $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $out .= '<table width="100%" class="nobordernopadding">'; - $out .= '<tr>'; + $out .= '<table width="100%" class="nobordernopadding">'; + $out .= '<tr>'; - if (! empty($options)) $out .= '<td>'.$options.'</td>'; + if (! empty($options)) $out .= '<td>'.$options.'</td>'; - $out .= '<td valign="middle">'; + $out .= '<td valign="middle">'; - $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb - $maxphp=@ini_get('upload_max_filesize'); // En inconnu - if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1; - if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024; - if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024; - if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024; - // Now $max and $maxphp are in Kb - if ($maxphp > 0) $max=min($max,$maxphp); + $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb + $maxphp=@ini_get('upload_max_filesize'); // En inconnu + if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1; + if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024; + if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024; + if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024; + // Now $max and $maxphp are in Kb + if ($maxphp > 0) $max=min($max,$maxphp); - if ($max > 0) - { - $out .= '<input type="hidden" name="max_file_size" value="'.($max*1024).'">'; - } + if ($max > 0) + { + $out .= '<input type="hidden" name="max_file_size" value="'.($max*1024).'">'; + } - $out .= '<input class="flat minwidth400" type="file"'; - $out .= ((! empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic')?' name="userfile"':' name="userfile[]" multiple'); - $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); - $out .= (!empty($accept)?' accept="'.$accept.'"':' accept=""'); - $out .= '>'; - $out .= ' '; - $out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"'; - $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); - $out .= '>'; + $out .= '<input class="flat minwidth400" type="file"'; + $out .= ((! empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $conf->browser->layout != 'classic')?' name="userfile"':' name="userfile[]" multiple'); + $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); + $out .= (!empty($accept)?' accept="'.$accept.'"':' accept=""'); + $out .= '>'; + $out .= ' '; + $out .= '<input type="submit" class="button" name="sendit" value="'.$langs->trans("Upload").'"'; + $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); + $out .= '>'; - if ($addcancel) - { - $out .= '   '; - $out .= '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; - } + if ($addcancel) + { + $out .= '   '; + $out .= '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; + } - if (! empty($conf->global->MAIN_UPLOAD_DOC)) - { - if ($perm) - { - $langs->load('other'); - $out .= ' '; - $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); - } - } - else - { - $out .= ' ('.$langs->trans("UploadDisabled").')'; - } - $out .= "</td></tr>"; + if (! empty($conf->global->MAIN_UPLOAD_DOC)) + { + if ($perm) + { + $langs->load('other'); + $out .= ' '; + $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + } + } + else + { + $out .= ' ('.$langs->trans("UploadDisabled").')'; + } + $out .= "</td></tr>"; - if ($savingdocmask) - { - $out .= '<tr>'; - if (! empty($options)) $out .= '<td>'.$options.'</td>'; - $out .= '<td valign="middle" class="nowrap">'; + if ($savingdocmask) + { + $out .= '<tr>'; + if (! empty($options)) $out .= '<td>'.$options.'</td>'; + $out .= '<td valign="middle" class="nowrap">'; $out .= '<input type="checkbox" checked class="savingdocmask" name="savingdocmask" value="'.dol_escape_js($savingdocmask).'"> '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/',$langs->transnoentitiesnoconv("OriginFileName"),$savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); - $out .= '</td>'; - $out .= '</tr>'; - } + $out .= '</td>'; + $out .= '</tr>'; + } - $out .= "</table>"; + $out .= "</table>"; - $out .= '</form>'; - if (empty($sectionid)) $out .= '<br>'; + $out .= '</form>'; + if (empty($sectionid)) $out .= '<br>'; - $out .= "\n<!-- End form attach new file -->\n"; + $out .= "\n<!-- End form attach new file -->\n"; - if ($linkfiles) - { - $out .= "\n<!-- Start form attach new link -->\n"; - $langs->load('link'); - $title = $langs->trans("LinkANewFile"); - $out .= load_fiche_titre($title, null, null); - $out .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">'; - $out .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">'; - $out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">'; - $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + if ($linkfiles) + { + $out .= "\n<!-- Start form attach new link -->\n"; + $langs->load('link'); + $title = $langs->trans("LinkANewFile"); + $out .= load_fiche_titre($title, null, null); + $out .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">'; + $out .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">'; + $out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">'; + $out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $out .= '<div class="valignmiddle" >'; - $out .= '<div class="inline-block" style="padding-right: 10px;">'; - if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="link">'.$langs->trans("URLToLink") . ':</label> '; - $out .= '<input type="text" name="link" class="flat minwidth400imp" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">'; - $out .= '</div>'; - $out .= '<div class="inline-block" style="padding-right: 10px;">'; - if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="label">'.$langs->trans("Label") . ':</label> '; - $out .= '<input type="text" class="flat" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">'; - $out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">'; - $out .= '<input type="hidden" name="objectid" value="' . $object->id . '">'; - $out .= '</div>'; - $out .= '<div class="inline-block" style="padding-right: 10px;">'; - $out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("ToLink").'"'; - $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); - $out .= '>'; - $out .= '</div>'; - $out .= '</div>'; - $out .= '<div class="clearboth"></div>'; - $out .= '</form><br>'; - $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm); - $res = $hookmanager->executeHooks('formattachOptions',$parameters,$object); + $out .= '<div class="valignmiddle" >'; + $out .= '<div class="inline-block" style="padding-right: 10px;">'; + if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="link">'.$langs->trans("URLToLink") . ':</label> '; + $out .= '<input type="text" name="link" class="flat minwidth400imp" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">'; + $out .= '</div>'; + $out .= '<div class="inline-block" style="padding-right: 10px;">'; + if (! empty($conf->global->OPTIMIZEFORTEXTBROWSER)) $out .= '<label for="label">'.$langs->trans("Label") . ':</label> '; + $out .= '<input type="text" class="flat" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">'; + $out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">'; + $out .= '<input type="hidden" name="objectid" value="' . $object->id . '">'; + $out .= '</div>'; + $out .= '<div class="inline-block" style="padding-right: 10px;">'; + $out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("ToLink").'"'; + $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); + $out .= '>'; + $out .= '</div>'; + $out .= '</div>'; + $out .= '<div class="clearboth"></div>'; + $out .= '</form><br>'; + $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm); + $res = $hookmanager->executeHooks('formattachOptions',$parameters,$object); - $out .= "\n<!-- End form attach new file -->\n"; - } + $out .= "\n<!-- End form attach new file -->\n"; + } - if (empty($res)) - { - print '<div class="attacharea attacharea'.$htmlname.'">'; - print $out; - print '</div>'; - } + if (empty($res)) + { + print '<div class="attacharea attacharea'.$htmlname.'">'; + print $out; + print '</div>'; + } - print $hookmanager->resPrint; + print $hookmanager->resPrint; - return 1; - } - } + return 1; + } + } - /** - * Show the box with list of available documents for object - * - * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. - * @param string $filedir Directory to scan - * @param string $urlsource Url of origin page (for return) - * @param int $genallowed Generation is allowed (1/0 or array of formats) - * @param int $delallowed Remove is allowed (1/0) - * @param string $modelselected Model to preselect by default - * @param integer $allowgenifempty Show warning if no model activated - * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) - * @param int $iconPDF Show only PDF icon with link (1/0) - * @param int $notused Not used - * @param integer $noform Do not output html form tags - * @param string $param More param on http links - * @param string $title Title to show on top of form - * @param string $buttonlabel Label on submit button - * @param string $codelang Default language code to use on lang combo box if multilang is enabled - * @return int <0 if KO, number of shown files if OK - * @deprecated Use print xxx->showdocuments() instead. - */ - function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') - { - $this->numoffiles=0; - print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang); - return $this->numoffiles; - } + /** + * Show the box with list of available documents for object + * + * @param string $modulepart propal, facture, facture_fourn, ... + * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. + * @param string $filedir Directory to scan + * @param string $urlsource Url of origin page (for return) + * @param int $genallowed Generation is allowed (1/0 or array of formats) + * @param int $delallowed Remove is allowed (1/0) + * @param string $modelselected Model to preselect by default + * @param integer $allowgenifempty Show warning if no model activated + * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) + * @param int $iconPDF Show only PDF icon with link (1/0) + * @param int $notused Not used + * @param integer $noform Do not output html form tags + * @param string $param More param on http links + * @param string $title Title to show on top of form + * @param string $buttonlabel Label on submit button + * @param string $codelang Default language code to use on lang combo box if multilang is enabled + * @return int <0 if KO, number of shown files if OK + * @deprecated Use print xxx->showdocuments() instead. + */ + function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + { + $this->numoffiles=0; + print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang); + return $this->numoffiles; + } - /** - * Return a string to show the box with list of available documents for object. - * This also set the property $this->numoffiles - * - * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...) - * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. - * @param string $filedir Directory to scan - * @param string $urlsource Url of origin page (for return) - * @param int $genallowed Generation is allowed (1/0 or array list of templates) - * @param int $delallowed Remove is allowed (1/0) - * @param string $modelselected Model to preselect by default - * @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) - * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) - * @param int $iconPDF Deprecated, see getDocumentsLink - * @param int $notused Not used - * @param integer $noform Do not output html form tags - * @param string $param More param on http links - * @param string $title Title to show on top of form - * @param string $buttonlabel Label on submit button - * @param string $codelang Default language code to use on lang combo box if multilang is enabled - * @param string $morepicto Add more HTML content into cell with picto - * @param Object $object Object when method is called from an object card. - * @return string Output string with HTML array of documents (might be empty string) - */ - function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null) - { + /** + * Return a string to show the box with list of available documents for object. + * This also set the property $this->numoffiles + * + * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...) + * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. + * @param string $filedir Directory to scan + * @param string $urlsource Url of origin page (for return) + * @param int $genallowed Generation is allowed (1/0 or array list of templates) + * @param int $delallowed Remove is allowed (1/0) + * @param string $modelselected Model to preselect by default + * @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) + * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) + * @param int $iconPDF Deprecated, see getDocumentsLink + * @param int $notused Not used + * @param integer $noform Do not output html form tags + * @param string $param More param on http links + * @param string $title Title to show on top of form + * @param string $buttonlabel Label on submit button + * @param string $codelang Default language code to use on lang combo box if multilang is enabled + * @param string $morepicto Add more HTML content into cell with picto + * @param Object $object Object when method is called from an object card. + * @return string Output string with HTML array of documents (might be empty string) + */ + function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null) + { // Deprecation warning if (0 !== $iconPDF) { dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING); } - global $langs, $conf, $user, $hookmanager; - global $form, $bc; + global $langs, $conf, $user, $hookmanager; + global $form, $bc; - if (! is_object($form)) $form=new Form($this->db); + if (! is_object($form)) $form=new Form($this->db); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - // For backward compatibility - if (! empty($iconPDF)) { - return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); - } + // For backward compatibility + if (! empty($iconPDF)) { + return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); + } - $printer=0; - if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements - { - $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false; - } + $printer=0; + if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements + { + $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false; + } - $hookmanager->initHooks(array('formfile')); - $forname='builddoc'; - $out=''; + $hookmanager->initHooks(array('formfile')); + $forname='builddoc'; + $out=''; - $headershown=0; - $showempty=0; - $i=0; + $headershown=0; + $showempty=0; + $i=0; - $out.= "\n".'<!-- Start show_document -->'."\n"; - //print 'filedir='.$filedir; + $out.= "\n".'<!-- Start show_document -->'."\n"; + //print 'filedir='.$filedir; - if (preg_match('/massfilesarea_/', $modulepart)) - { - $out.='<div id="show_files"><br></div>'."\n"; + if (preg_match('/massfilesarea_/', $modulepart)) + { + $out.='<div id="show_files"><br></div>'."\n"; $title=$langs->trans("MassFilesArea").' <a href="" id="togglemassfilesarea" ref="shown">('.$langs->trans("Hide").')</a>'; $title.='<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { @@ -337,373 +337,373 @@ class FormFile }); }); </script>'; - } + } - $titletoshow=$langs->trans("Documents"); - if (! empty($title)) $titletoshow=$title; + $titletoshow=$langs->trans("Documents"); + if (! empty($title)) $titletoshow=$title; - // Show table - if ($genallowed) - { - $modellist=array(); + // Show table + if ($genallowed) + { + $modellist=array(); - if ($modulepart == 'company') - { - $showempty=1; - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'; - $modellist=ModeleThirdPartyDoc::liste_modeles($this->db); - } - } - else if ($modulepart == 'propal') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; - $modellist=ModelePDFPropales::liste_modeles($this->db); - } - } + if ($modulepart == 'company') + { + $showempty=1; + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'; + $modellist=ModeleThirdPartyDoc::liste_modeles($this->db); + } + } + else if ($modulepart == 'propal') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; + $modellist=ModelePDFPropales::liste_modeles($this->db); + } + } else if ($modulepart == 'supplier_proposal') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php'; - $modellist=ModelePDFSupplierProposal::liste_modeles($this->db); - } - } - else if ($modulepart == 'commande') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; - $modellist=ModelePDFCommandes::liste_modeles($this->db); - } - } - elseif ($modulepart == 'expedition') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; - $modellist=ModelePDFExpedition::liste_modeles($this->db); - } - } - elseif ($modulepart == 'livraison') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; - $modellist=ModelePDFDeliveryOrder::liste_modeles($this->db); - } - } - else if ($modulepart == 'ficheinter') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; - $modellist=ModelePDFFicheinter::liste_modeles($this->db); - } - } - elseif ($modulepart == 'facture') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; - $modellist=ModelePDFFactures::liste_modeles($this->db); - } - } - elseif ($modulepart == 'contract') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; - $modellist=ModelePDFContract::liste_modeles($this->db); - } - } - elseif ($modulepart == 'project') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; - $modellist=ModelePDFProjects::liste_modeles($this->db); - } - } - elseif ($modulepart == 'project_task') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; - $modellist=ModelePDFTask::liste_modeles($this->db); - } - } - elseif ($modulepart == 'product') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'; - $modellist=ModelePDFProduct::liste_modeles($this->db); - } - } - elseif ($modulepart == 'export') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; - $modellist=ModeleExports::liste_modeles($this->db); - } - } - else if ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php'; - $modellist=ModelePDFSuppliersOrders::liste_modeles($this->db); - } - } - else if ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; - $modellist=ModelePDFSuppliersInvoices::liste_modeles($this->db); - } - } + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php'; + $modellist=ModelePDFSupplierProposal::liste_modeles($this->db); + } + } + else if ($modulepart == 'commande') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; + $modellist=ModelePDFCommandes::liste_modeles($this->db); + } + } + elseif ($modulepart == 'expedition') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; + $modellist=ModelePDFExpedition::liste_modeles($this->db); + } + } + elseif ($modulepart == 'livraison') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; + $modellist=ModelePDFDeliveryOrder::liste_modeles($this->db); + } + } + else if ($modulepart == 'ficheinter') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; + $modellist=ModelePDFFicheinter::liste_modeles($this->db); + } + } + elseif ($modulepart == 'facture') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; + $modellist=ModelePDFFactures::liste_modeles($this->db); + } + } + elseif ($modulepart == 'contract') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; + $modellist=ModelePDFContract::liste_modeles($this->db); + } + } + elseif ($modulepart == 'project') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; + $modellist=ModelePDFProjects::liste_modeles($this->db); + } + } + elseif ($modulepart == 'project_task') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; + $modellist=ModelePDFTask::liste_modeles($this->db); + } + } + elseif ($modulepart == 'product') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'; + $modellist=ModelePDFProduct::liste_modeles($this->db); + } + } + elseif ($modulepart == 'export') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; + $modellist=ModeleExports::liste_modeles($this->db); + } + } + else if ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php'; + $modellist=ModelePDFSuppliersOrders::liste_modeles($this->db); + } + } + else if ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; + $modellist=ModelePDFSuppliersInvoices::liste_modeles($this->db); + } + } else if ($modulepart == 'supplier_payment') { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_payment/modules_supplier_payment.php'; - $modellist=ModelePDFSuppliersPayments::liste_modeles($this->db); - } - } - else if ($modulepart == 'remisecheque') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/cheque/modules_chequereceipts.php'; - $modellist=ModeleChequeReceipts::liste_modeles($this->db); - } - } - elseif ($modulepart == 'donation') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; - $modellist=ModeleDon::liste_modeles($this->db); - } - } - elseif ($modulepart == 'member') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php'; - $modellist=ModelePDFCards::liste_modeles($this->db); - } - } - elseif ($modulepart == 'agenda') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/action/modules_action.php'; - $modellist=ModeleAction::liste_modeles($this->db); - } - } - else if ($modulepart == 'expensereport') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; - $modellist=ModeleExpenseReport::liste_modeles($this->db); - } - } - else if ($modulepart == 'unpaid') - { - $modellist=''; - } - elseif ($modulepart == 'user') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/user/modules_user.class.php'; - $modellist=ModelePDFUser::liste_modeles($this->db); - } - } - elseif ($modulepart == 'usergroup') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once DOL_DOCUMENT_ROOT.'/core/modules/usergroup/modules_usergroup.class.php'; - $modellist=ModelePDFUserGroup::liste_modeles($this->db); - } - } - else //if ($modulepart != 'agenda') - { - // For normalized standard modules - $file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0); - if (file_exists($file)) - { - $res=include_once $file; - } - // For normalized external modules - else + if (is_array($genallowed)) $modellist=$genallowed; + else { - $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0); - $res=include_once $file; - } - $class='Modele'.ucfirst($modulepart); - if (class_exists($class)) - { - $modellist=call_user_func($class.'::liste_modeles',$this->db); - } - else - { - dol_print_error($this->db,'Bad value for modulepart'); - return -1; - } - } + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_payment/modules_supplier_payment.php'; + $modellist=ModelePDFSuppliersPayments::liste_modeles($this->db); + } + } + else if ($modulepart == 'remisecheque') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/cheque/modules_chequereceipts.php'; + $modellist=ModeleChequeReceipts::liste_modeles($this->db); + } + } + elseif ($modulepart == 'donation') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; + $modellist=ModeleDon::liste_modeles($this->db); + } + } + elseif ($modulepart == 'member') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php'; + $modellist=ModelePDFCards::liste_modeles($this->db); + } + } + elseif ($modulepart == 'agenda') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/action/modules_action.php'; + $modellist=ModeleAction::liste_modeles($this->db); + } + } + else if ($modulepart == 'expensereport') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; + $modellist=ModeleExpenseReport::liste_modeles($this->db); + } + } + else if ($modulepart == 'unpaid') + { + $modellist=''; + } + elseif ($modulepart == 'user') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/user/modules_user.class.php'; + $modellist=ModelePDFUser::liste_modeles($this->db); + } + } + elseif ($modulepart == 'usergroup') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once DOL_DOCUMENT_ROOT.'/core/modules/usergroup/modules_usergroup.class.php'; + $modellist=ModelePDFUserGroup::liste_modeles($this->db); + } + } + else //if ($modulepart != 'agenda') + { + // For normalized standard modules + $file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0); + if (file_exists($file)) + { + $res=include_once $file; + } + // For normalized external modules + else + { + $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0); + $res=include_once $file; + } + $class='Modele'.ucfirst($modulepart); + if (class_exists($class)) + { + $modellist=call_user_func($class.'::liste_modeles',$this->db); + } + else + { + dol_print_error($this->db,'Bad value for modulepart'); + return -1; + } + } - // Set headershown to avoit to have table opened a second time later - $headershown=1; + // Set headershown to avoit to have table opened a second time later + $headershown=1; - $buttonlabeltoshow=$buttonlabel; - if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); + $buttonlabeltoshow=$buttonlabel; + if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation - if (empty($noform)) $out.= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" id="'.$forname.'_form" method="post">'; - $out.= '<input type="hidden" name="action" value="builddoc">'; - $out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation + if (empty($noform)) $out.= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" id="'.$forname.'_form" method="post">'; + $out.= '<input type="hidden" name="action" value="builddoc">'; + $out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $out.= load_fiche_titre($titletoshow, '', ''); - $out.= '<div class="div-table-responsive-no-min">'; - $out.= '<table class="liste formdoc noborder" summary="listofdocumentstable" width="100%">'; + $out.= load_fiche_titre($titletoshow, '', ''); + $out.= '<div class="div-table-responsive-no-min">'; + $out.= '<table class="liste formdoc noborder" summary="listofdocumentstable" width="100%">'; - $out.= '<tr class="liste_titre">'; + $out.= '<tr class="liste_titre">'; - $addcolumforpicto=($delallowed || $printer || $morepicto); - $out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">'; + $addcolumforpicto=($delallowed || $printer || $morepicto); + $out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">'; - // Model - if (! empty($modellist)) - { - $out.= '<span class="hideonsmartphone">'.$langs->trans('Model').' </span>'; - if (is_array($modellist) && count($modellist) == 1) // If there is only one element - { - $arraykeys=array_keys($modellist); - $modelselected=$arraykeys[0]; - } - $out.= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); - $out.= ajax_combobox('model'); - } - else - { - $out.= '<div class="float">'.$langs->trans("Files").'</div>'; - } + // Model + if (! empty($modellist)) + { + $out.= '<span class="hideonsmartphone">'.$langs->trans('Model').' </span>'; + if (is_array($modellist) && count($modellist) == 1) // If there is only one element + { + $arraykeys=array_keys($modellist); + $modelselected=$arraykeys[0]; + } + $out.= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); + $out.= ajax_combobox('model'); + } + else + { + $out.= '<div class="float">'.$langs->trans("Files").'</div>'; + } - // Language code (if multilang) - if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty)) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; - $formadmin=new FormAdmin($this->db); - $defaultlang=$codelang?$codelang:$langs->getDefaultLang(); - $morecss='maxwidth150'; - if (! empty($conf->browser->phone)) $morecss='maxwidth100'; - $out.= $formadmin->select_language($defaultlang, 'lang_id', 0, 0, 0, 0, 0, $morecss); - } - else - { - $out.= ' '; - } + // Language code (if multilang) + if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + $formadmin=new FormAdmin($this->db); + $defaultlang=$codelang?$codelang:$langs->getDefaultLang(); + $morecss='maxwidth150'; + if (! empty($conf->browser->phone)) $morecss='maxwidth100'; + $out.= $formadmin->select_language($defaultlang, 'lang_id', 0, 0, 0, 0, 0, $morecss); + } + else + { + $out.= ' '; + } - // Button - $genbutton = '<input class="button buttongen" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"'; - $genbutton.= ' type="submit" value="'.$buttonlabel.'"'; - if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled'; - $genbutton.= '>'; - if ($allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') - { - $langs->load("errors"); - $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); - } - if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; - if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton=''; - $out.= $genbutton; - $out.= '</th>'; + // Button + $genbutton = '<input class="button buttongen" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"'; + $genbutton.= ' type="submit" value="'.$buttonlabel.'"'; + if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled'; + $genbutton.= '>'; + if ($allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') + { + $langs->load("errors"); + $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); + } + if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; + if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton=''; + $out.= $genbutton; + $out.= '</th>'; - if (!empty($hookmanager->hooks['formfile'])) - { - foreach($hookmanager->hooks['formfile'] as $module) - { - if (method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>'; - } - } - $out.= '</tr>'; + if (!empty($hookmanager->hooks['formfile'])) + { + foreach($hookmanager->hooks['formfile'] as $module) + { + if (method_exists($module, 'formBuilddocLineOptions')) $out .= '<th></th>'; + } + } + $out.= '</tr>'; - // Execute hooks - $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart); - if (is_object($hookmanager)) - { - $reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']); - $out.= $hookmanager->resPrint; - } + // Execute hooks + $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart); + if (is_object($hookmanager)) + { + $reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']); + $out.= $hookmanager->resPrint; + } - } + } - // Get list of files - if (! empty($filedir)) - { - $file_list=dol_dir_list($filedir,'files',0,'','(\.meta|_preview.*.*\.png)$','date',SORT_DESC); + // Get list of files + if (! empty($filedir)) + { + $file_list=dol_dir_list($filedir,'files',0,'','(\.meta|_preview.*.*\.png)$','date',SORT_DESC); - $link_list = array(); - if (is_object($object)) - { - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; - $link = new Link($this->db); - $sortfield = $sortorder = null; - $res = $link->fetchAll($link_list, $object->element, $object->id, $sortfield, $sortorder); - } + $link_list = array(); + if (is_object($object)) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $link = new Link($this->db); + $sortfield = $sortorder = null; + $res = $link->fetchAll($link_list, $object->element, $object->id, $sortfield, $sortorder); + } - $out.= '<!-- html.formfile::showdocuments -->'."\n"; + $out.= '<!-- html.formfile::showdocuments -->'."\n"; - // Show title of array if not already shown - if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart)) && ! $headershown) - { - $headershown=1; - $out.= '<div class="titre">'.$titletoshow.'</div>'."\n"; - $out.= '<div class="div-table-responsive-no-min">'; - $out.= '<table class="noborder" summary="listofdocumentstable" id="'.$modulepart.'_table" width="100%">'."\n"; - } + // Show title of array if not already shown + if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart)) && ! $headershown) + { + $headershown=1; + $out.= '<div class="titre">'.$titletoshow.'</div>'."\n"; + $out.= '<div class="div-table-responsive-no-min">'; + $out.= '<table class="noborder" summary="listofdocumentstable" id="'.$modulepart.'_table" width="100%">'."\n"; + } - // Loop on each file found + // Loop on each file found if (is_array($file_list)) { foreach($file_list as $file) { // Define relative path for download link (depends on module) $relativepath=$file["name"]; // Cas general - if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... + if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... if ($modulepart == 'export') $relativepath = $file["name"]; // Other case $out.= '<tr class="oddeven">'; @@ -713,8 +713,8 @@ class FormFile // Show file name with link to download $out.= '<td class="tdoverflowmax300">'; - $tmp = $this->showPreview($file,$modulepart,$relativepath,0,$param); - $out.= ($tmp?$tmp.' ':''); + $tmp = $this->showPreview($file,$modulepart,$relativepath,0,$param); + $out.= ($tmp?$tmp.' ':''); $out.= '<a class="documentdownload" href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($relativepath).($param?'&'.$param:'').'"'; $mime=dol_mimetype($relativepath,'',0); if (preg_match('/text/',$mime)) $out.= ' target="_blank"'; @@ -746,188 +746,188 @@ class FormFile if ($printer) { //$out.= '<td align="right">'; - $out.= ' <a href="'.$urlsource.(strpos($urlsource,'?')?'&':'?').'action=print_file&printer='.$modulepart.'&file='.urlencode($relativepath); - $out.= ($param?'&'.$param:''); - $out.= '">'.img_picto($langs->trans("PrintFile", $relativepath),'printer.png').'</a>'; + $out.= ' <a href="'.$urlsource.(strpos($urlsource,'?')?'&':'?').'action=print_file&printer='.$modulepart.'&file='.urlencode($relativepath); + $out.= ($param?'&'.$param:''); + $out.= '">'.img_picto($langs->trans("PrintFile", $relativepath),'printer.png').'</a>'; } if ($morepicto) { $morepicto=preg_replace('/__FILENAMEURLENCODED__/',urlencode($relativepath),$morepicto); - $out.=$morepicto; + $out.=$morepicto; } - $out.='</td>'; - } + $out.='</td>'; + } - if (is_object($hookmanager)) - { - $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart,'relativepath'=>$relativepath); - $res = $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); - if (empty($res)) - { - $out .= $hookmanager->resPrint; // Complete line - $out.= '</tr>'; - } - else $out = $hookmanager->resPrint; // Replace line - } + if (is_object($hookmanager)) + { + $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart,'relativepath'=>$relativepath); + $res = $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); + if (empty($res)) + { + $out .= $hookmanager->resPrint; // Complete line + $out.= '</tr>'; + } + else $out = $hookmanager->resPrint; // Replace line + } } - $this->numoffiles++; - } - // Loop on each file found - if (is_array($link_list)) - { - $colspan=2; + $this->numoffiles++; + } + // Loop on each file found + if (is_array($link_list)) + { + $colspan=2; - foreach($link_list as $file) - { - $out.='<tr class="oddeven">'; - $out.='<td colspan="'.$colspan.'" class="maxwidhtonsmartphone">'; - $out.='<a data-ajax="false" href="' . $link->url . '" target="_blank">'; - $out.=$file->label; - $out.='</a>'; - $out.='</td>'; - $out.='<td align="right">'; - $out.=dol_print_date($file->datea,'dayhour'); - $out.='</td>'; - if ($delallowed || $printer || $morepicto) $out.='<td></td>'; - $out.='</tr>'."\n"; - } - $this->numoffiles++; - } + foreach($link_list as $file) + { + $out.='<tr class="oddeven">'; + $out.='<td colspan="'.$colspan.'" class="maxwidhtonsmartphone">'; + $out.='<a data-ajax="false" href="' . $link->url . '" target="_blank">'; + $out.=$file->label; + $out.='</a>'; + $out.='</td>'; + $out.='<td align="right">'; + $out.=dol_print_date($file->datea,'dayhour'); + $out.='</td>'; + if ($delallowed || $printer || $morepicto) $out.='<td></td>'; + $out.='</tr>'."\n"; + } + $this->numoffiles++; + } if (count($file_list) == 0 && count($link_list) == 0 && $headershown) - { - $out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>'."\n"; - } + { + $out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>'."\n"; + } - } + } - if ($headershown) - { - // Affiche pied du tableau - $out.= "</table>\n"; - $out.= "</div>\n"; - if ($genallowed) - { - if (empty($noform)) $out.= '</form>'."\n"; - } - } - $out.= '<!-- End show_document -->'."\n"; - //return ($i?$i:$headershown); - return $out; - } + if ($headershown) + { + // Affiche pied du tableau + $out.= "</table>\n"; + $out.= "</div>\n"; + if ($genallowed) + { + if (empty($noform)) $out.= '</form>'."\n"; + } + } + $out.= '<!-- End show_document -->'."\n"; + //return ($i?$i:$headershown); + return $out; + } - /** - * Show a Document icon with link(s) - * You may want to call this into a div like this: - * print '<div class="inline-block valignmiddle">'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'</div>'; - * - * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. - * @param string $filedir Full path to directory to scan - * @param string $filter Filter filenames on this regex string (Example: '\.pdf$') - * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles - */ - function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter='') - { - global $conf, $langs; + /** + * Show a Document icon with link(s) + * You may want to call this into a div like this: + * print '<div class="inline-block valignmiddle">'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'</div>'; + * + * @param string $modulepart propal, facture, facture_fourn, ... + * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. + * @param string $filedir Full path to directory to scan + * @param string $filter Filter filenames on this regex string (Example: '\.pdf$') + * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles + */ + function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter='') + { + global $conf, $langs; - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $out=''; - $this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array()); + $out=''; + $this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array()); - $filterforfilesearch = preg_quote(basename($modulesubdir),'/').'[^\-]+'; + $filterforfilesearch = preg_quote(basename($modulesubdir),'/').'[^\-]+'; - $file_list=dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files) + $file_list=dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files) - // For ajax treatment + // For ajax treatment $out.= '<!-- html.formfile::getDocumentsLink -->'."\n"; - if (! empty($file_list)) - { - $out='<dl class="dropdown inline-block"> + if (! empty($file_list)) + { + $out='<dl class="dropdown inline-block"> <dt><a data-ajax="false" href="#" onClick="return false;">'.img_picto('', 'listlight').'</a></dt> <dd><div class="multichoicedoc" style="position:absolute;left:100px;" ><ul class="ulselectedfields" style="display: none;">'; - $tmpout=''; + $tmpout=''; - // Loop on each file found - foreach($file_list as $file) - { - $i++; - if ($filter && ! preg_match('/'.$filter.'/i', $file["name"])) continue; // Discard this. It does not match provided filter. + // Loop on each file found + foreach($file_list as $file) + { + $i++; + if ($filter && ! preg_match('/'.$filter.'/i', $file["name"])) continue; // Discard this. It does not match provided filter. - // Define relative path for download link (depends on module) - $relativepath=$file["name"]; // Cas general - if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... - // Autre cas - if ($modulepart == 'donation') { - $relativepath = get_exdir($modulesubdir,2,0,0,null,'donation').$file["name"]; - } - if ($modulepart == 'export') { - $relativepath = $file["name"]; - } + // Define relative path for download link (depends on module) + $relativepath=$file["name"]; // Cas general + if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... + // Autre cas + if ($modulepart == 'donation') { + $relativepath = get_exdir($modulesubdir,2,0,0,null,'donation').$file["name"]; + } + if ($modulepart == 'export') { + $relativepath = $file["name"]; + } - $this->infofiles['nboffiles']++; - $this->infofiles['files'][]=$file['fullname']; - $ext=pathinfo($file["name"], PATHINFO_EXTENSION); - if (empty($this->infofiles[$ext])) $this->infofiles['extensions'][$ext]=1; - else $this->infofiles['extensions'][$ext]++; + $this->infofiles['nboffiles']++; + $this->infofiles['files'][]=$file['fullname']; + $ext=pathinfo($file["name"], PATHINFO_EXTENSION); + if (empty($this->infofiles[$ext])) $this->infofiles['extensions'][$ext]=1; + else $this->infofiles['extensions'][$ext]++; - // Preview - if (! empty($conf->use_javascript_ajax) && ($conf->browser->layout != 'phone')) - { - $tmparray = getAdvancedPreviewUrl($modulepart, $relativepath, 1, '&entity='.$entity); - if ($tmparray && $tmparray['url']) $tmpout.= '<li><a href="'.$tmparray['url'].'"'.($tmparray['css']?' class="'.$tmparray['css'].'"':'').($tmparray['mime']?' mime="'.$tmparray['mime'].'"':'').($tmparray['target']?' target="'.$tmparray['target'].'"':'').'>'.img_picto('','detail').' '.$langs->trans("Preview").' '.$ext.'</a></li>'; - } + // Preview + if (! empty($conf->use_javascript_ajax) && ($conf->browser->layout != 'phone')) + { + $tmparray = getAdvancedPreviewUrl($modulepart, $relativepath, 1, '&entity='.$entity); + if ($tmparray && $tmparray['url']) $tmpout.= '<li><a href="'.$tmparray['url'].'"'.($tmparray['css']?' class="'.$tmparray['css'].'"':'').($tmparray['mime']?' mime="'.$tmparray['mime'].'"':'').($tmparray['target']?' target="'.$tmparray['target'].'"':'').'>'.img_picto('','detail').' '.$langs->trans("Preview").' '.$ext.'</a></li>'; + } - // Download - $tmpout.= '<li><a class="pictopreview" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"'; - $mime=dol_mimetype($relativepath,'',0); - if (preg_match('/text/',$mime)) $tmpout.= ' target="_blank"'; - $tmpout.= '>'; - $tmpout.=img_mime($relativepath, $file["name"]).' '; - $tmpout.= $langs->trans("Download").' '.$ext; - $tmpout.= '</a></li>'."\n"; - } - $out.=$tmpout; - $out.='</ul></div></dd> + // Download + $tmpout.= '<li><a class="pictopreview" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"'; + $mime=dol_mimetype($relativepath,'',0); + if (preg_match('/text/',$mime)) $tmpout.= ' target="_blank"'; + $tmpout.= '>'; + $tmpout.=img_mime($relativepath, $file["name"]).' '; + $tmpout.= $langs->trans("Download").' '.$ext; + $tmpout.= '</a></li>'."\n"; + } + $out.=$tmpout; + $out.='</ul></div></dd> </dl>'; - } - else - { - // TODO Add link to regenerate doc ? - //$out.= '<div id="gen_pdf_'.$modulesubdir.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n"; - } + } + else + { + // TODO Add link to regenerate doc ? + //$out.= '<div id="gen_pdf_'.$modulesubdir.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n"; + } - return $out; - } + return $out; + } - /** - * Show list of documents in $filearray (may be they are all in same directory but may not) - * This also sync database if $upload_dir is defined. - * - * @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this. - * @param Object $object Object on which document is linked to. - * @param string $modulepart Value for modulepart used by download or viewimage wrapper. - * @param string $param Parameters on sort links (param must start with &, example &aaa=bbb&ccc=ddd) - * @param int $forcedownload Force to open dialog box "Save As" when clicking on file. - * @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT. - * @param int $permonobject Permission on object (so permission to delete or crop document) - * @param int $useinecm Change output for use in ecm module - * @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined) - * @param int $maxlength Maximum length of file name shown. - * @param string $title Title before list - * @param string $url Full url to use for click links ('' = autodetect) + /** + * Show list of documents in $filearray (may be they are all in same directory but may not) + * This also sync database if $upload_dir is defined. + * + * @param array $filearray Array of files loaded by dol_dir_list('files') function before calling this. + * @param Object $object Object on which document is linked to. + * @param string $modulepart Value for modulepart used by download or viewimage wrapper. + * @param string $param Parameters on sort links (param must start with &, example &aaa=bbb&ccc=ddd) + * @param int $forcedownload Force to open dialog box "Save As" when clicking on file. + * @param string $relativepath Relative path of docs (autodefined if not provided), relative to module dir, not to MAIN_DATA_ROOT. + * @param int $permonobject Permission on object (so permission to delete or crop document) + * @param int $useinecm Change output for use in ecm module + * @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined) + * @param int $maxlength Maximum length of file name shown. + * @param string $title Title before list + * @param string $url Full url to use for click links ('' = autodetect) * @param int $showrelpart 0=Show only filename (default), 1=Show first level 1 dir * @param int $permtoeditline Permission to edit document line (You must provide a value, -1 is deprecated and must not be used any more) - * @param string $upload_dir Full path directory so we can know dir relative to MAIN_DATA_ROOT. Fill this if you want to complete file data with database indexes. - * @param string $sortfield Sort field ('name', 'size', 'position', ...) - * @param string $sortorder Sort order ('ASC' or 'DESC') - * @param int $disablemove 1=Disable move button, 0=Position move is possible. - * @param int $addfilterfields Add line with filters - * @return int <0 if KO, nb of files shown if OK - */ + * @param string $upload_dir Full path directory so we can know dir relative to MAIN_DATA_ROOT. Fill this if you want to complete file data with database indexes. + * @param string $sortfield Sort field ('name', 'size', 'position', ...) + * @param string $sortorder Sort order ('ASC' or 'DESC') + * @param int $disablemove 1=Disable move button, 0=Position move is possible. + * @param int $addfilterfields Add line with filters + * @return int <0 if KO, nb of files shown if OK + */ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) { global $user, $conf, $langs, $hookmanager; @@ -937,21 +937,21 @@ class FormFile // Define relative path used to store the file if (empty($relativepath)) { - $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; - if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2,0,0,$object,'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath - if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.'; + $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; + if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2,0,0,$object,'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.'; } // For backward compatiblity, we detect file is stored into an old path if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $file['level1name'] == 'photos') { - $relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/'; + $relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/'; } // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($upload_dir) { - $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir); - $relativedir = preg_replace('/^[\\/]/','',$relativedir); + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $upload_dir); + $relativedir = preg_replace('/^[\\/]/','',$relativedir); } $hookmanager->initHooks(array('formfile')); @@ -981,17 +981,17 @@ class FormFile if ($permtoeditline < 0) // Old behaviour for backward compatibility. New feature should call method with value 0 or 1 { - $permtoeditline=0; - if (in_array($modulepart, array('product','produit','service'))) - { - if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoeditline=1; - if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoeditline=1; - } + $permtoeditline=0; + if (in_array($modulepart, array('product','produit','service'))) + { + if ($user->rights->produit->creer && $object->type == Product::TYPE_PRODUCT) $permtoeditline=1; + if ($user->rights->service->creer && $object->type == Product::TYPE_SERVICE) $permtoeditline=1; + } } if (empty($conf->global->MAIN_UPLOAD_DOC)) { - $permtoeditline=0; - $permonobject=0; + $permtoeditline=0; + $permonobject=0; } // Show list of existing files @@ -1001,10 +1001,10 @@ class FormFile print '<!-- html.formfile::list_of_documents -->'."\n"; if (GETPOST('action','aZ09') == 'editfile' && $permtoeditline) { - print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" method="POST">'; - print '<input type="hidden" name="action" value="renamefile">'; - print '<input type="hidden" name="id" value="'.$object->id.'">'; - print '<input type="hidden" name="modulepart" value="'.$modulepart.'">'; + print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" method="POST">'; + print '<input type="hidden" name="action" value="renamefile">'; + print '<input type="hidden" name="id" value="'.$object->id.'">'; + print '<input type="hidden" name="modulepart" value="'.$modulepart.'">'; } print '<div class="div-table-responsive-no-min">'; @@ -1038,11 +1038,11 @@ class FormFile /*var_dump($sortfield); var_dump($sortorder);*/ - if ($sortfield && $sortorder) - { - $filearray=dol_sort_array($filearray, $sortfield, $sortorder); - } - //var_dump($filearray); + if ($sortfield && $sortorder) + { + $filearray=dol_sort_array($filearray, $sortfield, $sortorder); + } + //var_dump($filearray); } $nboffiles=count($filearray); @@ -1059,9 +1059,9 @@ class FormFile $editline=0; $nboflines++; - print '<!-- Line list_of_documents '.$key.' relativepath = '.$relativepath.' -->'."\n"; - // Do we have entry into database ? - print '<!-- In database: position='.$filearray[$key]['position'].' -->'."\n"; + print '<!-- Line list_of_documents '.$key.' relativepath = '.$relativepath.' -->'."\n"; + // Do we have entry into database ? + print '<!-- In database: position='.$filearray[$key]['position'].' -->'."\n"; print '<tr id="row-'.($filearray[$key]['rowid']>0?$filearray[$key]['rowid']:'-AFTER'.$lastrowid.'POS'.($i+1)).'" '.$bcdd[$var].'>'; print '<td class="tdoverflowmax300">'; @@ -1081,15 +1081,15 @@ class FormFile //print dol_trunc($file['name'],$maxlength,'middle'); if (GETPOST('action','aZ09') == 'editfile' && $file['name'] == basename(GETPOST('urlfile'))) { - print '</a>'; - print '<input type="hidden" name="renamefilefrom" value="'.dol_escape_htmltag($file['name']).'">'; - print '<input type="text" name="renamefileto" class="quatrevingtpercent" value="'.dol_escape_htmltag($file['name']).'">'; - $editline=1; + print '</a>'; + print '<input type="hidden" name="renamefilefrom" value="'.dol_escape_htmltag($file['name']).'">'; + print '<input type="text" name="renamefileto" class="quatrevingtpercent" value="'.dol_escape_htmltag($file['name']).'">'; + $editline=1; } else { - print $file['name']; - print '</a>'; + print $file['name']; + print '</a>'; } print "</td>\n"; @@ -1105,13 +1105,13 @@ class FormFile print '<td align="center">'; if (image_format_supported($file['name']) > 0) { - $minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original - if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension - //print $file['path'].'/'.$minifile.'<br>'; + $minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original + if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension + //print $file['path'].'/'.$minifile.'<br>'; - $urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 0, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity)); - if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])); - print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">'; + $urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 0, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity)); + if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])); + print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">'; print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">'; print '</a>'; } @@ -1120,77 +1120,77 @@ class FormFile } if (! $editline) { - // Delete or view link - // ($param must start with &) - print '<td class="valignmiddle right"><!-- action on files -->'; - if ($useinecm) - { - print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_view('default', 0, 'class="paddingrightonly"').'</a>'; - } - else - { - $newmodulepart=$modulepart; - if (in_array($modulepart, array('product','produit','service'))) $newmodulepart='produit|service'; + // Delete or view link + // ($param must start with &) + print '<td class="valignmiddle right"><!-- action on files -->'; + if ($useinecm) + { + print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_view('default', 0, 'class="paddingrightonly"').'</a>'; + } + else + { + $newmodulepart=$modulepart; + if (in_array($modulepart, array('product','produit','service'))) $newmodulepart='produit|service'; - $disablecrop=1; - if (in_array($modulepart, array('product','produit','service','expensereport','holiday','project','user'))) $disablecrop=0; + $disablecrop=1; + if (in_array($modulepart, array('product','produit','service','expensereport','holiday','project','user'))) $disablecrop=0; - if (! $disablecrop && image_format_supported($file['name']) > 0) - { - if ($permtoeditline) - { - // Link to resize - print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode($newmodulepart).'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','class="paddingrightonly"',1).'</a>'; - } - } + if (! $disablecrop && image_format_supported($file['name']) > 0) + { + if ($permtoeditline) + { + // Link to resize + print '<a href="'.DOL_URL_ROOT.'/core/photos_resize.php?modulepart='.urlencode($newmodulepart).'&id='.$object->id.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" title="'.dol_escape_htmltag($langs->trans("Resize")).'">'.img_picto($langs->trans("Resize"),DOL_URL_ROOT.'/theme/common/transform-crop-and-resize','class="paddingrightonly"',1).'</a>'; + } + } - if ($permtoeditline) - { - print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=editfile&urlfile='.urlencode($filepath).$param).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default',0,'class="paddingrightonly"').'</a>'; - } - } - if ($permonobject) - { - /* + if ($permtoeditline) + { + print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=editfile&urlfile='.urlencode($filepath).$param).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default',0,'class="paddingrightonly"').'</a>'; + } + } + if ($permonobject) + { + /* if ($file['level1name'] <> $object->id) $filepath=$file['level1name'].'/'.$file['name']; else $filepath=$file['name']; */ - $useajax=1; - if (! empty($conf->dol_use_jmobile)) $useajax=0; - if (empty($conf->use_javascript_ajax)) $useajax=0; - if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; + $useajax=1; + if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; + if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; - print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>'; - } - print "</td>"; + print '<a href="'.(($useinecm && $useajax)?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>'; + } + print "</td>"; - if (empty($disablemove)) - { - if ($nboffiles > 1 && empty($conf->browser->phone)) { - print '<td align="center" class="linecolmove tdlineupdown">'; - if ($i > 0) { - print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">'.img_up('default',0,'imgupforline').'</a>'; - } - if ($i < $nboffiles-1) { - print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id.'">'.img_down('default',0,'imgdownforline').'</a>'; - } - print '</td>'; - } - else { - print '<td align="center"'.((empty($conf->browser->phone) && empty($disablemove)) ?' class="linecolmove tdlineupdown"':' class="linecolmove"').'>'; - print '</td>'; - } + if (empty($disablemove)) + { + if ($nboffiles > 1 && empty($conf->browser->phone)) { + print '<td align="center" class="linecolmove tdlineupdown">'; + if ($i > 0) { + print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">'.img_up('default',0,'imgupforline').'</a>'; + } + if ($i < $nboffiles-1) { + print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id.'">'.img_down('default',0,'imgdownforline').'</a>'; + } + print '</td>'; + } + else { + print '<td align="center"'.((empty($conf->browser->phone) && empty($disablemove)) ?' class="linecolmove tdlineupdown"':' class="linecolmove"').'>'; + print '</td>'; + } } } else { - print '<td class="right">'; - print '<input type="submit" class="button" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; - print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; - print '</td>'; - if (empty($disablemove)) print '<td class="right"></td>'; + print '<td class="right">'; + print '<input type="submit" class="button" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">'; + print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">'; + print '</td>'; + if (empty($disablemove)) print '<td class="right"></td>'; } print "</tr>\n"; @@ -1199,8 +1199,8 @@ class FormFile } if ($nboffiles == 0) { - $colspan=(empty($useinecm)?'5':'5'); - if (empty($disablemove)) $colspan++; + $colspan=(empty($useinecm)?'5':'5'); + if (empty($disablemove)) $colspan++; print '<tr '.$bc[false].'><td colspan="'.$colspan.'" class="opacitymedium">'; if (empty($textifempty)) print $langs->trans("NoFileFound"); else print $textifempty; @@ -1211,14 +1211,14 @@ class FormFile if (! $editline && $nboflines > 1) { if (! empty($conf->use_javascript_ajax) && $permtoeditline) { - $table_element_line = 'ecm_files'; - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + $table_element_line = 'ecm_files'; + include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } } if (GETPOST('action','aZ09') == 'editfile' && $permtoeditline) { - print '</form>'; + print '</form>'; } return $nboffiles; @@ -1226,459 +1226,459 @@ class FormFile } - /** - * Show list of documents in a directory - * - * @param string $upload_dir Directory that was scanned - * @param array $filearray Array of files loaded by dol_dir_list function before calling this function - * @param string $modulepart Value for modulepart used by download wrapper - * @param string $param Parameters on sort links - * @param int $forcedownload Force to open dialog box "Save As" when clicking on file - * @param string $relativepath Relative path of docs (autodefined if not provided) - * @param int $permtodelete Permission to delete - * @param int $useinecm Change output for use in ecm module - * @param int $textifempty Text to show if filearray is empty - * @param int $maxlength Maximum length of file name shown - * @param string $url Full url to use for click links ('' = autodetect) - * @param int $addfilterfields Add line with filters - * @return int <0 if KO, nb of files shown if OK - */ - function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$url='',$addfilterfields=0) - { - global $user, $conf, $langs, $form; - global $bc; - global $sortfield, $sortorder; + /** + * Show list of documents in a directory + * + * @param string $upload_dir Directory that was scanned + * @param array $filearray Array of files loaded by dol_dir_list function before calling this function + * @param string $modulepart Value for modulepart used by download wrapper + * @param string $param Parameters on sort links + * @param int $forcedownload Force to open dialog box "Save As" when clicking on file + * @param string $relativepath Relative path of docs (autodefined if not provided) + * @param int $permtodelete Permission to delete + * @param int $useinecm Change output for use in ecm module + * @param int $textifempty Text to show if filearray is empty + * @param int $maxlength Maximum length of file name shown + * @param string $url Full url to use for click links ('' = autodetect) + * @param int $addfilterfields Add line with filters + * @return int <0 if KO, nb of files shown if OK + */ + function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$url='',$addfilterfields=0) + { + global $user, $conf, $langs, $form; + global $bc; + global $sortfield, $sortorder; global $search_doc_ref; - dol_syslog(get_class($this).'::list_of_autoecmfiles upload_dir='.$upload_dir.' modulepart='.$modulepart); + dol_syslog(get_class($this).'::list_of_autoecmfiles upload_dir='.$upload_dir.' modulepart='.$modulepart); - // Show list of documents - if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles")); - if (empty($url)) $url=$_SERVER["PHP_SELF"]; + // Show list of documents + if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles")); + if (empty($url)) $url=$_SERVER["PHP_SELF"]; - if (! empty($addfilterfields)) - { - print '<form action="'.$_SERVER['PHP_SELF'].'">'; - print '<input type="hidden" name="module" value="'.$modulepart.'">'; - } + if (! empty($addfilterfields)) + { + print '<form action="'.$_SERVER['PHP_SELF'].'">'; + print '<input type="hidden" name="module" value="'.$modulepart.'">'; + } print '<div class="div-table-responsive-no-min">'; - print '<table width="100%" class="noborder">'."\n"; + print '<table width="100%" class="noborder">'."\n"; - if (! empty($addfilterfields)) - { - print '<tr class="liste_titre nodrag nodrop">'; - print '<td><input type="text" class="maxwidth100onsmartphone" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"></td>'; - print '<td></td>'; - print '<td></td>'; - print '<td></td>'; + if (! empty($addfilterfields)) + { + print '<tr class="liste_titre nodrag nodrop">'; + print '<td><input type="text" class="maxwidth100onsmartphone" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"></td>'; + print '<td></td>'; + print '<td></td>'; + print '<td></td>'; // Action column print '<td class="liste_titre" align="middle">'; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '</td>'; - print "</tr>\n"; - } + print "</tr>\n"; + } - print '<tr class="liste_titre">'; - $sortref="fullname"; - if ($modulepart == 'invoice_supplier') $sortref='level1name'; - print_liste_field_titre("Ref",$url,$sortref,"",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre("Documents2",$url,"name","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre("Size",$url,"size","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre("Date",$url,"date","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre('','',''); - print '</tr>'."\n"; + print '<tr class="liste_titre">'; + $sortref="fullname"; + if ($modulepart == 'invoice_supplier') $sortref='level1name'; + print_liste_field_titre("Ref",$url,$sortref,"",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Documents2",$url,"name","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre("Size",$url,"size","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Date",$url,"date","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre('','',''); + print '</tr>'."\n"; - // To show ref or specific information according to view to show (defined by $module) - if ($modulepart == 'company') - { - include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $object_instance=new Societe($this->db); - } - else if ($modulepart == 'invoice') - { - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $object_instance=new Facture($this->db); - } - else if ($modulepart == 'invoice_supplier') - { - include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - $object_instance=new FactureFournisseur($this->db); - } - else if ($modulepart == 'propal') - { - include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; - $object_instance=new Propal($this->db); - } - else if ($modulepart == 'supplier_proposal') - { - include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; - $object_instance=new SupplierProposal($this->db); - } - else if ($modulepart == 'order') - { - include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $object_instance=new Commande($this->db); - } - else if ($modulepart == 'order_supplier') - { - include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; - $object_instance=new CommandeFournisseur($this->db); - } - else if ($modulepart == 'contract') - { - include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; - $object_instance=new Contrat($this->db); - } - else if ($modulepart == 'product') - { - include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $object_instance=new Product($this->db); - } - else if ($modulepart == 'tax') - { - include_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; - $object_instance=new ChargeSociales($this->db); - } - else if ($modulepart == 'project') - { - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - $object_instance=new Project($this->db); - } - else if ($modulepart == 'fichinter') - { - include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; - $object_instance=new Fichinter($this->db); - } - else if ($modulepart == 'user') - { - include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - $object_instance=new User($this->db); - } - else if ($modulepart == 'expensereport') - { - include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; - $object_instance=new ExpenseReport($this->db); - } + // To show ref or specific information according to view to show (defined by $module) + if ($modulepart == 'company') + { + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $object_instance=new Societe($this->db); + } + else if ($modulepart == 'invoice') + { + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $object_instance=new Facture($this->db); + } + else if ($modulepart == 'invoice_supplier') + { + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $object_instance=new FactureFournisseur($this->db); + } + else if ($modulepart == 'propal') + { + include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + $object_instance=new Propal($this->db); + } + else if ($modulepart == 'supplier_proposal') + { + include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; + $object_instance=new SupplierProposal($this->db); + } + else if ($modulepart == 'order') + { + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $object_instance=new Commande($this->db); + } + else if ($modulepart == 'order_supplier') + { + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $object_instance=new CommandeFournisseur($this->db); + } + else if ($modulepart == 'contract') + { + include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; + $object_instance=new Contrat($this->db); + } + else if ($modulepart == 'product') + { + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $object_instance=new Product($this->db); + } + else if ($modulepart == 'tax') + { + include_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; + $object_instance=new ChargeSociales($this->db); + } + else if ($modulepart == 'project') + { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $object_instance=new Project($this->db); + } + else if ($modulepart == 'fichinter') + { + include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $object_instance=new Fichinter($this->db); + } + else if ($modulepart == 'user') + { + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $object_instance=new User($this->db); + } + else if ($modulepart == 'expensereport') + { + include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; + $object_instance=new ExpenseReport($this->db); + } - $var=true; - foreach($filearray as $key => $file) - { - if (!is_dir($file['name']) - && $file['name'] != '.' - && $file['name'] != '..' - && $file['name'] != 'CVS' - && ! preg_match('/\.meta$/i',$file['name'])) - { - // Define relative path used to store the file - $relativefile=preg_replace('/'.preg_quote($upload_dir.'/','/').'/','',$file['fullname']); + $var=true; + foreach($filearray as $key => $file) + { + if (!is_dir($file['name']) + && $file['name'] != '.' + && $file['name'] != '..' + && $file['name'] != 'CVS' + && ! preg_match('/\.meta$/i',$file['name'])) + { + // Define relative path used to store the file + $relativefile=preg_replace('/'.preg_quote($upload_dir.'/','/').'/','',$file['fullname']); - //var_dump($file); - $id=0; $ref=''; $label=''; + //var_dump($file); + $id=0; $ref=''; $label=''; - // To show ref or specific information according to view to show (defined by $module) - if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices - if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } + // To show ref or specific information according to view to show (defined by $module) + if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices + if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'supplier_proposal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} - if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} - if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} - if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } + if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} - if (! $id && ! $ref) continue; - $found=0; - if (! empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) - { - $found=1; - } - else - { - //print 'Fetch '.$id." - ".$ref.'<br>'; + if (! $id && ! $ref) continue; + $found=0; + if (! empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) + { + $found=1; + } + else + { + //print 'Fetch '.$id." - ".$ref.'<br>'; - if ($id) { - $result = $object_instance->fetch($id); - } else { - //fetchOneLike looks for objects with wildcards in its reference. - //It is useful for those masks who get underscores instead of their actual symbols - //fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned - //that's why we look only look fetchOneLike when fetch returns 0 - if (!$result = $object_instance->fetch('', $ref)) { - $result = $object_instance->fetchOneLike($ref); - } - } + if ($id) { + $result = $object_instance->fetch($id); + } else { + //fetchOneLike looks for objects with wildcards in its reference. + //It is useful for those masks who get underscores instead of their actual symbols + //fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned + //that's why we look only look fetchOneLike when fetch returns 0 + if (!$result = $object_instance->fetch('', $ref)) { + $result = $object_instance->fetchOneLike($ref); + } + } if ($result > 0) { // Save object into a cache $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref] = clone $object_instance; } - if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); } - } + if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); } + } - if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files + if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files - print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n"; - print '<tr class="oddeven">'; - print '<td>'; - if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document'); - else print $langs->trans("ObjectDeleted",($id?$id:$ref)); + print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n"; + print '<tr class="oddeven">'; + print '<td>'; + if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document'); + else print $langs->trans("ObjectDeleted",($id?$id:$ref)); - //$modulesubdir=dol_sanitizeFileName($ref); - $modulesubdir=dirname($relativefile); + //$modulesubdir=dol_sanitizeFileName($ref); + $modulesubdir=dirname($relativefile); - //$filedir=$conf->$modulepart->dir_output . '/' . dol_sanitizeFileName($obj->ref); - $filedir=$file['path']; - //$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - //print $formfile->getDocumentsLink($modulepart, $filename, $filedir); + //$filedir=$conf->$modulepart->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $filedir=$file['path']; + //$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + //print $formfile->getDocumentsLink($modulepart, $filename, $filedir); - print '</td>'; + print '</td>'; - // File - print '<td>'; - //print "XX".$file['name']; //$file['name'] must be utf8 - print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart; - if ($forcedownload) print '&attachment=1'; - print '&file='.urlencode($relativefile).'">'; - print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' '; - print dol_trunc($file['name'],$maxlength,'middle'); - print '</a>'; + // File + print '<td>'; + //print "XX".$file['name']; //$file['name'] must be utf8 + print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart; + if ($forcedownload) print '&attachment=1'; + print '&file='.urlencode($relativefile).'">'; + print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' '; + print dol_trunc($file['name'],$maxlength,'middle'); + print '</a>'; - print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); + print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); - print "</td>\n"; - print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>'; - print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>'; - print '<td align="right">'; - //if (! empty($useinecm)) print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart; - //if ($forcedownload) print '&attachment=1'; - //print '&file='.urlencode($relativefile).'">'; - //print img_view().'</a>   '; - //if ($permtodelete) print '<a href="'.$url.'?id='.$object->id.'§ion='.$_REQUEST["section"].'&action=delete&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>'; - //else print ' '; - print "</td></tr>\n"; - } - } + print "</td>\n"; + print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>'; + print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>'; + print '<td align="right">'; + //if (! empty($useinecm)) print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart; + //if ($forcedownload) print '&attachment=1'; + //print '&file='.urlencode($relativefile).'">'; + //print img_view().'</a>   '; + //if ($permtodelete) print '<a href="'.$url.'?id='.$object->id.'§ion='.$_REQUEST["section"].'&action=delete&urlfile='.urlencode($file['name']).'">'.img_delete().'</a>'; + //else print ' '; + print "</td></tr>\n"; + } + } - if (count($filearray) == 0) - { - print '<tr '.$bc[false].'><td colspan="5">'; - if (empty($textifempty)) print $langs->trans("NoFileFound"); - else print $textifempty; - print '</td></tr>'; - } - print "</table>"; - print '</div>'; + if (count($filearray) == 0) + { + print '<tr '.$bc[false].'><td colspan="5">'; + if (empty($textifempty)) print $langs->trans("NoFileFound"); + else print $textifempty; + print '</td></tr>'; + } + print "</table>"; + print '</div>'; - if (! empty($addfilterfields)) print '</form>'; - // Fin de zone - } + if (! empty($addfilterfields)) print '</form>'; + // Fin de zone + } - /** - * Show form to upload a new file with jquery fileupload. - * This form use the fileupload.php file. - * - * @param Object $object Object to use - * @return void - */ - private function _formAjaxFileUpload($object) - { - global $langs; + /** + * Show form to upload a new file with jquery fileupload. + * This form use the fileupload.php file. + * + * @param Object $object Object to use + * @return void + */ + private function _formAjaxFileUpload($object) + { + global $langs; - // PHP post_max_size - $post_max_size = ini_get('post_max_size'); - $mul_post_max_size = substr($post_max_size, -1); - $mul_post_max_size = ($mul_post_max_size == 'M' ? 1048576 : ($mul_post_max_size == 'K' ? 1024 : ($mul_post_max_size == 'G' ? 1073741824 : 1))); - $post_max_size = $mul_post_max_size * (int) $post_max_size; - // PHP upload_max_filesize - $upload_max_filesize = ini_get('upload_max_filesize'); - $mul_upload_max_filesize = substr($upload_max_filesize, -1); - $mul_upload_max_filesize = ($mul_upload_max_filesize == 'M' ? 1048576 : ($mul_upload_max_filesize == 'K' ? 1024 : ($mul_upload_max_filesize == 'G' ? 1073741824 : 1))); - $upload_max_filesize = $mul_upload_max_filesize * (int) $upload_max_filesize; - // Max file size - $max_file_size = (($post_max_size < $upload_max_filesize) ? $post_max_size : $upload_max_filesize); + // PHP post_max_size + $post_max_size = ini_get('post_max_size'); + $mul_post_max_size = substr($post_max_size, -1); + $mul_post_max_size = ($mul_post_max_size == 'M' ? 1048576 : ($mul_post_max_size == 'K' ? 1024 : ($mul_post_max_size == 'G' ? 1073741824 : 1))); + $post_max_size = $mul_post_max_size * (int) $post_max_size; + // PHP upload_max_filesize + $upload_max_filesize = ini_get('upload_max_filesize'); + $mul_upload_max_filesize = substr($upload_max_filesize, -1); + $mul_upload_max_filesize = ($mul_upload_max_filesize == 'M' ? 1048576 : ($mul_upload_max_filesize == 'K' ? 1024 : ($mul_upload_max_filesize == 'G' ? 1073741824 : 1))); + $upload_max_filesize = $mul_upload_max_filesize * (int) $upload_max_filesize; + // Max file size + $max_file_size = (($post_max_size < $upload_max_filesize) ? $post_max_size : $upload_max_filesize); - // Include main - include DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_main.tpl.php'; + // Include main + include DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_main.tpl.php'; - // Include template - include DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_view.tpl.php'; + // Include template + include DOL_DOCUMENT_ROOT.'/core/tpl/ajax/fileupload_view.tpl.php'; - } + } - /** - * Show array with linked files - * - * @param Object $object Object - * @param int $permtodelete Deletion is allowed - * @param string $action Action - * @param string $selected ??? - * @param string $param More param to add into URL - * @return int Number of links - */ - public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') - { - global $user, $conf, $langs, $user; - global $bc; - global $sortfield, $sortorder; + /** + * Show array with linked files + * + * @param Object $object Object + * @param int $permtodelete Deletion is allowed + * @param string $action Action + * @param string $selected ??? + * @param string $param More param to add into URL + * @return int Number of links + */ + public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') + { + global $user, $conf, $langs, $user; + global $bc; + global $sortfield, $sortorder; - $langs->load("link"); + $langs->load("link"); - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; - $link = new Link($this->db); - $links = array(); - if ($sortfield == "name") { - $sortfield = "label"; - } elseif ($sortfield == "date") { - $sortfield = "datea"; - } else { - $sortfield = null; - } - $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); - $param .= (isset($object->id)?'&id=' . $object->id : ''); + require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; + $link = new Link($this->db); + $links = array(); + if ($sortfield == "name") { + $sortfield = "label"; + } elseif ($sortfield == "date") { + $sortfield = "datea"; + } else { + $sortfield = null; + } + $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); + $param .= (isset($object->id)?'&id=' . $object->id : ''); - // Show list of associated links - print load_fiche_titre($langs->trans("LinkedFiles")); + // Show list of associated links + print load_fiche_titre($langs->trans("LinkedFiles")); - print '<form action="' . $_SERVER['PHP_SELF'] . ($param?'?'.$param:'') . '" method="POST">'; + print '<form action="' . $_SERVER['PHP_SELF'] . ($param?'?'.$param:'') . '" method="POST">'; - print '<table width="100%" class="liste">'; - print '<tr class="liste_titre">'; - print_liste_field_titre( - $langs->trans("Links"), - $_SERVER['PHP_SELF'], - "name", - "", - $param, - 'align="left"', - $sortfield, - $sortorder - ); - print_liste_field_titre( - "", - "", - "", - "", - "", - 'align="right"' - ); - print_liste_field_titre( - $langs->trans("Date"), - $_SERVER['PHP_SELF'], - "date", - "", - $param, - 'align="center"', - $sortfield, - $sortorder - ); - print_liste_field_titre( - '', - $_SERVER['PHP_SELF'], - "", - "", - $param, - 'align="center"' - ); - print_liste_field_titre('','',''); - print '</tr>'; - $nboflinks = count($links); - if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + print '<table width="100%" class="liste">'; + print '<tr class="liste_titre">'; + print_liste_field_titre( + $langs->trans("Links"), + $_SERVER['PHP_SELF'], + "name", + "", + $param, + 'align="left"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + "", + "", + "", + "", + "", + 'align="right"' + ); + print_liste_field_titre( + $langs->trans("Date"), + $_SERVER['PHP_SELF'], + "date", + "", + $param, + 'align="center"', + $sortfield, + $sortorder + ); + print_liste_field_titre( + '', + $_SERVER['PHP_SELF'], + "", + "", + $param, + 'align="center"' + ); + print_liste_field_titre('','',''); + print '</tr>'; + $nboflinks = count($links); + if ($nboflinks > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - $var = true; - foreach ($links as $link) - { - $var =! $var; - print '<tr ' . $bc[$var] . '>'; - //edit mode - if ($action == 'update' && $selected === $link->id) - { - print '<td>'; - print '<input type="hidden" name="id" value="' . $object->id . '">'; - print '<input type="hidden" name="linkid" value="' . $link->id . '">'; - print '<input type="hidden" name="action" value="confirm_updateline">'; - print $langs->trans('Link') . ': <input type="text" name="link" value="' . $link->url . '">'; - print '</td>'; - print '<td>'; - print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">'; - print '</td>'; - print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>'; - print '<td align="right"></td>'; - print '<td align="right">'; - print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">'; - print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">'; - print '</td>'; - } - else + $var = true; + foreach ($links as $link) + { + $var =! $var; + print '<tr ' . $bc[$var] . '>'; + //edit mode + if ($action == 'update' && $selected === $link->id) { - print '<td>'; - print img_picto('', 'object_globe').' '; - print '<a data-ajax="false" href="' . $link->url . '" target="_blank">'; - print $link->label; - print '</a>'; - print '</td>'."\n"; - print '<td align="right"></td>'; - print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>'; - print '<td align="center"></td>'; - print '<td align="right">'; - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param - if ($permtodelete) { - print '   <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param - } else { - print ' '; - } - print '</td>'; - } - print "</tr>\n"; - } - if ($nboflinks == 0) - { - print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'; - print $langs->trans("NoLinkFound"); - print '</td></tr>'; - } - print "</table>"; + print '<td>'; + print '<input type="hidden" name="id" value="' . $object->id . '">'; + print '<input type="hidden" name="linkid" value="' . $link->id . '">'; + print '<input type="hidden" name="action" value="confirm_updateline">'; + print $langs->trans('Link') . ': <input type="text" name="link" value="' . $link->url . '">'; + print '</td>'; + print '<td>'; + print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">'; + print '</td>'; + print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>'; + print '<td align="right"></td>'; + print '<td align="right">'; + print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">'; + print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">'; + print '</td>'; + } + else + { + print '<td>'; + print img_picto('', 'object_globe').' '; + print '<a data-ajax="false" href="' . $link->url . '" target="_blank">'; + print $link->label; + print '</a>'; + print '</td>'."\n"; + print '<td align="right"></td>'; + print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>'; + print '<td align="center"></td>'; + print '<td align="right">'; + print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param + if ($permtodelete) { + print '   <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param + } else { + print ' '; + } + print '</td>'; + } + print "</tr>\n"; + } + if ($nboflinks == 0) + { + print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'; + print $langs->trans("NoLinkFound"); + print '</td></tr>'; + } + print "</table>"; - print '</form>'; + print '</form>'; - return $nboflinks; - } + return $nboflinks; + } - /** - * Show detail icon with link for preview - * - * @param array $file File - * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $relativepath Relative path of docs - * @param string $ruleforpicto Rule for picto: 0=Preview picto, 1=Use picto of mime type of file) - * @param string $param More param on http links - * @return string $out Output string with HTML - */ - public function showPreview($file, $modulepart, $relativepath, $ruleforpicto=0, $param='') - { - global $langs, $conf; + /** + * Show detail icon with link for preview + * + * @param array $file File + * @param string $modulepart propal, facture, facture_fourn, ... + * @param string $relativepath Relative path of docs + * @param string $ruleforpicto Rule for picto: 0=Preview picto, 1=Use picto of mime type of file) + * @param string $param More param on http links + * @return string $out Output string with HTML + */ + public function showPreview($file, $modulepart, $relativepath, $ruleforpicto=0, $param='') + { + global $langs, $conf; - $out=''; - if ($conf->browser->layout != 'phone' && ! empty($conf->use_javascript_ajax)) - { - $urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath, 1, $param); // Return if a file is qualified for preview. - if (count($urladvancedpreview)) - { - $out.= '<a class="pictopreview '.$urladvancedpreview['css'].'" href="'.$urladvancedpreview['url'].'"'.(empty($urladvancedpreview['mime'])?'':' mime="'.$urladvancedpreview['mime'].'"').' '.(empty($urladvancedpreview['target'])?'':' target="'.$urladvancedpreview['target'].'"').'>'; - //$out.= '<a class="pictopreview">'; - if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); - else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']); - $out.= '</a>'; - } - } - return $out; - } + $out=''; + if ($conf->browser->layout != 'phone' && ! empty($conf->use_javascript_ajax)) + { + $urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath, 1, $param); // Return if a file is qualified for preview. + if (count($urladvancedpreview)) + { + $out.= '<a class="pictopreview '.$urladvancedpreview['css'].'" href="'.$urladvancedpreview['url'].'"'.(empty($urladvancedpreview['mime'])?'':' mime="'.$urladvancedpreview['mime'].'"').' '.(empty($urladvancedpreview['target'])?'':' target="'.$urladvancedpreview['target'].'"').'>'; + //$out.= '<a class="pictopreview">'; + if (empty($ruleforpicto)) $out.= img_picto($langs->trans('Preview').' '.$file['name'], 'detail'); + else $out.= img_mime($relativepath, $langs->trans('Preview').' '.$file['name']); + $out.= '</a>'; + } + } + return $out; + } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index cc09b8bb521..a9ebafc4769 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -282,578 +282,578 @@ class FormMail extends Form $outputlangs->load('other'); } - // Get message template for $this->param["models"] into c_email_templates + // Get message template for $this->param["models"] into c_email_templates $arraydefaultmessage=array(); if ($this->param['models'] != 'none') { $model_id=0; - if (array_key_exists('models_id',$this->param)) - { - $model_id=$this->param["models_id"]; - } - $arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, ($model_id ? $model_id : -1)); // we set -1 if model_id empty - } - //var_dump($this->param["models"]); - //var_dump($model_id); - //var_dump($arraydefaultmessage); - - - // Define list of attached files - $listofpaths=array(); - $listofnames=array(); - $listofmimes=array(); - $keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined - - if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1')) - { - $this->clear_attached_files(); - if (! empty($arraydefaultmessage['joinfiles']) && is_array($this->param['fileinit'])) - { - foreach($this->param['fileinit'] as $file) - { - $this->add_attached_files($file, basename($file), dol_mimetype($file)); - } - } - } - - if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]); - if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]); - if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]); - - - $out.= "\n".'<!-- Begin form mail type='.$this->param["models"].' --><div id="mailformdiv"></div>'."\n"; - if ($this->withform == 1) - { - $out.= '<form method="POST" name="mailform" id="mailform" enctype="multipart/form-data" action="'.$this->param["returnurl"].'#formmail">'."\n"; - $out.= '<a id="formmail" name="formmail"></a>'; - $out.= '<input style="display:none" type="submit" id="sendmail" name="sendmail">'; - $out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; - $out.= '<input type="hidden" name="trackid" value="'.$this->trackid.'" />'; - } - if (! empty($this->withfrom)) - { - if (! empty($this->withfromreadonly)) - { - $out.= '<input type="hidden" id="fromname" name="fromname" value="'.$this->fromname.'" />'; - $out.= '<input type="hidden" id="frommail" name="frommail" value="'.$this->frommail.'" />'; - } - } - foreach ($this->param as $key=>$value) - { - $out.= '<input type="hidden" id="'.$key.'" name="'.$key.'" value="'.$value.'" />'."\n"; - } - - $modelmail_array=array(); - if ($this->param['models'] != 'none') - { - $result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs); - if ($result < 0) - { - setEventMessages($this->error, $this->errors, 'errors'); - } - foreach($this->lines_model as $line) - { - $langs->trans("members"); - if (preg_match('/\((.*)\)/', $line->label, $reg)) - { - $modelmail_array[$line->id]=$langs->trans($reg[1]); // langs->trans when label is __(xxx)__ - } - else - { - $modelmail_array[$line->id]=$line->label; - } - if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')'; - if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private"); - //if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' '; - } - } - - // Zone to select email template - if (count($modelmail_array)>0) - { - // If list of template is filled - $out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n"; - $out.= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100'); - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); - $out.= '   '; - $out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">'; - $out.= '   '; - $out.= '</div>'; - } - elseif (! empty($this->param['models']) && in_array($this->param['models'], array( - 'propal_send','order_send','facture_send', - 'shipping_send','fichinter_send','supplier_proposal_send','order_supplier_send', - 'invoice_supplier_send','thirdparty','contract','user','all' - ))) - { - // If list of template is empty - $out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n"; - $out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); - $out.= '   '; - $out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" disabled="disabled" id="modelselected">'; - $out.= '   '; - $out.= '</div>'; - } - - - - $out.= '<table class="border" width="100%">'."\n"; - - // Substitution array - if (! empty($this->withsubstit)) // Unset of set ->withsubstit=0 to disable this. - { - $out.= '<tr><td colspan="2" align="right">'; - //$out.='<div class="floatright">'; - $help=""; - foreach($this->substit as $key => $val) - { - $help.=$key.' -> '.$langs->trans(dol_string_nohtmltag($val)).'<br>'; - } - if (is_numeric($this->withsubstit)) $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help, 1, 'help', '', 0, 2, 'substittooltip'); // Old usage - else $out.= $form->textwithpicto($langs->trans('AvailableVariables'), $help, 1, 'help', '', 0, 2, 'substittooltip'); // New usage - $out.= "</td></tr>\n"; - //$out.='</div>'; - } - - // From - if (! empty($this->withfrom)) - { - if (! empty($this->withfromreadonly)) - { - $out.= '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td>'; - - if (! ($this->fromtype === 'user' && $this->fromid > 0) - && ! ($this->fromtype === 'company') - && ! preg_match('/user_aliases/', $this->fromtype) - && ! preg_match('/global_aliases/', $this->fromtype) - && ! preg_match('/senderprofile/', $this->fromtype)) - { - // Use this->fromname and this->frommail or error if not defined - $out.= $this->fromname; - if ($this->frommail) - { - $out.= ' <'.$this->frommail.'>'; - } - else - { - if ($this->fromtype) - { - $langs->load('errors'); - $out.= '<span class="warning"> <'.$langs->trans('ErrorNoMailDefinedForThisUser').'> </span>'; - } - } - } else { - $liste = array(); - - // Add user email - if (empty($user->email)) - { - $langs->load('errors'); - $liste['user'] = $user->getFullName($langs) . ' <'.$langs->trans('ErrorNoMailDefinedForThisUser').'>'; - } - else - { - $liste['user'] = $user->getFullName($langs) .' <'.$user->email.'>'; - } - - // Add also company main email - $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; - - // Add also email aliases if there is some - $listaliases=array('user_aliases'=>$user->email_aliases, 'global_aliases'=>$conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); - - // Add also email aliases from the c_email_senderprofile table - $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1 ORDER BY position'; - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - while($i < $num) - { - $obj = $this->db->fetch_object($resql); - if ($obj) - { - $listaliases['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; - } - $i++; - } - } - else dol_print_error($this->db); - - foreach($listaliases as $typealias => $listalias) - { - $posalias=0; - $listaliasarray=explode(',', $listalias); - foreach ($listaliasarray as $listaliasval) - { - $posalias++; - $listaliasval=trim($listaliasval); - if ($listaliasval) - { - $listaliasval=preg_replace('/</', '<', $listaliasval); - $listaliasval=preg_replace('/>/', '>', $listaliasval); - if (! preg_match('/</', $listaliasval)) $listaliasval='<'.$listaliasval.'>'; - $liste[$typealias.'_'.$posalias]=$listaliasval; - } - } - } - $out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', '', 0, '', $disablebademails); - //$out.= ajax_combobox('fromtype'); - } - - $out.= "</td></tr>\n"; - } - else - { - $out.= '<tr><td class="fieldrequired">'.$langs->trans("MailFrom")."</td><td>"; - $out.= $langs->trans("Name").':<input type="text" id="fromname" name="fromname" size="32" value="'.$this->fromname.'" />'; - $out.= '    '; - $out.= $langs->trans("EMail").':<<input type="text" id="frommail" name="frommail" size="32" value="'.$this->frommail.'" />>'; - $out.= "</td></tr>\n"; - } - } - - // To - if (! empty($this->withto) || is_array($this->withto)) - { - $out.= '<tr><td class="fieldrequired" width="180">'; - if ($this->withtofree) $out.= $form->textwithpicto($langs->trans("MailTo"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); - else $out.= $langs->trans("MailTo"); - $out.= '</td><td>'; - if ($this->withtoreadonly) - { - if (! empty($this->toname) && ! empty($this->tomail)) - { - $out.= '<input type="hidden" id="toname" name="toname" value="'.$this->toname.'" />'; - $out.= '<input type="hidden" id="tomail" name="tomail" value="'.$this->tomail.'" />'; - if ($this->totype == 'thirdparty') - { - $soc=new Societe($this->db); - $soc->fetch($this->toid); - $out.= $soc->getNomUrl(1); - } - else if ($this->totype == 'contact') - { - $contact=new Contact($this->db); - $contact->fetch($this->toid); - $out.= $contact->getNomUrl(1); - } - else - { - $out.= $this->toname; - } - $out.= ' <'.$this->tomail.'>'; - if ($this->withtofree) - { - $out.= '<br>'.$langs->trans("and").' <input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />'; - } - } - else - { - // Note withto may be a text like 'AllRecipientSelected' - $out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:""; - } - } - else - { - if (! empty($this->withtofree)) - { - $out.= '<input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />'; - } - if (! empty($this->withto) && is_array($this->withto)) - { - if (! empty($this->withtofree)) $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time - $tmparray = $this->withto; - foreach($tmparray as $key => $val) - { - $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); - } - $withtoselected=GETPOST("receiver",'none'); // Array of selected value - if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action','aZ09') == 'presend') - { - $withtoselected = array_keys($tmparray); - } - $out.= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, ""); - } - } - $out.= "</td></tr>\n"; - } - - // withoptiononeemailperrecipient - if (! empty($this->withoptiononeemailperrecipient)) - { - $out.= '<tr><td>'; - $out.= $langs->trans("GroupEmails"); - $out.= '</td><td>'; - $out.=' <input type="checkbox" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0?' checked="checked"':'').'> '; - $out.= $langs->trans("OneEmailPerRecipient").' - '; - $out.= $langs->trans("WarningIfYouCheckOneRecipientPerEmail"); - $out.= '</td></tr>'; - } - - // CC - if (! empty($this->withtocc) || is_array($this->withtocc)) - { - $out.= '<tr><td>'; - $out.= $form->textwithpicto($langs->trans("MailCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); - $out.= '</td><td>'; - if ($this->withtoccreadonly) - { - $out.= (! is_array($this->withtocc) && ! is_numeric($this->withtocc))?$this->withtocc:""; - } - else - { - $out.= '<input size="'.(is_array($this->withtocc)?"30":"60").'" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />'; - if (! empty($this->withtocc) && is_array($this->withtocc)) - { - $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time - $tmparray = $this->withtocc; - foreach($tmparray as $key => $val) - { - $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); - } - $withtoccselected=GETPOST("receivercc"); // Array of selected value - $out.= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500',null, ""); - } - } - $out.= "</td></tr>\n"; - } - - // CCC - if (! empty($this->withtoccc) || is_array($this->withtoccc)) - { - $out.= '<tr><td>'; - $out.= $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); - $out.= '</td><td>'; - if (! empty($this->withtocccreadonly)) - { - $out.= (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:""; - } - else - { - $out.= '<input size="'.(is_array($this->withtoccc)?"30":"60").'" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; - if (! empty($this->withtoccc) && is_array($this->withtoccc)) - { - $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time - $tmparray = $this->withtoccc; - foreach($tmparray as $key => $val) - { - $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); - } - $withtocccselected=GETPOST("receiverccc"); // Array of selected value - $out.= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, null, null, null,null, "90%"); - } - } - - $showinfobcc=''; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO; - if ($showinfobcc) $out.=' + '.$showinfobcc; - $out.= "</td></tr>\n"; - } - - // Replyto - if (! empty($this->withreplyto)) - { - if ($this->withreplytoreadonly) - { - $out.= '<input type="hidden" id="replyname" name="replyname" value="'.$this->replytoname.'" />'; - $out.= '<input type="hidden" id="replymail" name="replymail" value="'.$this->replytomail.'" />'; - $out.= "<tr><td>".$langs->trans("MailReply")."</td><td>".$this->replytoname.($this->replytomail?(" <".$this->replytomail.">"):""); - $out.= "</td></tr>\n"; - } - } - - // Errorsto - if (! empty($this->witherrorsto)) - { - //if (! $this->errorstomail) $this->errorstomail=$this->frommail; - $errorstomail = (! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail); - if ($this->witherrorstoreadonly) - { - $out.= '<input type="hidden" id="errorstomail" name="errorstomail" value="'.$errorstomail.'" />'; - $out.= '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'; - $out.= $errorstomail; - $out.= "</td></tr>\n"; - } - else - { - $out.= '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'; - $out.= '<input size="30" id="errorstomail" name="errorstomail" value="'.$errorstomail.'" />'; - $out.= "</td></tr>\n"; - } - } - - // Ask delivery receipt - if (! empty($this->withdeliveryreceipt)) - { - $out.= '<tr><td>'.$langs->trans("DeliveryReceipt").'</td><td>'; - - if (! empty($this->withdeliveryreceiptreadonly)) - { - $out.= yn($this->withdeliveryreceipt); - } - else - { - $defaultvaluefordeliveryreceipt=0; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; - $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); - } - - $out.= "</td></tr>\n"; - } - - // Topic - if (! empty($this->withtopic)) - { - $defaulttopic=GETPOST('subject','none'); - if (! GETPOST('modelselected','alpha') || GETPOST('modelmailselected') != '-1') + if (array_key_exists('models_id',$this->param)) { - if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['topic']) $defaulttopic=$arraydefaultmessage['topic']; - elseif (! is_numeric($this->withtopic)) $defaulttopic=$this->withtopic; + $model_id=$this->param["models_id"]; + } + $arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, ($model_id ? $model_id : -1)); // we set -1 if model_id empty + } + //var_dump($this->param["models"]); + //var_dump($model_id); + //var_dump($arraydefaultmessage); + + + // Define list of attached files + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + $keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined + + if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1')) + { + $this->clear_attached_files(); + if (! empty($arraydefaultmessage['joinfiles']) && is_array($this->param['fileinit'])) + { + foreach($this->param['fileinit'] as $file) + { + $this->add_attached_files($file, basename($file), dol_mimetype($file)); + } + } + } + + if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]); + if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]); + if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]); + + + $out.= "\n".'<!-- Begin form mail type='.$this->param["models"].' --><div id="mailformdiv"></div>'."\n"; + if ($this->withform == 1) + { + $out.= '<form method="POST" name="mailform" id="mailform" enctype="multipart/form-data" action="'.$this->param["returnurl"].'#formmail">'."\n"; + $out.= '<a id="formmail" name="formmail"></a>'; + $out.= '<input style="display:none" type="submit" id="sendmail" name="sendmail">'; + $out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; + $out.= '<input type="hidden" name="trackid" value="'.$this->trackid.'" />'; + } + if (! empty($this->withfrom)) + { + if (! empty($this->withfromreadonly)) + { + $out.= '<input type="hidden" id="fromname" name="fromname" value="'.$this->fromname.'" />'; + $out.= '<input type="hidden" id="frommail" name="frommail" value="'.$this->frommail.'" />'; + } + } + foreach ($this->param as $key=>$value) + { + $out.= '<input type="hidden" id="'.$key.'" name="'.$key.'" value="'.$value.'" />'."\n"; + } + + $modelmail_array=array(); + if ($this->param['models'] != 'none') + { + $result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs); + if ($result < 0) + { + setEventMessages($this->error, $this->errors, 'errors'); + } + foreach($this->lines_model as $line) + { + $langs->trans("members"); + if (preg_match('/\((.*)\)/', $line->label, $reg)) + { + $modelmail_array[$line->id]=$langs->trans($reg[1]); // langs->trans when label is __(xxx)__ + } + else + { + $modelmail_array[$line->id]=$line->label; + } + if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')'; + if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private"); + //if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' '; + } + } + + // Zone to select email template + if (count($modelmail_array)>0) + { + // If list of template is filled + $out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n"; + $out.= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100'); + if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); + $out.= '   '; + $out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">'; + $out.= '   '; + $out.= '</div>'; + } + elseif (! empty($this->param['models']) && in_array($this->param['models'], array( + 'propal_send','order_send','facture_send', + 'shipping_send','fichinter_send','supplier_proposal_send','order_supplier_send', + 'invoice_supplier_send','thirdparty','contract','user','all' + ))) + { + // If list of template is empty + $out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n"; + $out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. + if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); + $out.= '   '; + $out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" disabled="disabled" id="modelselected">'; + $out.= '   '; + $out.= '</div>'; + } + + + + $out.= '<table class="border" width="100%">'."\n"; + + // Substitution array + if (! empty($this->withsubstit)) // Unset of set ->withsubstit=0 to disable this. + { + $out.= '<tr><td colspan="2" align="right">'; + //$out.='<div class="floatright">'; + $help=""; + foreach($this->substit as $key => $val) + { + $help.=$key.' -> '.$langs->trans(dol_string_nohtmltag($val)).'<br>'; + } + if (is_numeric($this->withsubstit)) $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help, 1, 'help', '', 0, 2, 'substittooltip'); // Old usage + else $out.= $form->textwithpicto($langs->trans('AvailableVariables'), $help, 1, 'help', '', 0, 2, 'substittooltip'); // New usage + $out.= "</td></tr>\n"; + //$out.='</div>'; + } + + // From + if (! empty($this->withfrom)) + { + if (! empty($this->withfromreadonly)) + { + $out.= '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td>'; + + if (! ($this->fromtype === 'user' && $this->fromid > 0) + && ! ($this->fromtype === 'company') + && ! preg_match('/user_aliases/', $this->fromtype) + && ! preg_match('/global_aliases/', $this->fromtype) + && ! preg_match('/senderprofile/', $this->fromtype)) + { + // Use this->fromname and this->frommail or error if not defined + $out.= $this->fromname; + if ($this->frommail) + { + $out.= ' <'.$this->frommail.'>'; + } + else + { + if ($this->fromtype) + { + $langs->load('errors'); + $out.= '<span class="warning"> <'.$langs->trans('ErrorNoMailDefinedForThisUser').'> </span>'; + } + } + } else { + $liste = array(); + + // Add user email + if (empty($user->email)) + { + $langs->load('errors'); + $liste['user'] = $user->getFullName($langs) . ' <'.$langs->trans('ErrorNoMailDefinedForThisUser').'>'; + } + else + { + $liste['user'] = $user->getFullName($langs) .' <'.$user->email.'>'; + } + + // Add also company main email + $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + + // Add also email aliases if there is some + $listaliases=array('user_aliases'=>$user->email_aliases, 'global_aliases'=>$conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); + + // Add also email aliases from the c_email_senderprofile table + $sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1 ORDER BY position'; + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while($i < $num) + { + $obj = $this->db->fetch_object($resql); + if ($obj) + { + $listaliases['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; + } + $i++; + } + } + else dol_print_error($this->db); + + foreach($listaliases as $typealias => $listalias) + { + $posalias=0; + $listaliasarray=explode(',', $listalias); + foreach ($listaliasarray as $listaliasval) + { + $posalias++; + $listaliasval=trim($listaliasval); + if ($listaliasval) + { + $listaliasval=preg_replace('/</', '<', $listaliasval); + $listaliasval=preg_replace('/>/', '>', $listaliasval); + if (! preg_match('/</', $listaliasval)) $listaliasval='<'.$listaliasval.'>'; + $liste[$typealias.'_'.$posalias]=$listaliasval; + } + } + } + $out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', '', 0, '', $disablebademails); + //$out.= ajax_combobox('fromtype'); + } + + $out.= "</td></tr>\n"; + } + else + { + $out.= '<tr><td class="fieldrequired">'.$langs->trans("MailFrom")."</td><td>"; + $out.= $langs->trans("Name").':<input type="text" id="fromname" name="fromname" size="32" value="'.$this->fromname.'" />'; + $out.= '    '; + $out.= $langs->trans("EMail").':<<input type="text" id="frommail" name="frommail" size="32" value="'.$this->frommail.'" />>'; + $out.= "</td></tr>\n"; + } + } + + // To + if (! empty($this->withto) || is_array($this->withto)) + { + $out.= '<tr><td class="fieldrequired" width="180">'; + if ($this->withtofree) $out.= $form->textwithpicto($langs->trans("MailTo"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + else $out.= $langs->trans("MailTo"); + $out.= '</td><td>'; + if ($this->withtoreadonly) + { + if (! empty($this->toname) && ! empty($this->tomail)) + { + $out.= '<input type="hidden" id="toname" name="toname" value="'.$this->toname.'" />'; + $out.= '<input type="hidden" id="tomail" name="tomail" value="'.$this->tomail.'" />'; + if ($this->totype == 'thirdparty') + { + $soc=new Societe($this->db); + $soc->fetch($this->toid); + $out.= $soc->getNomUrl(1); + } + else if ($this->totype == 'contact') + { + $contact=new Contact($this->db); + $contact->fetch($this->toid); + $out.= $contact->getNomUrl(1); + } + else + { + $out.= $this->toname; + } + $out.= ' <'.$this->tomail.'>'; + if ($this->withtofree) + { + $out.= '<br>'.$langs->trans("and").' <input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />'; + } + } + else + { + // Note withto may be a text like 'AllRecipientSelected' + $out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:""; + } + } + else + { + if (! empty($this->withtofree)) + { + $out.= '<input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />'; + } + if (! empty($this->withto) && is_array($this->withto)) + { + if (! empty($this->withtofree)) $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; + // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + $tmparray = $this->withto; + foreach($tmparray as $key => $val) + { + $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + } + $withtoselected=GETPOST("receiver",'none'); // Array of selected value + if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action','aZ09') == 'presend') + { + $withtoselected = array_keys($tmparray); + } + $out.= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, ""); + } + } + $out.= "</td></tr>\n"; + } + + // withoptiononeemailperrecipient + if (! empty($this->withoptiononeemailperrecipient)) + { + $out.= '<tr><td>'; + $out.= $langs->trans("GroupEmails"); + $out.= '</td><td>'; + $out.=' <input type="checkbox" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0?' checked="checked"':'').'> '; + $out.= $langs->trans("OneEmailPerRecipient").' - '; + $out.= $langs->trans("WarningIfYouCheckOneRecipientPerEmail"); + $out.= '</td></tr>'; + } + + // CC + if (! empty($this->withtocc) || is_array($this->withtocc)) + { + $out.= '<tr><td>'; + $out.= $form->textwithpicto($langs->trans("MailCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + $out.= '</td><td>'; + if ($this->withtoccreadonly) + { + $out.= (! is_array($this->withtocc) && ! is_numeric($this->withtocc))?$this->withtocc:""; + } + else + { + $out.= '<input size="'.(is_array($this->withtocc)?"30":"60").'" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />'; + if (! empty($this->withtocc) && is_array($this->withtocc)) + { + $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; + // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + $tmparray = $this->withtocc; + foreach($tmparray as $key => $val) + { + $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + } + $withtoccselected=GETPOST("receivercc"); // Array of selected value + $out.= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500',null, ""); + } + } + $out.= "</td></tr>\n"; + } + + // CCC + if (! empty($this->withtoccc) || is_array($this->withtoccc)) + { + $out.= '<tr><td>'; + $out.= $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + $out.= '</td><td>'; + if (! empty($this->withtocccreadonly)) + { + $out.= (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:""; + } + else + { + $out.= '<input size="'.(is_array($this->withtoccc)?"30":"60").'" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; + if (! empty($this->withtoccc) && is_array($this->withtoccc)) + { + $out.= " ".$langs->trans("and")."/".$langs->trans("or")." "; + // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + $tmparray = $this->withtoccc; + foreach($tmparray as $key => $val) + { + $tmparray[$key]=dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + } + $withtocccselected=GETPOST("receiverccc"); // Array of selected value + $out.= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, null, null, null,null, "90%"); + } } - $defaulttopic=make_substitutions($defaulttopic,$this->substit); + $showinfobcc=''; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO; + if ($showinfobcc) $out.=' + '.$showinfobcc; + $out.= "</td></tr>\n"; + } - $out.= '<tr>'; - $out.= '<td class="fieldrequired">'.$langs->trans("MailTopic").'</td>'; - $out.= '<td>'; - if ($this->withtopicreadonly) - { - $out.= $defaulttopic; - $out.= '<input type="hidden" class="quatrevingtpercent" id="subject" name="subject" value="'.$defaulttopic.'" />'; - } - else - { - $out.= '<input type="text" class="quatrevingtpercent" id="subject" name="subject" value="'. ((isset($_POST["subject"]) && ! $_POST['modelselected'])?$_POST["subject"]:($defaulttopic?$defaulttopic:'')) .'" />'; - } - $out.= "</td></tr>\n"; - } + // Replyto + if (! empty($this->withreplyto)) + { + if ($this->withreplytoreadonly) + { + $out.= '<input type="hidden" id="replyname" name="replyname" value="'.$this->replytoname.'" />'; + $out.= '<input type="hidden" id="replymail" name="replymail" value="'.$this->replytomail.'" />'; + $out.= "<tr><td>".$langs->trans("MailReply")."</td><td>".$this->replytoname.($this->replytomail?(" <".$this->replytomail.">"):""); + $out.= "</td></tr>\n"; + } + } - // Attached files - if (! empty($this->withfile)) - { - $out.= '<tr>'; - $out.= '<td>'.$langs->trans("MailFile").'</td>'; + // Errorsto + if (! empty($this->witherrorsto)) + { + //if (! $this->errorstomail) $this->errorstomail=$this->frommail; + $errorstomail = (! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail); + if ($this->witherrorstoreadonly) + { + $out.= '<input type="hidden" id="errorstomail" name="errorstomail" value="'.$errorstomail.'" />'; + $out.= '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'; + $out.= $errorstomail; + $out.= "</td></tr>\n"; + } + else + { + $out.= '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'; + $out.= '<input size="30" id="errorstomail" name="errorstomail" value="'.$errorstomail.'" />'; + $out.= "</td></tr>\n"; + } + } - $out.= '<td>'; - if (! empty($this->withmaindocfile)) - { - if ($this->withmaindocfile == 1) - { - $out.='<input type="checkbox" name="addmaindocfile" value="1" />'; - } - if ($this->withmaindocfile == -1) - { - $out.='<input type="checkbox" name="addmaindocfile" checked="checked" />'; - } - $out.=' '.$langs->trans("JoinMainDoc").'.<br>'; - } + // Ask delivery receipt + if (! empty($this->withdeliveryreceipt)) + { + $out.= '<tr><td>'.$langs->trans("DeliveryReceipt").'</td><td>'; - if (is_numeric($this->withfile)) - { + if (! empty($this->withdeliveryreceiptreadonly)) + { + $out.= yn($this->withdeliveryreceipt); + } + else + { + $defaultvaluefordeliveryreceipt=0; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; + $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); + } + + $out.= "</td></tr>\n"; + } + + // Topic + if (! empty($this->withtopic)) + { + $defaulttopic=GETPOST('subject','none'); + if (! GETPOST('modelselected','alpha') || GETPOST('modelmailselected') != '-1') + { + if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['topic']) $defaulttopic=$arraydefaultmessage['topic']; + elseif (! is_numeric($this->withtopic)) $defaulttopic=$this->withtopic; + } + + $defaulttopic=make_substitutions($defaulttopic,$this->substit); + + $out.= '<tr>'; + $out.= '<td class="fieldrequired">'.$langs->trans("MailTopic").'</td>'; + $out.= '<td>'; + if ($this->withtopicreadonly) + { + $out.= $defaulttopic; + $out.= '<input type="hidden" class="quatrevingtpercent" id="subject" name="subject" value="'.$defaulttopic.'" />'; + } + else + { + $out.= '<input type="text" class="quatrevingtpercent" id="subject" name="subject" value="'. ((isset($_POST["subject"]) && ! $_POST['modelselected'])?$_POST["subject"]:($defaulttopic?$defaulttopic:'')) .'" />'; + } + $out.= "</td></tr>\n"; + } + + // Attached files + if (! empty($this->withfile)) + { + $out.= '<tr>'; + $out.= '<td>'.$langs->trans("MailFile").'</td>'; + + $out.= '<td>'; + if (! empty($this->withmaindocfile)) + { + if ($this->withmaindocfile == 1) + { + $out.='<input type="checkbox" name="addmaindocfile" value="1" />'; + } + if ($this->withmaindocfile == -1) + { + $out.='<input type="checkbox" name="addmaindocfile" checked="checked" />'; + } + $out.=' '.$langs->trans("JoinMainDoc").'.<br>'; + } + + if (is_numeric($this->withfile)) + { // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out.= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n"; - $out.= '<script type="text/javascript" language="javascript">'; - $out.= 'jQuery(document).ready(function () {'; - $out.= ' jQuery(".removedfile").click(function() {'; - $out.= ' jQuery(".removedfilehidden").val(jQuery(this).val());'; - $out.= ' });'; - $out.= '})'; - $out.= '</script>'."\n"; - if (count($listofpaths)) - { - foreach($listofpaths as $key => $val) - { - $out.= '<div id="attachfile_'.$key.'">'; - $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; - if (! $this->withfilereadonly) - { - $out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />'; - //$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>'; - } - $out.= '<br></div>'; - } - } - else if (empty($this->withmaindocfile)) // Do not show message if we asked to show the checkbox - { - $out.= $langs->trans("NoAttachedFiles").'<br>'; - } - if ($this->withfile == 2) // Can add other files - { - if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) $out.= '<input type="file" class="flat" id="addedfile" name="addedfile[]" value="'.$langs->trans("Upload").'" multiple />'; + $out.= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n"; + $out.= '<script type="text/javascript" language="javascript">'; + $out.= 'jQuery(document).ready(function () {'; + $out.= ' jQuery(".removedfile").click(function() {'; + $out.= ' jQuery(".removedfilehidden").val(jQuery(this).val());'; + $out.= ' });'; + $out.= '})'; + $out.= '</script>'."\n"; + if (count($listofpaths)) + { + foreach($listofpaths as $key => $val) + { + $out.= '<div id="attachfile_'.$key.'">'; + $out.= img_mime($listofnames[$key]).' '.$listofnames[$key]; + if (! $this->withfilereadonly) + { + $out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />'; + //$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>'; + } + $out.= '<br></div>'; + } + } + else if (empty($this->withmaindocfile)) // Do not show message if we asked to show the checkbox + { + $out.= $langs->trans("NoAttachedFiles").'<br>'; + } + if ($this->withfile == 2) // Can add other files + { + if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) $out.= '<input type="file" class="flat" id="addedfile" name="addedfile[]" value="'.$langs->trans("Upload").'" multiple />'; else $out.= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />'; - $out.= ' '; - $out.= '<input class="button" type="submit" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />'; - } - } - else - { - $out.=$this->withfile; - } + $out.= ' '; + $out.= '<input class="button" type="submit" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />'; + } + } + else + { + $out.=$this->withfile; + } - $out.= "</td></tr>\n"; - } + $out.= "</td></tr>\n"; + } - // Message - if (! empty($this->withbody)) - { - $defaultmessage=GETPOST('message','none'); + // Message + if (! empty($this->withbody)) + { + $defaultmessage=GETPOST('message','none'); if (! GETPOST('modelselected','alpha') || GETPOST('modelmailselected') != '-1') { if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['content']) $defaultmessage=$arraydefaultmessage['content']; - elseif (! is_numeric($this->withbody)) $defaultmessage=$this->withbody; + elseif (! is_numeric($this->withbody)) $defaultmessage=$this->withbody; } - // Complete substitution array - $paymenturl=''; - if (! empty($conf->global->PAYMENT_ADD_PAYMENT_URL) // Option to enable to add online link into __PERSONALIZED__ - || (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) - ) - { - if (empty($this->substit['__REF__'])) - { - //$paymenturl='LinkToPayOnlineNotAvailableInThisContext'; - $paymenturl=''; - } - else - { - // Set the online payment message and url link into __PERSONALIZED__ key - require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; - $langs->load('paypal'); - $typeforonlinepayment='free'; - if ($this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template - if ($this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template - if ($this->param["models"]=='member_send') $typeforonlinepayment='member'; // TODO use detection on something else than template - $url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']); - //$paymenturl=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url)); - $paymenturl=$url; - } - } - $this->substit['__PERSONALIZED__']=$paymenturl; // deprecated - $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; + // Complete substitution array + $paymenturl=''; + if (! empty($conf->global->PAYMENT_ADD_PAYMENT_URL) // Option to enable to add online link into __PERSONALIZED__ + || (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) + ) + { + if (empty($this->substit['__REF__'])) + { + //$paymenturl='LinkToPayOnlineNotAvailableInThisContext'; + $paymenturl=''; + } + else + { + // Set the online payment message and url link into __PERSONALIZED__ key + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + $langs->load('paypal'); + $typeforonlinepayment='free'; + if ($this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template + if ($this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template + if ($this->param["models"]=='member_send') $typeforonlinepayment='member'; // TODO use detection on something else than template + $url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']); + //$paymenturl=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url)); + $paymenturl=$url; + } + } + $this->substit['__PERSONALIZED__']=$paymenturl; // deprecated + $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; - //Add lines substitution key from each line - $lines = ''; - $defaultlines = $arraydefaultmessage['content_lines']; - if (isset($defaultlines)) - { - foreach ($this->substit_lines as $substit_line) - { - $lines .= make_substitutions($defaultlines,$substit_line)."\n"; - } - } - $this->substit['__LINES__']=$lines; + //Add lines substitution key from each line + $lines = ''; + $defaultlines = $arraydefaultmessage['content_lines']; + if (isset($defaultlines)) + { + foreach ($this->substit_lines as $substit_line) + { + $lines .= make_substitutions($defaultlines,$substit_line)."\n"; + } + } + $this->substit['__LINES__']=$lines; $defaultmessage=str_replace('\n',"\n",$defaultmessage); diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index ba060e62a77..11bc480bf4f 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -96,15 +96,15 @@ class ExpenseReportRule extends CoreObject - /** - * Attribute object linked with database - * @var array - */ + /** + * Attribute object linked with database + * @var array + */ protected $fields=array( 'rowid'=>array('type'=>'integer','index'=>true) ,'dates'=>array('type'=>'date') ,'datee'=>array('type'=>'date') - ,'amount'=>array('type'=>'double') + ,'amount'=>array('type'=>'double') ,'restrictive'=>array('type'=>'integer') ,'fk_user'=>array('type'=>'integer') ,'fk_usergroup'=>array('type'=>'integer') @@ -114,16 +114,16 @@ class ExpenseReportRule extends CoreObject ,'entity'=>array('type'=>'integer') ); - /** - * Constructor - * - * @param DoliDB $db Database handler - */ + /** + * Constructor + * + * @param DoliDB $db Database handler + */ public function __construct(DoliDB &$db) { global $conf; - parent::__construct($db); + parent::__construct($db); parent::init(); $this->errors = array(); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 23726ad15e6..31a40658251 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -45,8 +45,8 @@ if (! empty($conf->supplier_proposal->enabled)) if (!empty($conf->produit->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (!empty($conf->projet->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP @@ -95,8 +95,8 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Load object if ($id > 0 || ! empty($ref)) { - $ret = $object->fetch($id, $ref); - if ($ret < 0) dol_print_error($db,$object->error); + $ret = $object->fetch($id, $ref); + if ($ret < 0) dol_print_error($db,$object->error); $ret = $object->fetch_thirdparty(); if ($ret < 0) dol_print_error($db,$object->error); } @@ -143,7 +143,7 @@ if (empty($reshook)) if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) { - $result=$object->setValueFrom('ref_supplier', GETPOST('ref_supplier','alpha'), '', null, 'text', '', $user, 'ORDER_SUPPLIER_MODIFY'); + $result=$object->setValueFrom('ref_supplier', GETPOST('ref_supplier','alpha'), '', null, 'text', '', $user, 'ORDER_SUPPLIER_MODIFY'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -157,14 +157,14 @@ if (empty($reshook)) // payment conditions if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer) { - $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); + $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // payment mode if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) { - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -181,7 +181,7 @@ if (empty($reshook)) // bank account if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer) { - $result=$object->setBankAccount(GETPOST('fk_account', 'int')); + $result=$object->setBankAccount(GETPOST('fk_account', 'int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -195,72 +195,72 @@ if (empty($reshook)) // Set project if ($action == 'classin' && $user->rights->fournisseur->commande->creer) { - $result=$object->setProject($projectid); + $result=$object->setProject($projectid); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) { - $result = $object->set_remise($user, $_POST['remise_percent']); + $result = $object->set_remise($user, $_POST['remise_percent']); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } if ($action == 'reopen') // no test on permission here, permission to use will depends on status { - if (in_array($object->statut, array(1, 2, 3, 4, 5, 6, 7, 9))) - { - if ($object->statut == 1) $newstatus=0; // Validated->Draft - else if ($object->statut == 2) $newstatus=0; // Approved->Draft - else if ($object->statut == 3) $newstatus=2; // Ordered->Approved - else if ($object->statut == 4) $newstatus=3; - else if ($object->statut == 5) - { - //$newstatus=2; // Ordered - // TODO Can we set it to submited ? - //$newstatus=3; // Submited - // TODO If there is at least one reception, we can set to Received->Received partially - $newstatus=4; // Received partially + if (in_array($object->statut, array(1, 2, 3, 4, 5, 6, 7, 9))) + { + if ($object->statut == 1) $newstatus=0; // Validated->Draft + else if ($object->statut == 2) $newstatus=0; // Approved->Draft + else if ($object->statut == 3) $newstatus=2; // Ordered->Approved + else if ($object->statut == 4) $newstatus=3; + else if ($object->statut == 5) + { + //$newstatus=2; // Ordered + // TODO Can we set it to submited ? + //$newstatus=3; // Submited + // TODO If there is at least one reception, we can set to Received->Received partially + $newstatus=4; // Received partially - } - else if ($object->statut == 6) $newstatus=2; // Canceled->Approved - else if ($object->statut == 7) $newstatus=3; // Canceled->Process running - else if ($object->statut == 9) $newstatus=1; // Refused->Validated - else $newstatus = 2; + } + else if ($object->statut == 6) $newstatus=2; // Canceled->Approved + else if ($object->statut == 7) $newstatus=3; // Canceled->Process running + else if ($object->statut == 9) $newstatus=1; // Refused->Validated + else $newstatus = 2; - //print "old status = ".$object->statut.' new status = '.$newstatus; - $db->begin(); + //print "old status = ".$object->statut.' new status = '.$newstatus; + $db->begin(); - $result = $object->setStatus($user, $newstatus); - if ($result > 0) - { - // Currently the "Re-open" also remove the billed flag because there is no button "Set unpaid" yet. - $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur'; - $sql.= ' SET billed = 0'; - $sql.= ' WHERE rowid = '.$object->id; + $result = $object->setStatus($user, $newstatus); + if ($result > 0) + { + // Currently the "Re-open" also remove the billed flag because there is no button "Set unpaid" yet. + $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur'; + $sql.= ' SET billed = 0'; + $sql.= ' WHERE rowid = '.$object->id; - $resql=$db->query($sql); + $resql=$db->query($sql); - if ($newstatus == 0) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur'; - $sql.= ' SET fk_user_approve = null, fk_user_approve2 = null, date_approve = null, date_approve2 = null'; - $sql.= ' WHERE rowid = '.$object->id; + if ($newstatus == 0) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur'; + $sql.= ' SET fk_user_approve = null, fk_user_approve2 = null, date_approve = null, date_approve2 = null'; + $sql.= ' WHERE rowid = '.$object->id; - $resql=$db->query($sql); - } + $resql=$db->query($sql); + } - $db->commit(); + $db->commit(); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; - } - else + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else { $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - } - } + setEventMessages($object->error, $object->errors, 'errors'); + } + } } /* @@ -277,10 +277,10 @@ if (empty($reshook)) // Add a product line if ($action == 'addline' && $user->rights->fournisseur->commande->creer) { - $db->begin(); + $db->begin(); - $langs->load('errors'); - $error = 0; + $langs->load('errors'); + $error = 0; // Set if we used free entry or predefined product $predef=''; @@ -305,43 +305,43 @@ if (empty($reshook)) $remise_percent=GETPOST('remise_percent'.$predef); $price_ht_devise = GETPOST('multicurrency_price_ht'); - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - // Unset extrafield - if (is_array($extralabelsline)) { - // Get extra fields - foreach ($extralabelsline as $key => $value) { - unset($_POST["options_" . $key]); - } - } + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + // Unset extrafield + if (is_array($extralabelsline)) { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key]); + } + } - if ($prod_entry_mode =='free' && GETPOST('price_ht') < 0 && $qty < 0) - { - setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } - if ($prod_entry_mode =='free' && ! GETPOST('idprodfournprice') && GETPOST('type') < 0) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); - $error++; - } - if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise === '') // Unit price can be 0 but not '' - { - setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); - $error++; - } - if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); - $error++; - } - if (! GETPOST('qty')) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } + if ($prod_entry_mode =='free' && GETPOST('price_ht') < 0 && $qty < 0) + { + setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } + if ($prod_entry_mode =='free' && ! GETPOST('idprodfournprice') && GETPOST('type') < 0) + { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); + $error++; + } + if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise === '') // Unit price can be 0 but not '' + { + setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); + $error++; + } + if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) + { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); + $error++; + } + if (! GETPOST('qty')) + { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { @@ -358,14 +358,14 @@ if (empty($reshook)) } // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $txtva par celui du produit - if (($prod_entry_mode != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' - { - $productsupplier = new ProductFournisseur($db); + // Ecrase $desc par celui du produit + // Ecrase $txtva par celui du produit + if (($prod_entry_mode != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' + { + $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless - { + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless + { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) } @@ -377,67 +377,67 @@ if (empty($reshook)) // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist } - elseif (GETPOST('idprodfournprice') > 0) - { - $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. - //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); - $res=$productsupplier->fetch($idprod); - } + elseif (GETPOST('idprodfournprice') > 0) + { + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); + } - if ($idprod > 0) - { - $label = $productsupplier->label; + if ($idprod > 0) + { + $label = $productsupplier->label; - $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + $desc = $productsupplier->description; + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); - $type = $productsupplier->type; + $type = $productsupplier->type; - $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); - $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); + $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); + $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); if (empty($tva_tx)) $tva_npr=0; - $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); - $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); + $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); + $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); - $result=$object->addline( - $desc, - $productsupplier->fourn_pu, - $qty, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $idprod, - $productsupplier->product_fourn_price_id, - $productsupplier->fourn_ref, - $remise_percent, - 'HT', - $pu_ttc, - $type, - $tva_npr, - '', - $date_start, - $date_end, - $array_options, - $productsupplier->fk_unit - ); - } - if ($idprod == -99 || $idprod == 0) - { - // Product not selected - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); - } - if ($idprod == -1) - { - // Quantity too low - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); - } - } - else if (empty($error)) + $result=$object->addline( + $desc, + $productsupplier->fourn_pu, + $qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + $productsupplier->product_fourn_price_id, + $productsupplier->fourn_ref, + $remise_percent, + 'HT', + $pu_ttc, + $type, + $tva_npr, + '', + $date_start, + $date_end, + $array_options, + $productsupplier->fk_unit + ); + } + if ($idprod == -99 || $idprod == 0) + { + // Product not selected + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); + } + if ($idprod == -1) + { + // Quantity too low + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); + } + } + else if (empty($error)) { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -449,208 +449,37 @@ if (empty($reshook)) $fk_unit= GETPOST('units', 'alpha'); - $tva_tx = price2num($tva_tx); // When vat is text input field + $tva_tx = price2num($tva_tx); // When vat is text input field - // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); - $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); + // Local Taxes + $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); + $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - if (GETPOST('price_ht')!=='') - { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); - $ttc = 0; - } - else - { - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($tva_tx / 100)); - $price_base_type = 'HT'; - } + if (GETPOST('price_ht')!=='') + { + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); + $ttc = 0; + } + else + { + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($tva_tx / 100)); + $price_base_type = 'HT'; + } $pu_ht_devise = price2num($price_ht_devise, 'MU'); $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit, $pu_ht_devise); } - //print "xx".$tva_tx; exit; - if (! $error && $result > 0) - { - $db->commit(); - - $ret=$object->fetch($object->id); // Reload to get new records - - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records - - $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); - } - - unset($_POST ['prod_entry_mode']); - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['remise_percent']); - unset($_POST['pu']); - unset($_POST['price_ht']); - unset($_POST['multicurrency_price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['label']); - unset($localtax1_tx); - unset($localtax2_tx); - unset($_POST['np_marginRate']); - unset($_POST['np_markRate']); - unset($_POST['dp_desc']); - unset($_POST['idprodfournprice']); - - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); - } - else + //print "xx".$tva_tx; exit; + if (! $error && $result > 0) { - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - } + $db->commit(); - $action = ''; - } + $ret=$object->fetch($object->id); // Reload to get new records - /* - * Updating a line in the order - */ - if ($action == 'updateline' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel','alpha')) - { - $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); - - if ($lineid) - { - $line = new CommandeFournisseurLigne($db); - $res = $line->fetch($lineid); - if (!$res) dol_print_error($db); - } - - $productsupplier = new ProductFournisseur($db); - if ($productsupplier->get_buyprice(0, price2num($_POST['qty']), $line->fk_product, 'none', GETPOST('socid','int')) < 0 ) - { - setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings'); - } - - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - - // Define info_bits - $info_bits = 0; - if (preg_match('/\*/', $vat_rate)) - $info_bits |= 0x01; - - // Define vat_rate - $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty); - $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); - - if (GETPOST('price_ht') != '') - { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); - } - else - { - $vatratecleaned = $vat_rate; - if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" - { - $vatratecleaned = trim($reg[1]); - $vatratecode = $reg[2]; - } - - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($vatratecleaned / 100)); - $price_base_type = 'HT'; - } - - $pu_ht_devise = GETPOST('multicurrency_subprice'); - - // Extrafields Lines - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); - // Unset extrafield POST Data - if (is_array($extralabelsline)) { - foreach ($extralabelsline as $key => $value) { - unset($_POST["options_" . $key]); - } - } - - $result = $object->updateline( - $lineid, - $_POST['product_desc'], - $ht, - $_POST['qty'], - $_POST['remise_percent'], - $vat_rate, - $localtax1_rate, - $localtax2_rate, - $price_base_type, - 0, - isset($_POST["type"])?$_POST["type"]:$line->product_type, - false, - $date_start, - $date_end, - $array_options, - $_POST['units'], - $pu_ht_devise - ); - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['idprodfournprice']); - unset($_POST['remmise_percent']); - unset($_POST['dp_desc']); - unset($_POST['np_desc']); - unset($_POST['pu']); - unset($_POST['tva_tx']); - unset($_POST['date_start']); - unset($_POST['date_end']); - unset($_POST['units']); - unset($localtax1_tx); - unset($localtax2_tx); - - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); - - if ($result >= 0) - { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -668,12 +497,183 @@ if (empty($reshook)) $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } - } - else - { + + unset($_POST ['prod_entry_mode']); + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['remise_percent']); + unset($_POST['pu']); + unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['label']); + unset($localtax1_tx); + unset($localtax2_tx); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); + unset($_POST['dp_desc']); + unset($_POST['idprodfournprice']); + + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); + } + else + { + $db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); + } + + $action = ''; + } + + /* + * Updating a line in the order + */ + if ($action == 'updateline' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel','alpha')) + { + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + + if ($lineid) + { + $line = new CommandeFournisseurLigne($db); + $res = $line->fetch($lineid); + if (!$res) dol_print_error($db); + } + + $productsupplier = new ProductFournisseur($db); + if ($productsupplier->get_buyprice(0, price2num($_POST['qty']), $line->fk_product, 'none', GETPOST('socid','int')) < 0 ) + { + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings'); + } + + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + + // Define info_bits + $info_bits = 0; + if (preg_match('/\*/', $vat_rate)) + $info_bits |= 0x01; + + // Define vat_rate + $vat_rate = str_replace('*', '', $vat_rate); + $localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty); + + if (GETPOST('price_ht') != '') + { + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); + } + else + { + $vatratecleaned = $vat_rate; + if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)" + { + $vatratecleaned = trim($reg[1]); + $vatratecode = $reg[2]; + } + + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($vatratecleaned / 100)); + $price_base_type = 'HT'; + } + + $pu_ht_devise = GETPOST('multicurrency_subprice'); + + // Extrafields Lines + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline); + // Unset extrafield POST Data + if (is_array($extralabelsline)) { + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key]); + } + } + + $result = $object->updateline( + $lineid, + $_POST['product_desc'], + $ht, + $_POST['qty'], + $_POST['remise_percent'], + $vat_rate, + $localtax1_rate, + $localtax2_rate, + $price_base_type, + 0, + isset($_POST["type"])?$_POST["type"]:$line->product_type, + false, + $date_start, + $date_end, + $array_options, + $_POST['units'], + $pu_ht_devise + ); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['idprodfournprice']); + unset($_POST['remmise_percent']); + unset($_POST['dp_desc']); + unset($_POST['np_desc']); + unset($_POST['pu']); + unset($_POST['tva_tx']); + unset($_POST['date_start']); + unset($_POST['date_end']); + unset($_POST['units']); + unset($localtax1_tx); + unset($localtax2_tx); + + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); + + if ($result >= 0) + { + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records + + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) dol_print_error($db,$result); + } + } + else + { dol_print_error($db,$object->error); exit; - } + } } @@ -712,49 +712,49 @@ if (empty($reshook)) // Validate if ($action == 'confirm_valid' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate))) ) { - $object->date_commande=dol_now(); - $result = $object->valid($user); - if ($result >= 0) - { - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records - - $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); - } - } - else + $object->date_commande=dol_now(); + $result = $object->valid($user); + if ($result >= 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records - // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step - if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && ! (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))) - { - $action='confirm_approve'; // can make standard or first level approval also if permission is set - } + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) dol_print_error($db,$result); + } + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + + // If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step + if (empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE) && $user->rights->fournisseur->commande->approuver && ! (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))) + { + $action='confirm_approve'; // can make standard or first level approval also if permission is set + } } if (($action == 'confirm_approve' || $action == 'confirm_approve2') && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) { - $idwarehouse=GETPOST('idwarehouse', 'int'); + $idwarehouse=GETPOST('idwarehouse', 'int'); - $qualified_for_stock_change=0; + $qualified_for_stock_change=0; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $qualified_for_stock_change=$object->hasProductsOrServices(2); @@ -764,95 +764,95 @@ if (empty($reshook)) $qualified_for_stock_change=$object->hasProductsOrServices(1); } - // Check parameters - if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) // warning name of option should be STOCK_CALCULATE_ON_SUPPLIER_APPROVE_ORDER - { - if (! $idwarehouse || $idwarehouse == -1) - { - $error++; - setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); - $action=''; - } - } - - if (! $error) - { - $result = $object->approve($user, $idwarehouse, ($action=='confirm_approve2'?1:0)); - if ($result > 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); - exit; - } - else + // Check parameters + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) // warning name of option should be STOCK_CALCULATE_ON_SUPPLIER_APPROVE_ORDER + { + if (! $idwarehouse || $idwarehouse == -1) { - setEventMessages($object->error, $object->errors, 'errors'); - } - } + $error++; + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); + $action=''; + } + } + + if (! $error) + { + $result = $object->approve($user, $idwarehouse, ($action=='confirm_approve2'?1:0)); + if ($result > 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } } if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) { - $result = $object->refuse($user); - if ($result > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result = $object->refuse($user); + if ($result > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { - $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); - if ($result > 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - $action = ''; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); + if ($result > 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + $action = ''; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer) { - $result=$object->delete($user); - if ($result > 0) - { - header("Location: ".DOL_URL_ROOT.'/fourn/commande/list.php'); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result=$object->delete($user); + if ($result > 0) + { + header("Location: ".DOL_URL_ROOT.'/fourn/commande/list.php'); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } // Action clone object @@ -874,7 +874,7 @@ if (empty($reshook)) } else { - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action=''; } } @@ -884,44 +884,44 @@ if (empty($reshook)) // Set status of reception (complete, partial, ...) if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner) { - if (GETPOST("type") != '') - { - $date_liv = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear")); + if (GETPOST("type") != '') + { + $date_liv = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear")); - $result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can' - if ($result > 0) - { - $langs->load("deliveries"); - setEventMessages($langs->trans("DeliveryStateSaved"), null); - $action = ''; - } - else if($result == -3) - { - setEventMessages($object->error, $object->errors, 'errors'); - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - else - { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); - } + $result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can' + if ($result > 0) + { + $langs->load("deliveries"); + setEventMessages($langs->trans("DeliveryStateSaved"), null); + $action = ''; + } + else if($result == -3) + { + setEventMessages($object->error, $object->errors, 'errors'); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + else + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); + } } if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) { - $result = $object->cancel($user); - if ($result > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $result = $object->cancel($user); + if ($result > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } // Actions when printing a doc from card @@ -983,25 +983,25 @@ if (empty($reshook)) { $error=0; - if ($socid <1) - { - setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')), null, 'errors'); - $action='create'; - $error++; - } + if ($socid <1) + { + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')), null, 'errors'); + $action='create'; + $error++; + } - if (! $error) - { - $db->begin(); + if (! $error) + { + $db->begin(); - // Creation commande - $object->ref_supplier = GETPOST('refsupplier'); - $object->socid = $socid; + // Creation commande + $object->ref_supplier = GETPOST('refsupplier'); + $object->socid = $socid; $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->fk_account = GETPOST('fk_account', 'int'); - $object->note_private = GETPOST('note_private','none'); - $object->note_public = GETPOST('note_public','none'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->fk_account = GETPOST('fk_account', 'int'); + $object->note_private = GETPOST('note_private','none'); + $object->note_public = GETPOST('note_public','none'); $object->date_livraison = $datelivraison; $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); @@ -1010,23 +1010,23 @@ if (empty($reshook)) $object->fk_project = GETPOST('projectid'); // Fill array 'array_options' with data from add form - if (! $error) - { + if (! $error) + { $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) $error++; - } + } - if (! $error) - { - // If creation from another object of another module (Example: origin=propal, originid=1) + if (! $error) + { + // If creation from another object of another module (Example: origin=propal, originid=1) if (! empty($origin) && ! empty($originid)) { if ($origin == 'order' || $origin == 'commande') { - $element = $subelement = 'commande'; - } - else - { + $element = $subelement = 'commande'; + } + else + { $element = 'supplier_proposal'; $subelement = 'supplier_proposal'; } @@ -1085,7 +1085,7 @@ if (empty($reshook)) // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if - // trigger used + // trigger used { $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_option = $lines[$i]->array_options; @@ -1094,14 +1094,14 @@ if (empty($reshook)) $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $srcobject->socid); if ($result>=0) { - $tva_tx = $lines[$i]->tva_tx; + $tva_tx = $lines[$i]->tva_tx; - if ($origin=="commande") - { - $soc=new societe($db); - $soc->fetch($socid); - $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id); - } + if ($origin=="commande") + { + $soc=new societe($db); + $soc->fetch($socid); + $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id); + } $result = $object->addline( $desc, @@ -1150,132 +1150,132 @@ if (empty($reshook)) if ($reshook < 0) $error ++; } else { - setEventMessages($srcobject->error, $srcobject->errors, 'errors'); + setEventMessages($srcobject->error, $srcobject->errors, 'errors'); $error ++; } } else { - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $error ++; } } else { - $id = $object->create($user); - if ($id < 0) - { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - } + $id = $object->create($user); + if ($id < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } } - } + } - if ($error) - { - $langs->load("errors"); - $db->rollback(); - $action='create'; - $_GET['socid']=$_POST['socid']; - } - else + if ($error) { - $db->commit(); - header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); - exit; - } - } + $langs->load("errors"); + $db->rollback(); + $action='create'; + $_GET['socid']=$_POST['socid']; + } + else + { + $db->commit(); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + exit; + } + } } if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST('cancel','alpha')) { - $ws_url = $object->thirdparty->webservices_url; - $ws_key = $object->thirdparty->webservices_key; - $ws_user = GETPOST('ws_user','alpha'); - $ws_password = GETPOST('ws_password','alpha'); - $ws_entity = GETPOST('ws_entity','int'); - $ws_thirdparty = GETPOST('ws_thirdparty','int'); + $ws_url = $object->thirdparty->webservices_url; + $ws_key = $object->thirdparty->webservices_key; + $ws_user = GETPOST('ws_user','alpha'); + $ws_password = GETPOST('ws_password','alpha'); + $ws_entity = GETPOST('ws_entity','int'); + $ws_thirdparty = GETPOST('ws_thirdparty','int'); - // NS and Authentication parameters - $ws_ns='http://www.dolibarr.org/ns/'; - $ws_authentication=array( - 'dolibarrkey'=>$ws_key, - 'sourceapplication'=>'DolibarrWebServiceClient', - 'login'=>$ws_user, - 'password'=>$ws_password, - 'entity'=>$ws_entity - ); + // NS and Authentication parameters + $ws_ns='http://www.dolibarr.org/ns/'; + $ws_authentication=array( + 'dolibarrkey'=>$ws_key, + 'sourceapplication'=>'DolibarrWebServiceClient', + 'login'=>$ws_user, + 'password'=>$ws_password, + 'entity'=>$ws_entity + ); - //Is sync supplier web services module activated? and everything filled? - if (empty($conf->syncsupplierwebservices->enabled)) { - setEventMessages($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name")), null, 'mesgs'); - } else if (empty($ws_url) || empty($ws_key)) { - setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors'); - } else if (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) { - setEventMessages($langs->trans("ErrorFieldsRequired"),null, 'errors'); - } - else - { - //Create SOAP client and connect it to order - $soapclient_order = new nusoap_client($ws_url."/webservices/server_order.php"); - $soapclient_order->soap_defencoding='UTF-8'; - $soapclient_order->decodeUTF8(false); + //Is sync supplier web services module activated? and everything filled? + if (empty($conf->syncsupplierwebservices->enabled)) { + setEventMessages($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name")), null, 'mesgs'); + } else if (empty($ws_url) || empty($ws_key)) { + setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors'); + } else if (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) { + setEventMessages($langs->trans("ErrorFieldsRequired"),null, 'errors'); + } + else + { + //Create SOAP client and connect it to order + $soapclient_order = new nusoap_client($ws_url."/webservices/server_order.php"); + $soapclient_order->soap_defencoding='UTF-8'; + $soapclient_order->decodeUTF8(false); - //Create SOAP client and connect it to product/service - $soapclient_product = new nusoap_client($ws_url."/webservices/server_productorservice.php"); - $soapclient_product->soap_defencoding='UTF-8'; - $soapclient_product->decodeUTF8(false); + //Create SOAP client and connect it to product/service + $soapclient_product = new nusoap_client($ws_url."/webservices/server_productorservice.php"); + $soapclient_product->soap_defencoding='UTF-8'; + $soapclient_product->decodeUTF8(false); - //Prepare the order lines from order - $order_lines = array(); - foreach ($object->lines as $line) - { - $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $line->ref_supplier); - $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); + //Prepare the order lines from order + $order_lines = array(); + foreach ($object->lines as $line) + { + $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $line->ref_supplier); + $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); - if ($result_product["result"]["result_code"] == "OK") - { - $order_lines[] = array( - 'desc' => $line->product_desc, - 'type' => $line->product_type, - 'product_id' => $result_product["product"]["id"], - 'vat_rate' => $line->tva_tx, - 'qty' => $line->qty, - 'price' => $line->price, - 'unitprice' => $line->subprice, - 'total_net' => $line->total_ht, - 'total_vat' => $line->total_tva, - 'total' => $line->total_ttc, - 'date_start' => $line->date_start, - 'date_end' => $line->date_end, - ); - } - } + if ($result_product["result"]["result_code"] == "OK") + { + $order_lines[] = array( + 'desc' => $line->product_desc, + 'type' => $line->product_type, + 'product_id' => $result_product["product"]["id"], + 'vat_rate' => $line->tva_tx, + 'qty' => $line->qty, + 'price' => $line->price, + 'unitprice' => $line->subprice, + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'date_start' => $line->date_start, + 'date_end' => $line->date_end, + ); + } + } - //Prepare the order header - $order = array( - 'thirdparty_id' => $ws_thirdparty, - 'date' => dol_print_date(dol_now(),'dayrfc'), - 'total_net' => $object->total_ht, - 'total_var' => $object->total_tva, - 'total' => $object->total_ttc, - 'lines' => $order_lines - ); + //Prepare the order header + $order = array( + 'thirdparty_id' => $ws_thirdparty, + 'date' => dol_print_date(dol_now(),'dayrfc'), + 'total_net' => $object->total_ht, + 'total_var' => $object->total_tva, + 'total' => $object->total_ttc, + 'lines' => $order_lines + ); - $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); - $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); + $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); + $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); - if (empty($result_order["result"]["result_code"])) //No result, check error str - { - setEventMessages($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", null, 'errors'); - } - else if ($result_order["result"]["result_code"] != "OK") //Something went wrong - { - setEventMessages($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", null, 'errors'); - } - else - { - setEventMessages($langs->trans("RemoteOrderRef")." ".$result_order["ref"], null, 'mesgs'); - } - } + if (empty($result_order["result"]["result_code"])) //No result, check error str + { + setEventMessages($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", null, 'errors'); + } + else if ($result_order["result"]["result_code"] != "OK") //Something went wrong + { + setEventMessages($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", null, 'errors'); + } + else + { + setEventMessages($langs->trans("RemoteOrderRef")." ".$result_order["ref"], null, 'mesgs'); + } + } } if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->commande->creer) @@ -1395,9 +1395,9 @@ if ($action=='create') $soc = $objectsrc->client; $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_id)?$soc->cond_reglement_id:0)); $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); - $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); + $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); $availability_id = (!empty($objectsrc->availability_id)?$objectsrc->availability_id:(!empty($soc->availability_id)?$soc->availability_id:0)); - $shipping_method_id = (! empty($objectsrc->shipping_method_id)?$objectsrc->shipping_method_id:(! empty($soc->shipping_method_id)?$soc->shipping_method_id:0)); + $shipping_method_id = (! empty($objectsrc->shipping_method_id)?$objectsrc->shipping_method_id:(! empty($soc->shipping_method_id)?$soc->shipping_method_id:0)); $demand_reason_id = (!empty($objectsrc->demand_reason_id)?$objectsrc->demand_reason_id:(!empty($soc->demand_reason_id)?$soc->demand_reason_id:0)); $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); @@ -1461,10 +1461,10 @@ if ($action=='create') else { print $form->select_company((empty($socid)?'':$socid), 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - // reload page to retrieve customer informations - if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) - { - print '<script type="text/javascript"> + // reload page to retrieve customer informations + if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) + { + print '<script type="text/javascript"> $(document).ready(function() { $("#socid").change(function() { var socid = $(this).val(); @@ -1473,8 +1473,8 @@ if ($action=='create') }); }); </script>'; - } - print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; + } + print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; } print '</td>'; @@ -1504,14 +1504,14 @@ if ($action=='create') $form->select_date($datelivraison?$datelivraison:-1,'liv_',$usehourmin,$usehourmin,'',"set"); print '</td></tr>'; - // Bank Account - if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled)) - { - $langs->load("bank"); - print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; - } + // Bank Account + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled)) + { + $langs->load("bank"); + print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; + } // Project if (! empty($conf->projet->enabled)) @@ -1524,13 +1524,13 @@ if ($action=='create') print '</td></tr>'; } - // Incoterms + // Incoterms if (!empty($conf->incoterm->enabled)) { print '<tr>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->libelle_incoterms, 1).'</label></td>'; - print '<td colspan="3" class="maxwidthonsmartphone">'; - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); + print '<td colspan="3" class="maxwidthonsmartphone">'; + print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:'')); print '</td></tr>'; } @@ -1539,8 +1539,8 @@ if ($action=='create') { print '<tr>'; print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>'; - print '<td colspan="3" class="maxwidthonsmartphone">'; - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print '<td colspan="3" class="maxwidthonsmartphone">'; + print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '</td></tr>'; } @@ -1595,19 +1595,19 @@ if ($action=='create') } // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) - { + { print $object->showOptionals($extrafields,'edit'); - } + } // Bouton "Create Draft" - print "</table>\n"; + print "</table>\n"; - dol_fiche_end(); + dol_fiche_end(); print '<div class="center">'; print '<input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'">'; @@ -1634,9 +1634,9 @@ elseif (! empty($object->id)) { $result = $object->fetch($id, $ref); - $societe = new Fournisseur($db); - $result=$societe->fetch($object->socid); - if ($result < 0) dol_print_error($db); + $societe = new Fournisseur($db); + $result=$societe->fetch($object->socid); + if ($result < 0) dol_print_error($db); $author = new User($db); $author->fetch($object->user_author_id); @@ -1679,7 +1679,7 @@ elseif (! empty($object->id)) // We check if number is temporary number if (preg_match('/^[\(]?PROV/i',$object->ref) || empty($object->ref)) // empty should not happened, but when it occurs, the test save life { - $newref = $object->getNextNumRef($object->thirdparty); + $newref = $object->getNextNumRef($object->thirdparty); } else $newref = $object->ref; @@ -1706,15 +1706,15 @@ elseif (! empty($object->id)) // Confirm approval if ($action == 'approve' || $action == 'approve2') { - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); - } + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } $formquestion=array(); if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change) @@ -1794,34 +1794,34 @@ elseif (! empty($object->id)) // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref.='<br>'.$langs->trans('Project') . ' '; - if ($user->rights->fournisseur->commande->creer) - { - if ($action != 'classify') - $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; - $morehtmlref.='<input type="hidden" name="action" value="classin">'; - $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; - $morehtmlref.='</form>'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; - $morehtmlref.=$proj->ref; - $morehtmlref.='</a>'; - } else { - $morehtmlref.=''; - } - } + $langs->load("projects"); + $morehtmlref.='<br>'.$langs->trans('Project') . ' '; + if ($user->rights->fournisseur->commande->creer) + { + if ($action != 'classify') + $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; + $morehtmlref.='<input type="hidden" name="action" value="classin">'; + $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; + $morehtmlref.='</form>'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; + $morehtmlref.=$proj->ref; + $morehtmlref.='</a>'; + } else { + $morehtmlref.=''; + } + } } $morehtmlref.='</div>'; @@ -1941,24 +1941,24 @@ elseif (! empty($object->id)) print '</td></tr>'; } - // Bank Account + // Bank Account if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled)) { - print '<tr><td class="nowrap">'; - print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; - print $langs->trans('BankAccount'); - print '<td>'; - if ($action != 'editbankaccount' && $user->rights->fournisseur->commande->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td>'; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print '</td>'; - print '</tr>'; + print '<tr><td class="nowrap">'; + print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; + print $langs->trans('BankAccount'); + print '<td>'; + if ($action != 'editbankaccount' && $user->rights->fournisseur->commande->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td>'; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print '</td>'; + print '</tr>'; } // Delivery date planed @@ -1986,7 +1986,7 @@ elseif (! empty($object->id)) if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour'; print $object->date_livraison ? dol_print_date($object->date_livraison, $usehourmin) : ' '; if ($object->hasDelay() && ! empty($object->date_livraison)) { - print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); + print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } print '</td></tr>'; @@ -2001,14 +2001,14 @@ elseif (! empty($object->id)) if (!empty($conf->incoterm->enabled)) { print '<tr><td>'; - print '<table width="100%" class="nobordernopadding"><tr><td>'; - print $langs->trans('IncotermLabel'); - print '<td><td align="right">'; - if ($user->rights->fournisseur->commande->creer) print '<a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; - else print ' '; - print '</td></tr></table>'; - print '</td>'; - print '<td>'; + print '<table width="100%" class="nobordernopadding"><tr><td>'; + print $langs->trans('IncotermLabel'); + print '<td><td align="right">'; + if ($user->rights->fournisseur->commande->creer) print '<a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; + else print ' '; + print '</td></tr></table>'; + print '</td>'; + print '<td>'; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); @@ -2017,7 +2017,7 @@ elseif (! empty($object->id)) { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id); } - print '</td></tr>'; + print '</td></tr>'; } // Other attributes @@ -2034,20 +2034,20 @@ elseif (! empty($object->id)) if (!empty($conf->multicurrency->enabled)) { - // Multicurrency Amount HT - print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount HT + print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount VAT - print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount VAT + print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount TTC - print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount TTC + print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; } // Total @@ -2123,7 +2123,7 @@ elseif (! empty($object->id)) include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } - print '<div class="div-table-responsive-no-min">'; + print '<div class="div-table-responsive-no-min">'; print '<table id="tablelines" class="noborder noshadow" width="100%">'; // Add free products/services form @@ -2153,7 +2153,7 @@ elseif (! empty($object->id)) } } print '</table>'; - print '</div>'; + print '</div>'; print '</form>'; dol_fiche_end(); @@ -2175,8 +2175,8 @@ elseif (! empty($object->id)) // Validate if ($object->statut == 0 && $num > 0) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate))) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate))) { $tmpbuttonlabel=$langs->trans('Validate'); if ($user->rights->fournisseur->commande->approuver && empty($conf->global->SUPPLIER_ORDER_NO_DIRECT_APPROVE)) $tmpbuttonlabel = $langs->trans("ValidateAndApprove"); @@ -2269,24 +2269,24 @@ elseif (! empty($object->id)) // Reopen if (in_array($object->statut, array(2))) { - $buttonshown=0; - if (! $buttonshown && $user->rights->fournisseur->commande->approuver) - { - if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) - || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) && $user->id == $object->user_approve_id)) - { - print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Disapprove").'</a>'; - $buttonshown++; - } - } - if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) - { - if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) - || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2)) - { - print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Disapprove").'</a>'; - } - } + $buttonshown=0; + if (! $buttonshown && $user->rights->fournisseur->commande->approuver) + { + if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) + || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) && $user->id == $object->user_approve_id)) + { + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Disapprove").'</a>'; + $buttonshown++; + } + } + if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)) + { + if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) + || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2)) + { + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Disapprove").'</a>'; + } + } } if (in_array($object->statut, array(3, 4, 5, 6, 7, 9))) { @@ -2310,14 +2310,14 @@ elseif (! empty($object->id)) if ($object->statut == 2) { - if ($user->rights->fournisseur->commande->commander) - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=makeorder#makeorder">'.$langs->trans("MakeOrder").'</a></div>'; - } - else - { - print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("MakeOrder").'</a></div>'; - } + if ($user->rights->fournisseur->commande->commander) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=makeorder#makeorder">'.$langs->trans("MakeOrder").'</a></div>'; + } + else + { + print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("MakeOrder").'</a></div>'; + } } // Create bill @@ -2335,17 +2335,17 @@ elseif (! empty($object->id)) // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved { - if (empty($conf->facture->enabled)) - { - print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>'; - } - else if (!empty($object->linkedObjectsIds['invoice_supplier'])) - { + if (empty($conf->facture->enabled)) + { + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>'; + } + else if (!empty($object->linkedObjectsIds['invoice_supplier'])) + { if ($user->rights->fournisseur->facture->creer) { - print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>'; + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>'; } - } + } } // Create a remote order using WebService only if module is activated @@ -2383,57 +2383,57 @@ elseif (! empty($object->id)) if ($user->rights->fournisseur->commande->commander && $object->statut == 2 && $action == 'makeorder') { - // Set status to ordered (action=commande) - print '<!-- form to record supplier order -->'."\n"; - print '<form name="commande" id="makeorder" action="card.php?id='.$object->id.'&action=commande" method="post">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="commande">'; - print load_fiche_titre($langs->trans("ToOrder"),'',''); - print '<table class="noborder" width="100%">'; - //print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>'; - print '<tr><td>'.$langs->trans("OrderDate").'</td><td>'; - $date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - print $form->select_date($date_com,'',1,1,'',"commande",1,1,1); - print '</td></tr>'; + // Set status to ordered (action=commande) + print '<!-- form to record supplier order -->'."\n"; + print '<form name="commande" id="makeorder" action="card.php?id='.$object->id.'&action=commande" method="post">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="commande">'; + print load_fiche_titre($langs->trans("ToOrder"),'',''); + print '<table class="noborder" width="100%">'; + //print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>'; + print '<tr><td>'.$langs->trans("OrderDate").'</td><td>'; + $date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + print $form->select_date($date_com,'',1,1,'',"commande",1,1,1); + print '</td></tr>'; - print '<tr><td>'.$langs->trans("OrderMode").'</td><td>'; - $formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1); - print '</td></tr>'; + print '<tr><td>'.$langs->trans("OrderMode").'</td><td>'; + $formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1); + print '</td></tr>'; - print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment" value="'.GETPOST('comment').'"></td></tr>'; - print '<tr><td align="center" colspan="2">'; - print '<input type="submit" name="makeorder" class="button" value="'.$langs->trans("ToOrder").'">'; - print '     '; - print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; - print '</td></tr>'; - print '</table>'; - print '</form>'; - print "<br>"; + print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment" value="'.GETPOST('comment').'"></td></tr>'; + print '<tr><td align="center" colspan="2">'; + print '<input type="submit" name="makeorder" class="button" value="'.$langs->trans("ToOrder").'">'; + print '     '; + print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">'; + print '</td></tr>'; + print '</table>'; + print '</form>'; + print "<br>"; } if ($action != 'makeorder') { - print '<div class="fichecenter"><div class="fichehalfleft">'; + print '<div class="fichecenter"><div class="fichehalfleft">'; - /* + /* * Documents generes */ - $comfournref = dol_sanitizeFileName($object->ref); - $file = $conf->fournisseur->dir_output . '/commande/' . $comfournref . '/' . $comfournref . '.pdf'; - $relativepath = $comfournref.'/'.$comfournref.'.pdf'; - $filedir = $conf->fournisseur->dir_output . '/commande/' . $comfournref; - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed=$user->rights->fournisseur->commande->creer; - $delallowed=$user->rights->fournisseur->commande->supprimer; + $comfournref = dol_sanitizeFileName($object->ref); + $file = $conf->fournisseur->dir_output . '/commande/' . $comfournref . '/' . $comfournref . '.pdf'; + $relativepath = $comfournref.'/'.$comfournref.'.pdf'; + $filedir = $conf->fournisseur->dir_output . '/commande/' . $comfournref; + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed=$user->rights->fournisseur->commande->creer; + $delallowed=$user->rights->fournisseur->commande->supprimer; - print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang); - $somethingshown=$formfile->numoffiles; + print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang); + $somethingshown=$formfile->numoffiles; - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_order','order_supplier')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('supplier_order','order_supplier')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '</div><div class="fichehalfright"><div class="ficheaddleft">'; + print '</div><div class="fichehalfright"><div class="ficheaddleft">'; if ($user->rights->fournisseur->commande->receptionner && ($object->statut == 3 || $object->statut == 4)) { @@ -2468,10 +2468,10 @@ elseif (! empty($object->id)) print "<br>"; } - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown = $formactions->showactions($object,'order_supplier',$socid,1,'listaction'.($genallowed?'largetitle':'')); + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown = $formactions->showactions($object,'order_supplier',$socid,1,'listaction'.($genallowed?'largetitle':'')); print '</div></div></div>'; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6241a80aec1..38a3102e602 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -133,9 +133,9 @@ if (empty($reshook)) // Link invoice to order if (GETPOST('linkedOrder') && empty($cancel) && $id > 0) { - $object->fetch($id); - $object->fetch_thirdparty(); - $result = $object->add_object_linked('order_supplier', GETPOST('linkedOrder')); + $object->fetch($id); + $object->fetch_thirdparty(); + $result = $object->add_object_linked('order_supplier', GETPOST('linkedOrder')); } // Action clone object @@ -147,95 +147,95 @@ if (empty($reshook)) // } // else // { - $result=$object->createFromClone($id); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF'].'?action=editref_supplier&id='.$result); - exit; - } - else - { - $langs->load("errors"); - setEventMessages($langs->trans($object->error), null, 'errors'); - $action=''; - } + $result=$object->createFromClone($id); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF'].'?action=editref_supplier&id='.$result); + exit; + } + else + { + $langs->load("errors"); + setEventMessages($langs->trans($object->error), null, 'errors'); + $action=''; + } // } } elseif ($action == 'confirm_valid' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) ) { - $idwarehouse=GETPOST('idwarehouse'); + $idwarehouse=GETPOST('idwarehouse'); - $object->fetch($id); - $object->fetch_thirdparty(); + $object->fetch($id); + $object->fetch_thirdparty(); - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); - } + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } - // Check parameters - if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) - { - $langs->load("stocks"); - if (! $idwarehouse || $idwarehouse == -1) - { - $error++; - setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); - $action=''; - } - } + // Check parameters + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) + { + $langs->load("stocks"); + if (! $idwarehouse || $idwarehouse == -1) + { + $error++; + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); + $action=''; + } + } - if (! $error) - { - $result = $object->validate($user,'',$idwarehouse); - if ($result < 0) - { - setEventMessages($object->error,$object->errors,'errors'); - }else{ - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records + if (! $error) + { + $result = $object->validate($user,'',$idwarehouse); + if ($result < 0) + { + setEventMessages($object->error,$object->errors,'errors'); + }else{ + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records - $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); - } - } - } + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) dol_print_error($db,$result); + } + } + } } elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->facture->supprimer) { - $object->fetch($id); - $object->fetch_thirdparty(); - $result=$object->delete($user); - if ($result > 0) - { - header('Location: list.php'); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->fetch($id); + $object->fetch_thirdparty(); + $result=$object->delete($user); + if ($result > 0) + { + header('Location: list.php'); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } // Remove a product line @@ -273,12 +273,12 @@ if (empty($reshook)) elseif ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) { - $object->fetch($id); - $result=$object->set_paid($user); - if ($result<0) - { - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->fetch($id); + $result=$object->set_paid($user); + if ($result<0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } } // Set supplier ref @@ -291,34 +291,34 @@ if (empty($reshook)) } else { - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) - $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $ret = $object->fetch($object->id); // Reload to get new records - $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) + $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + $ret = $object->fetch($object->id); // Reload to get new records + $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } } } // payments conditions if ($action == 'setconditions' && $user->rights->fournisseur->facture->creer) { - $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); + $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); } // payment mode else if ($action == 'setmode' && $user->rights->fournisseur->facture->creer) { - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); } // Multicurrency Code @@ -333,71 +333,71 @@ if (empty($reshook)) // bank account else if ($action == 'setbankaccount' && $user->rights->fournisseur->facture->creer) { - $result=$object->setBankAccount(GETPOST('fk_account', 'int')); + $result=$object->setBankAccount(GETPOST('fk_account', 'int')); } // Set label elseif ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) { - $object->fetch($id); - $object->label=GETPOST('label'); - $result=$object->update($user); - if ($result < 0) dol_print_error($db); + $object->fetch($id); + $object->label=GETPOST('label'); + $result=$object->update($user); + if ($result < 0) dol_print_error($db); } elseif ($action == 'setdatef' && $user->rights->fournisseur->facture->creer) { - $newdate=dol_mktime(0,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']); - if ($newdate > (dol_now() + (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)?0:$conf->global->INVOICE_MAX_OFFSET_IN_FUTURE))) - { - if (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)) setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); - else setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); - } + $newdate=dol_mktime(0,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']); + if ($newdate > (dol_now() + (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)?0:$conf->global->INVOICE_MAX_OFFSET_IN_FUTURE))) + { + if (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)) setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); + else setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings'); + } - $object->fetch($id); + $object->fetch($id); - $object->date=$newdate; - $date_echence_calc=$object->calculate_date_lim_reglement(); - if (!empty($object->date_echeance) && $object->date_echeance < $date_echence_calc) - { - $object->date_echeance = $date_echence_calc; - } - if ($object->date_echeance && $object->date_echeance < $object->date) - { - $object->date_echeance=$object->date; - } + $object->date=$newdate; + $date_echence_calc=$object->calculate_date_lim_reglement(); + if (!empty($object->date_echeance) && $object->date_echeance < $date_echence_calc) + { + $object->date_echeance = $date_echence_calc; + } + if ($object->date_echeance && $object->date_echeance < $object->date) + { + $object->date_echeance=$object->date; + } - $result=$object->update($user); - if ($result < 0) dol_print_error($db,$object->error); + $result=$object->update($user); + if ($result < 0) dol_print_error($db,$object->error); } elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->facture->creer) { - $object->fetch($id); - $object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']); - if (! empty($object->date_echeance) && $object->date_echeance < $object->date) - { - $object->date_echeance=$object->date; - setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); - } - $result=$object->update($user); - if ($result < 0) dol_print_error($db,$object->error); + $object->fetch($id); + $object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']); + if (! empty($object->date_echeance) && $object->date_echeance < $object->date) + { + $object->date_echeance=$object->date; + setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); + } + $result=$object->update($user); + if ($result < 0) dol_print_error($db,$object->error); } // Delete payment elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); - if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0) - { - $paiementfourn = new PaiementFourn($db); - $result=$paiementfourn->fetch(GETPOST('paiement_id')); - if ($result > 0) { - $result=$paiementfourn->delete(); // If fetch ok and found - header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0) + { + $paiementfourn = new PaiementFourn($db); + $result=$paiementfourn->fetch(GETPOST('paiement_id')); + if ($result > 0) { + $result=$paiementfourn->delete(); // If fetch ok and found + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); } - if ($result < 0) { - setEventMessages($paiementfourn->error, $paiementfourn->errors, 'errors'); - } - } + if ($result < 0) { + setEventMessages($paiementfourn->error, $paiementfourn->errors, 'errors'); + } + } } // Create @@ -460,7 +460,7 @@ if (empty($reshook)) $id = $object->createFromCurrent($user); if ($id <= 0) { - $error++; + $error++; setEventMessages($object->error, $object->errors, 'errors'); } } @@ -555,7 +555,7 @@ if (empty($reshook)) // Defined the new fk_parent_line if ($result > 0 && $line->product_type == 9) { - $fk_parent_line = $result; + $fk_parent_line = $result; } } @@ -816,42 +816,42 @@ if (empty($reshook)) $db->begin(); $object->fetch($id); - $object->fetch_thirdparty(); + $object->fetch_thirdparty(); - $tva_tx = GETPOST('tva_tx'); + $tva_tx = GETPOST('tva_tx'); if (GETPOST('price_ht') != '') - { - $up = price2num(GETPOST('price_ht')); - $price_base_type = 'HT'; - } - else - { - $up = price2num(GETPOST('price_ttc')); - $price_base_type = 'TTC'; - } + { + $up = price2num(GETPOST('price_ht')); + $price_base_type = 'HT'; + } + else + { + $up = price2num(GETPOST('price_ttc')); + $price_base_type = 'TTC'; + } - if (GETPOST('productid')) - { - $prod = new Product($db); - $prod->fetch(GETPOST('productid')); - $label = $prod->description; - if (trim($_POST['product_desc']) != trim($label)) $label=$_POST['product_desc']; + if (GETPOST('productid')) + { + $prod = new Product($db); + $prod->fetch(GETPOST('productid')); + $label = $prod->description; + if (trim($_POST['product_desc']) != trim($label)) $label=$_POST['product_desc']; - $type = $prod->type; - } - else - { - $label = $_POST['product_desc']; - $type = $_POST["type"]?$_POST["type"]:0; - } + $type = $prod->type; + } + else + { + $label = $_POST['product_desc']; + $type = $_POST["type"]?$_POST["type"]:0; + } - $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + $date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - $localtax1_tx= get_localtax($_POST['tauxtva'], 1, $mysoc,$object->thirdparty); - $localtax2_tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty); - $remise_percent=GETPOST('remise_percent'); + $localtax1_tx= get_localtax($_POST['tauxtva'], 1, $mysoc,$object->thirdparty); + $localtax2_tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty); + $remise_percent=GETPOST('remise_percent'); $pu_ht_devise = GETPOST('multicurrency_subprice'); // Extrafields Lines @@ -865,10 +865,10 @@ if (empty($reshook)) } } - $result=$object->updateline(GETPOST('lineid'), $label, $up, $tva_tx, $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('productid'), $price_base_type, 0, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $_POST['units'], $pu_ht_devise); - if ($result >= 0) - { - unset($_POST['label']); + $result=$object->updateline(GETPOST('lineid'), $label, $up, $tva_tx, $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('productid'), $price_base_type, 0, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $_POST['units'], $pu_ht_devise); + if ($result >= 0) + { + unset($_POST['label']); unset($_POST['date_starthour']); unset($_POST['date_startmin']); unset($_POST['date_startsec']); @@ -882,28 +882,28 @@ if (empty($reshook)) unset($_POST['date_endmonth']); unset($_POST['date_endyear']); - $db->commit(); - } - else - { - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - } + $db->commit(); + } + else + { + $db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); + } } elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer) { $db->begin(); - $ret=$object->fetch($id); - if ($ret < 0) - { - dol_print_error($db,$object->error); - exit; - } - $ret=$object->fetch_thirdparty(); + $ret=$object->fetch($id); + if ($ret < 0) + { + dol_print_error($db,$object->error); + exit; + } + $ret=$object->fetch_thirdparty(); - $langs->load('errors'); + $langs->load('errors'); $error=0; // Set if we used free entry or predefined product @@ -930,43 +930,43 @@ if (empty($reshook)) $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); - // Extrafields - $extrafieldsline = new ExtraFields($db); - $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); - $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); - // Unset extrafield - if (is_array($extralabelsline)) { - // Get extra fields - foreach ($extralabelsline as $key => $value) { - unset($_POST["options_" . $key]); - } - } + // Extrafields + $extrafieldsline = new ExtraFields($db); + $extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line); + $array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef); + // Unset extrafield + if (is_array($extralabelsline)) { + // Get extra fields + foreach ($extralabelsline as $key => $value) { + unset($_POST["options_" . $key]); + } + } - if ($prod_entry_mode =='free' && GETPOST('price_ht') < 0 && $qty < 0) - { - setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } - if ($prod_entry_mode =='free' && ! GETPOST('idprodfournprice') && GETPOST('type') < 0) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); - $error++; - } - if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise==='') // Unit price can be 0 but not '' - { - setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); - $error++; - } - if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); - $error++; - } - if (! GETPOST('qty')) - { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); - $error++; - } + if ($prod_entry_mode =='free' && GETPOST('price_ht') < 0 && $qty < 0) + { + setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPrice'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } + if ($prod_entry_mode =='free' && ! GETPOST('idprodfournprice') && GETPOST('type') < 0) + { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); + $error++; + } + if ($prod_entry_mode =='free' && GETPOST('price_ht')==='' && GETPOST('price_ttc')==='' && $price_ht_devise==='') // Unit price can be 0 but not '' + { + setEventMessages($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), null, 'errors'); + $error++; + } + if ($prod_entry_mode =='free' && ! GETPOST('dp_desc')) + { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); + $error++; + } + if (! GETPOST('qty')) + { + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); + $error++; + } if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { @@ -983,11 +983,11 @@ if (empty($reshook)) } if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' - { - $productsupplier=new ProductFournisseur($db); + { + $productsupplier=new ProductFournisseur($db); - $idprod=0; - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) { @@ -997,68 +997,68 @@ if (empty($reshook)) // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist } - elseif (GETPOST('idprodfournprice') > 0) - { - $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. - //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); - $res=$productsupplier->fetch($idprod); - } + elseif (GETPOST('idprodfournprice') > 0) + { + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); + } - //Replaces $fk_unit with the product's - if ($idprod > 0) - { - $label = $productsupplier->label; + //Replaces $fk_unit with the product's + if ($idprod > 0) + { + $label = $productsupplier->label; - $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + $desc = $productsupplier->description; + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); - $tva_tx=get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); - $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); + $tva_tx=get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); + $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, $_POST['idprodfournprice']); if (empty($tva_tx)) $tva_npr=0; - $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); - $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); + $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); + $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); - $type = $productsupplier->type; - $price_base_type = 'HT'; + $type = $productsupplier->type; + $price_base_type = 'HT'; - // TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first) - $result=$object->addline( - $desc, - $productsupplier->fourn_pu, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $qty, - $idprod, - $remise_percent, - $date_start, - $date_end, - 0, - $tva_npr, - $price_base_type, - $type, - -1, - 0, - $array_options, - $productsupplier->fk_unit - ); - } - if ($idprod == -99 || $idprod == 0) - { - // Product not selected - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); - } - if ($idprod == -1) - { - // Quantity too low - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); - } - } + // TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first) + $result=$object->addline( + $desc, + $productsupplier->fourn_pu, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $qty, + $idprod, + $remise_percent, + $date_start, + $date_end, + 0, + $tva_npr, + $price_base_type, + $type, + -1, + 0, + $array_options, + $productsupplier->fk_unit + ); + } + if ($idprod == -99 || $idprod == 0) + { + // Product not selected + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); + } + if ($idprod == -1) + { + // Quantity too low + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); + } + } else if (empty($error)) // $price_ht is already set { $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); @@ -1069,11 +1069,11 @@ if (empty($reshook)) $fk_unit= GETPOST('units', 'alpha'); - $tva_tx = price2num($tva_tx); // When vat is text input field + $tva_tx = price2num($tva_tx); // When vat is text input field - // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1,$mysoc,$object->thirdparty); - $localtax2_tx= get_localtax($tva_tx, 2,$mysoc,$object->thirdparty); + // Local Taxes + $localtax1_tx= get_localtax($tva_tx, 1,$mysoc,$object->thirdparty); + $localtax2_tx= get_localtax($tva_tx, 2,$mysoc,$object->thirdparty); if ($price_ht !== '') { @@ -1088,135 +1088,135 @@ if (empty($reshook)) $pu_ht_devise = price2num($price_ht_devise, 'MU'); $result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise); - } + } - //print "xx".$tva_tx; exit; - if (! $error && $result > 0) - { - $db->commit(); + //print "xx".$tva_tx; exit; + if (! $error && $result > 0) + { + $db->commit(); - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records - $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); - } + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) dol_print_error($db,$result); + } unset($_POST ['prod_entry_mode']); - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['remise_percent']); - unset($_POST['pu']); - unset($_POST['price_ht']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['remise_percent']); + unset($_POST['pu']); + unset($_POST['price_ht']); unset($_POST['multicurrency_price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['label']); - unset($localtax1_tx); - unset($localtax2_tx); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['label']); + unset($localtax1_tx); + unset($localtax2_tx); unset($_POST['np_marginRate']); unset($_POST['np_markRate']); - unset($_POST['dp_desc']); + unset($_POST['dp_desc']); unset($_POST['idprodfournprice']); - unset($_POST['units']); + unset($_POST['units']); - unset($_POST['date_starthour']); - unset($_POST['date_startmin']); - unset($_POST['date_startsec']); - unset($_POST['date_startday']); - unset($_POST['date_startmonth']); - unset($_POST['date_startyear']); - unset($_POST['date_endhour']); - unset($_POST['date_endmin']); - unset($_POST['date_endsec']); - unset($_POST['date_endday']); - unset($_POST['date_endmonth']); - unset($_POST['date_endyear']); - } - else + unset($_POST['date_starthour']); + unset($_POST['date_startmin']); + unset($_POST['date_startsec']); + unset($_POST['date_startday']); + unset($_POST['date_startmonth']); + unset($_POST['date_startyear']); + unset($_POST['date_endhour']); + unset($_POST['date_endmin']); + unset($_POST['date_endsec']); + unset($_POST['date_endday']); + unset($_POST['date_endmonth']); + unset($_POST['date_endyear']); + } + else { - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - } + $db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); + } - $action = ''; + $action = ''; } elseif ($action == 'classin' && $user->rights->fournisseur->facture->creer) { - $object->fetch($id); - $result=$object->setProject($projectid); + $object->fetch($id); + $result=$object->setProject($projectid); } // Set invoice to draft status elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer) { - $object->fetch($id); + $object->fetch($id); - $totalpaye = $object->getSommePaiement(); - $resteapayer = $object->total_ttc - $totalpaye; + $totalpaye = $object->getSommePaiement(); + $resteapayer = $object->total_ttc - $totalpaye; - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees - //$ventilExportCompta = $object->getVentilExportCompta(); + // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + //$ventilExportCompta = $object->getVentilExportCompta(); - // On verifie si aucun paiement n'a ete effectue - if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) - { - $object->set_draft($user); + // On verifie si aucun paiement n'a ete effectue + if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) + { + $object->set_draft($user); - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records - $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); - } + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) dol_print_error($db,$result); + } - $action=''; - } + $action=''; + } } // Set invoice to validated/unpaid status elseif ($action == 'reopen' && $user->rights->fournisseur->facture->creer) { - $result = $object->fetch($id); - if ($object->statut == FactureFournisseur::STATUS_CLOSED - || ($object->statut == FactureFournisseur::STATUS_ABANDONED && $object->close_code != 'replaced')) - { - $result = $object->set_unpaid($user); - if ($result > 0) - { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } - else - { - setEventMessages($object->error, $object->errors, 'errors'); - } - } + $result = $object->fetch($id); + if ($object->statut == FactureFournisseur::STATUS_CLOSED + || ($object->statut == FactureFournisseur::STATUS_ABANDONED && $object->close_code != 'replaced')) + { + $result = $object->set_unpaid($user); + if ($result > 0) + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } + } } // Actions when printing a doc from card @@ -1239,14 +1239,14 @@ if (empty($reshook)) { $calculationrule=GETPOST('calculationrule'); - $object->fetch($id); - $object->fetch_thirdparty(); + $object->fetch($id); + $object->fetch_thirdparty(); $result=$object->update_price(0, (($calculationrule=='totalofround')?'0':'1'), 0, $object->thirdparty); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } } if ($action == 'update_extras') { @@ -1371,9 +1371,9 @@ if ($action == 'create') $facturestatic = new FactureFournisseur($db); $extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element); - print load_fiche_titre($langs->trans('NewBill')); + print load_fiche_titre($langs->trans('NewBill')); - dol_htmloutput_events(); + dol_htmloutput_events(); $currency_code = $conf->currency; @@ -1385,49 +1385,49 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) $currency_code = $societe->multicurrency_code; } - if (! empty($origin) && ! empty($originid)) - { - // Parse element/subelement (ex: project_task) - $element = $subelement = $origin; + if (! empty($origin) && ! empty($originid)) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $origin; - if ($element == 'project') - { - $projectid = $originid; - $element = 'projet'; - } - else if (in_array($element,array('order_supplier'))) - { - // For compatibility - if ($element == 'order') { - $element = $subelement = 'commande'; - } - if ($element == 'propal') { - $element = 'comm/propal'; $subelement = 'propal'; - } - if ($element == 'contract') { - $element = $subelement = 'contrat'; - } - if ($element == 'order_supplier') { - $element = 'fourn'; $subelement = 'fournisseur.commande'; - } + if ($element == 'project') + { + $projectid = $originid; + $element = 'projet'; + } + else if (in_array($element,array('order_supplier'))) + { + // For compatibility + if ($element == 'order') { + $element = $subelement = 'commande'; + } + if ($element == 'propal') { + $element = 'comm/propal'; $subelement = 'propal'; + } + if ($element == 'contract') { + $element = $subelement = 'contrat'; + } + if ($element == 'order_supplier') { + $element = 'fourn'; $subelement = 'fournisseur.commande'; + } - require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'; - $classname = ucfirst($subelement); - if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur'; - $objectsrc = new $classname($db); - $objectsrc->fetch($originid); - $objectsrc->fetch_thirdparty(); + require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'; + $classname = ucfirst($subelement); + if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur'; + $objectsrc = new $classname($db); + $objectsrc->fetch($originid); + $objectsrc->fetch_thirdparty(); - $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); - //$ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:''); + $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); + //$ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:''); - $soc = $objectsrc->thirdparty; - $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_supplier_id)?$soc->cond_reglement_supplier_id:1)); - $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_supplier_id)?$soc->mode_reglement_supplier_id:0)); - $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); - $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); - $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; + $soc = $objectsrc->thirdparty; + $cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_supplier_id)?$soc->cond_reglement_supplier_id:1)); + $mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_supplier_id)?$soc->mode_reglement_supplier_id:0)); + $fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0)); + $remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0)); + $remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0)); + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; if (!empty($conf->multicurrency->enabled)) { @@ -1435,56 +1435,56 @@ if ($action == 'create') if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } - $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); - $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp); - $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); - $datedue=($datetmp==''?-1:$datetmp); - } - } - else - { + $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); + $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp); + $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); + $datedue=($datetmp==''?-1:$datetmp); + } + } + else + { $cond_reglement_id = $societe->cond_reglement_supplier_id; $mode_reglement_id = $societe->mode_reglement_supplier_id; - $fk_account = $societe->fk_account; - $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); - $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp); - $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); - $datedue=($datetmp==''?-1:$datetmp); + $fk_account = $societe->fk_account; + $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); + $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp); + $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); + $datedue=($datetmp==''?-1:$datetmp); if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; - } + } - print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">'; - print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; - print '<input type="hidden" name="action" value="add">'; - if ($societe->id > 0) print '<input type="hidden" name="socid" value="' . $societe->id . '">' . "\n"; - print '<input type="hidden" name="origin" value="'.$origin.'">'; - print '<input type="hidden" name="originid" value="'.$originid.'">'; + print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="action" value="add">'; + if ($societe->id > 0) print '<input type="hidden" name="socid" value="' . $societe->id . '">' . "\n"; + print '<input type="hidden" name="origin" value="'.$origin.'">'; + print '<input type="hidden" name="originid" value="'.$originid.'">'; if (!empty($currency_tx)) print '<input type="hidden" name="originmulticurrency_tx" value="' . $currency_tx . '">'; - dol_fiche_head(); + dol_fiche_head(); - print '<table class="border" width="100%">'; + print '<table class="border" width="100%">'; - // Ref - print '<tr><td class="titlefieldcreate">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>'; + // Ref + print '<tr><td class="titlefieldcreate">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>'; - // Third party - print '<tr><td class="fieldrequired">'.$langs->trans('Supplier').'</td>'; - print '<td>'; + // Third party + print '<tr><td class="fieldrequired">'.$langs->trans('Supplier').'</td>'; + print '<td>'; - if ($societe->id > 0) - { - print $societe->getNomUrl(1); - print '<input type="hidden" name="socid" value="'.$societe->id.'">'; - } - else - { - print $form->select_company($societe->id, 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - // reload page to retrieve supplier informations - if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) - { - print '<script type="text/javascript"> + if ($societe->id > 0) + { + print $societe->getNomUrl(1); + print '<input type="hidden" name="socid" value="'.$societe->id.'">'; + } + else + { + print $form->select_company($societe->id, 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + // reload page to retrieve supplier informations + if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) + { + print '<script type="text/javascript"> $(document).ready(function() { $("#socid").change(function() { var socid = $(this).val(); @@ -1493,16 +1493,16 @@ if ($action == 'create') }); }); </script>'; - } - print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; - } - print '</td></tr>'; + } + print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>'; + } + print '</td></tr>'; - // Ref supplier - print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.(isset($_POST['ref_supplier'])?$_POST['ref_supplier']:'').'" type="text"></td>'; - print '</tr>'; + // Ref supplier + print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.(isset($_POST['ref_supplier'])?$_POST['ref_supplier']:'').'" type="text"></td>'; + print '</tr>'; - // Type invoice + // Type invoice $facids = $facturestatic->list_replacable_supplier_invoices($societe->id); if ($facids < 0) { dol_print_error($db, $facturestatic); @@ -1640,19 +1640,19 @@ if ($action == 'create') if (empty($origin)) { - if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Need to fix reports of standard accounting module to manage supplier credit note - { - if ($societe->id > 0) - { - // Credit note - if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) - { - print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; - $tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : ''); - if (! $optionsav) $tmp.=' disabled'; - $tmp.= '> '; - // Show credit note options only if we checked credit note - print '<script type="text/javascript" language="javascript"> + if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Need to fix reports of standard accounting module to manage supplier credit note + { + if ($societe->id > 0) + { + // Credit note + if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) + { + print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; + $tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : ''); + if (! $optionsav) $tmp.=' disabled'; + $tmp.= '> '; + // Show credit note options only if we checked credit note + print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { if (! jQuery("#radio_creditnote").is(":checked")) { @@ -1666,41 +1666,41 @@ if ($action == 'create') }); }); </script>'; - $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; - // $text.='<input type="text" value="">'; - $text .= '<select class="flat valignmiddle" name="fac_avoir" id="fac_avoir"'; - if (! $optionsav) - $text .= ' disabled'; - $text .= '>'; - if ($optionsav) { - $text .= '<option value="-1"></option>'; - $text .= $optionsav; - } else { - $text .= '<option value="-1">' . $langs->trans("NoInvoiceToCorrect") . '</option>'; - } - $text .= '</select>'; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); - print $desc; + $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; + // $text.='<input type="text" value="">'; + $text .= '<select class="flat valignmiddle" name="fac_avoir" id="fac_avoir"'; + if (! $optionsav) + $text .= ' disabled'; + $text .= '>'; + if ($optionsav) { + $text .= '<option value="-1"></option>'; + $text .= $optionsav; + } else { + $text .= '<option value="-1">' . $langs->trans("NoInvoiceToCorrect") . '</option>'; + } + $text .= '</select>'; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + print $desc; - print '<div id="credit_note_options" class="clearboth">'; - print '    <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; - print '<br>    <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; - print '</div>'; + print '<div id="credit_note_options" class="clearboth">'; + print '    <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; + print '<br>    <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; + print '</div>'; - print '</div></div>'; - } - } - else - { - print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; - $tmp='<input type="radio" name="type" id="radio_creditnote" value="0" disabled> '; - $text = $tmp.$langs->trans("InvoiceAvoir") . ' '; - $text.= '('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").') '; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); - print $desc; - print '</div></div>' . "\n"; - } - } + print '</div></div>'; + } + } + else + { + print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">'; + $tmp='<input type="radio" name="type" id="radio_creditnote" value="0" disabled> '; + $text = $tmp.$langs->trans("InvoiceAvoir") . ' '; + $text.= '('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + print $desc; + print '</div></div>' . "\n"; + } + } } print '</div>'; @@ -1727,18 +1727,18 @@ if ($action == 'create') print '</td></tr>'; } - // Label - print '<tr><td>'.$langs->trans('Label').'</td><td><input class="minwidth200" name="label" value="'.dol_escape_htmltag(GETPOST('label')).'" type="text"></td></tr>'; + // Label + print '<tr><td>'.$langs->trans('Label').'</td><td><input class="minwidth200" name="label" value="'.dol_escape_htmltag(GETPOST('label')).'" type="text"></td></tr>'; - // Date invoice - print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td>'; - $form->select_date($dateinvoice,'','','','',"add",1,1); - print '</td></tr>'; + // Date invoice + print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td>'; + $form->select_date($dateinvoice,'','','','',"add",1,1); + print '</td></tr>'; - // Due date - print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>'; - $form->select_date($datedue,'ech','','','',"add",1,1); - print '</td></tr>'; + // Due date + print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>'; + $form->select_date($datedue,'ech','','','',"add",1,1); + print '</td></tr>'; // Payment term print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>'; @@ -1750,18 +1750,18 @@ if ($action == 'create') $form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id, 'mode_reglement_id', 'DBIT'); print '</td></tr>'; - // Bank Account - print '<tr><td>'.$langs->trans('BankAccount').'</td><td>'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; + // Bank Account + print '<tr><td>'.$langs->trans('BankAccount').'</td><td>'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; // Multicurrency if (! empty($conf->multicurrency->enabled)) { print '<tr>'; print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>'; - print '<td class="maxwidthonsmartphone">'; - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print '<td class="maxwidthonsmartphone">'; + print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '</td></tr>'; } @@ -1781,73 +1781,73 @@ if ($action == 'create') { print '<tr>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1).'</label></td>'; - print '<td colspan="3" class="maxwidthonsmartphone">'; - print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms)?$objectsrc->location_incoterms:'')); + print '<td colspan="3" class="maxwidthonsmartphone">'; + print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms)?$objectsrc->location_incoterms:'')); print '</td></tr>'; } // Public note print '<tr><td>'.$langs->trans('NotePublic').'</td>'; - print '<td>'; - $note_public = $object->getDefaultCreateValueFor('note_public'); - $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); - print $doleditor->Create(1); - print '</td>'; + print '<td>'; + $note_public = $object->getDefaultCreateValueFor('note_public'); + $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + print $doleditor->Create(1); + print '</td>'; // print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>'; - print '</tr>'; + print '</tr>'; - // Private note - print '<tr><td>'.$langs->trans('NotePrivate').'</td>'; - print '<td>'; - $note_private = $object->getDefaultCreateValueFor('note_private'); - $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); - print $doleditor->Create(1); - print '</td>'; - // print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>'; - print '</tr>'; + // Private note + print '<tr><td>'.$langs->trans('NotePrivate').'</td>'; + print '<td>'; + $note_private = $object->getDefaultCreateValueFor('note_private'); + $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + print $doleditor->Create(1); + print '</td>'; + // print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>'; + print '</tr>'; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } - if (is_object($objectsrc)) - { - print "\n<!-- ".$classname." info -->"; - print "\n"; - print '<input type="hidden" name="amount" value="'.$objectsrc->total_ht.'">'."\n"; - print '<input type="hidden" name="total" value="'.$objectsrc->total_ttc.'">'."\n"; - print '<input type="hidden" name="tva" value="'.$objectsrc->total_tva.'">'."\n"; - print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">'; - print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; + if (is_object($objectsrc)) + { + print "\n<!-- ".$classname." info -->"; + print "\n"; + print '<input type="hidden" name="amount" value="'.$objectsrc->total_ht.'">'."\n"; + print '<input type="hidden" name="total" value="'.$objectsrc->total_ttc.'">'."\n"; + print '<input type="hidden" name="tva" value="'.$objectsrc->total_tva.'">'."\n"; + print '<input type="hidden" name="origin" value="'.$objectsrc->element.'">'; + print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">'; - $txt=$langs->trans($classname); - if ($classname=='CommandeFournisseur') { - $langs->load('orders'); - $txt=$langs->trans("SupplierOrder"); - } - print '<tr><td>'.$txt.'</td><td>'.$objectsrc->getNomUrl(1); - // We check if Origin document (id and type is known) has already at least one invoice attached to it - $objectsrc->fetchObjectLinked($originid,$origin,'','invoice_supplier'); - $cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']); - if ($cntinvoice>=1) - { - setEventMessages('WarningBillExist', null, 'warnings'); - echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['invoice_supplier'])->getNomUrl(1).')'; - } - echo '</td></tr>'; - print '<tr><td>'.$langs->trans('TotalHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>'; - print '<tr><td>'.$langs->trans('TotalVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>"; - if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1 - { - print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>"; - } + $txt=$langs->trans($classname); + if ($classname=='CommandeFournisseur') { + $langs->load('orders'); + $txt=$langs->trans("SupplierOrder"); + } + print '<tr><td>'.$txt.'</td><td>'.$objectsrc->getNomUrl(1); + // We check if Origin document (id and type is known) has already at least one invoice attached to it + $objectsrc->fetchObjectLinked($originid,$origin,'','invoice_supplier'); + $cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']); + if ($cntinvoice>=1) + { + setEventMessages('WarningBillExist', null, 'warnings'); + echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['invoice_supplier'])->getNomUrl(1).')'; + } + echo '</td></tr>'; + print '<tr><td>'.$langs->trans('TotalHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>'; + print '<tr><td>'.$langs->trans('TotalVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>"; + if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1 + { + print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>"; + } - if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2 - { - print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>"; - } - print '<tr><td>'.$langs->trans('TotalTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>"; + if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2 + { + print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>"; + } + print '<tr><td>'.$langs->trans('TotalTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>"; if (!empty($conf->multicurrency->enabled)) { @@ -1855,168 +1855,168 @@ if ($action == 'create') print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>"; print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>"; } - } + } - // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + // Other options + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; - // Bouton "Create Draft" - print "</table>\n"; + // Bouton "Create Draft" + print "</table>\n"; - dol_fiche_end(); + dol_fiche_end(); - print '<div class="center">'; - print '<input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'">'; + print '<div class="center">'; + print '<input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'">'; print '     '; print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">'; - print '</div>'; + print '</div>'; - print "</form>\n"; + print "</form>\n"; - // Show origin lines - if (is_object($objectsrc)) - { - print '<br>'; + // Show origin lines + if (is_object($objectsrc)) + { + print '<br>'; - $title=$langs->trans('ProductsAndServices'); - print load_fiche_titre($title); + $title=$langs->trans('ProductsAndServices'); + print load_fiche_titre($title); - print '<table class="noborder" width="100%">'; + print '<table class="noborder" width="100%">'; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList(); - print '</table>'; - } + print '</table>'; + } } else { - if ($id > 0 || ! empty($ref)) - { - /* *************************************************************************** */ - /* */ - /* Fiche en mode visu ou edition */ - /* */ - /* *************************************************************************** */ + if ($id > 0 || ! empty($ref)) + { + /* *************************************************************************** */ + /* */ + /* Fiche en mode visu ou edition */ + /* */ + /* *************************************************************************** */ - $now=dol_now(); + $now=dol_now(); - $productstatic = new Product($db); + $productstatic = new Product($db); - $object->fetch($id,$ref); - $result=$object->fetch_thirdparty(); - if ($result < 0) dol_print_error($db); + $object->fetch($id,$ref); + $result=$object->fetch_thirdparty(); + if ($result < 0) dol_print_error($db); - $societe = new Fournisseur($db); - $result=$societe->fetch($object->socid); - if ($result < 0) dol_print_error($db); + $societe = new Fournisseur($db); + $result=$societe->fetch($object->socid); + if ($result < 0) dol_print_error($db); - // fetch optionals attributes and labels + // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $alreadypaid=$object->getSommePaiement(); - /* + /* * View card */ - $head = facturefourn_prepare_head($object); - $titre=$langs->trans('SupplierInvoice'); + $head = facturefourn_prepare_head($object); + $titre=$langs->trans('SupplierInvoice'); - dol_fiche_head($head, 'card', $titre, -1, 'bill'); + dol_fiche_head($head, 'card', $titre, -1, 'bill'); - // Clone confirmation - if ($action == 'clone') - { - // Create an array for form - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) - ); - // Paiement incomplet. On demande si motif = escompte ou autre + // Clone confirmation + if ($action == 'clone') + { + // Create an array for form + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) + ); + // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1); - } + } - // Confirmation de la validation - if ($action == 'valid') - { + // Confirmation de la validation + if ($action == 'valid') + { // on verifie si l'objet est en numerotation provisoire - $objectref = substr($object->ref, 1, 4); - if ($objectref == 'PROV') - { - $savdate=$object->date; - $numref = $object->getNextNumRef($societe); - } - else - { - $numref = $object->ref; - } + $objectref = substr($object->ref, 1, 4); + if ($objectref == 'PROV') + { + $savdate=$object->date; + $numref = $object->getNextNumRef($societe); + } + else + { + $numref = $object->ref; + } - $text=$langs->trans('ConfirmValidateBill',$numref); - /*if (! empty($conf->notification->enabled)) + $text=$langs->trans('ConfirmValidateBill',$numref); + /*if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); $text.='<br>'; $text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid, $object); }*/ - $formquestion=array(); + $formquestion=array(); - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); - } + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } - if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) - { - $langs->load("stocks"); - require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; - $formproduct=new FormProduct($db); - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); - } + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) + { + $langs->load("stocks"); + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct=new FormProduct($db); + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); + } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); - } + } - // Confirmation set paid - if ($action == 'paid') - { + // Confirmation set paid + if ($action == 'paid') + { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); - } + } - // Confirmation de la suppression de la facture fournisseur - if ($action == 'delete') - { + // Confirmation de la suppression de la facture fournisseur + if ($action == 'delete') + { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); - } - if ($action == 'deletepaiement') - { - $payment_id = GETPOST('paiement_id'); + } + if ($action == 'deletepaiement') + { + $payment_id = GETPOST('paiement_id'); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1); - } + } - // Confirmation to delete line + // Confirmation to delete line if ($action == 'ask_deleteline') { $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); } - if (!$formconfirm) - { + if (!$formconfirm) + { $parameters=array('lineid'=>$lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; @@ -2215,9 +2215,9 @@ else print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { - if($action == 'actualizemulticurrencyrate') { - list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); - } + if($action == 'actualizemulticurrencyrate') { + list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); + } $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); @@ -2230,35 +2230,35 @@ else print '</td></tr>'; } - // Bank Account - print '<tr><td class="nowrap">'; - print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; - print $langs->trans('BankAccount'); - print '<td>'; - if ($action != 'editbankaccount' && $user->rights->fournisseur->facture->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td colspan="3">'; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print "</td>"; - print '</tr>'; + // Bank Account + print '<tr><td class="nowrap">'; + print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; + print $langs->trans('BankAccount'); + print '<td>'; + if ($action != 'editbankaccount' && $user->rights->fournisseur->facture->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td colspan="3">'; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print "</td>"; + print '</tr>'; // Incoterms if (!empty($conf->incoterm->enabled)) { print '<tr><td>'; - print '<table width="100%" class="nobordernopadding"><tr><td>'; - print $langs->trans('IncotermLabel'); - print '<td><td align="right">'; - if ($user->rights->fournisseur->facture->creer) print '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; - else print ' '; - print '</td></tr></table>'; - print '</td>'; - print '<td colspan="3">'; + print '<table width="100%" class="nobordernopadding"><tr><td>'; + print $langs->trans('IncotermLabel'); + print '<td><td align="right">'; + if ($user->rights->fournisseur->facture->creer) print '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; + else print ' '; + print '</td></tr></table>'; + print '</td>'; + print '<td colspan="3">'; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); @@ -2267,142 +2267,142 @@ else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id); } - print '</td></tr>'; + print '</td></tr>'; } - // Other attributes - $cols = 2; - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - print '</table>'; + print '</table>'; - print '</div>'; - print '<div class="fichehalfright">'; - print '<div class="ficheaddleft">'; - print '<div class="underbanner clearboth"></div>'; + print '</div>'; + print '<div class="fichehalfright">'; + print '<div class="ficheaddleft">'; + print '<div class="underbanner clearboth"></div>'; - print '<table class="border centpercent">'; + print '<table class="border centpercent">'; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) + if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { - // Multicurrency Amount HT - print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; - print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount HT + print '<tr><td class="titlefieldmiddle">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>'; + print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount VAT - print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; - print '<td>' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; + // Multicurrency Amount VAT + print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>'; + print '<td>' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; - // Multicurrency Amount TTC - print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; - print '<td>' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; - print '</tr>'; - } + // Multicurrency Amount TTC + print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>'; + print '<td>' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>'; + print '</tr>'; + } - // Amount - print '<tr><td class="titlefield">'.$langs->trans('AmountHT').'</td><td>'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>'; - print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'<div class="inline-block">         '; - if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha'); - else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); - if ($calculationrule == 'totalofround') $calculationrulenum=1; - else $calculationrulenum=2; - $s=$langs->trans("ReCalculate").' '; - $s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>'; - $s.=' / '; - $s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>'; - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); - print '</div></td></tr>'; + // Amount + print '<tr><td class="titlefield">'.$langs->trans('AmountHT').'</td><td>'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>'; + print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'<div class="inline-block">         '; + if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha'); + else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); + if ($calculationrule == 'totalofround') $calculationrulenum=1; + else $calculationrulenum=2; + $s=$langs->trans("ReCalculate").' '; + $s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>'; + $s.=' / '; + $s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>'; + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); + print '</div></td></tr>'; - // Amount Local Taxes - //TODO: Place into a function to control showing by country or study better option - if ($societe->localtax1_assuj=="1") //Localtax1 - { - print '<tr><td>'.$langs->transcountry("AmountLT1",$societe->country_code).'</td>'; - print '<td>'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>'; - print '</tr>'; - } - if ($societe->localtax2_assuj=="1") //Localtax2 - { - print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>'; - print '<td>'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>'; - print '</tr>'; - } - print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>'; + // Amount Local Taxes + //TODO: Place into a function to control showing by country or study better option + if ($societe->localtax1_assuj=="1") //Localtax1 + { + print '<tr><td>'.$langs->transcountry("AmountLT1",$societe->country_code).'</td>'; + print '<td>'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>'; + print '</tr>'; + } + if ($societe->localtax2_assuj=="1") //Localtax2 + { + print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>'; + print '<td>'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>'; + print '</tr>'; + } + print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>'; - print '</table>'; + print '</table>'; - /* + /* * List of payments */ - $totalpaye = 0; + $totalpaye = 0; $sign = 1; if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = - 1; $nbrows=9; $nbcols=3; - if (! empty($conf->projet->enabled)) $nbrows++; - if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } - if (! empty($conf->incoterm->enabled)) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; + if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } + if (! empty($conf->incoterm->enabled)) $nbrows++; if (! empty($conf->multicurrency->enabled)) $nbrows += 5; - // Local taxes - if ($societe->localtax1_assuj=="1") $nbrows++; - if ($societe->localtax2_assuj=="1") $nbrows++; + // Local taxes + if ($societe->localtax1_assuj=="1") $nbrows++; + if ($societe->localtax2_assuj=="1") $nbrows++; - $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; - $sql.= ' c.id as paiement_type,'; - $sql.= ' pf.amount,'; - $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (' . getEntity('c_paiement').')'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid'; - $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; - $sql.= ' ORDER BY p.datep, p.tms'; + $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; + $sql.= ' c.id as paiement_type,'; + $sql.= ' pf.amount,'; + $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (' . getEntity('c_paiement').')'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid'; + $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; + $sql.= ' ORDER BY p.datep, p.tms'; - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - print '<table class="noborder paymenttable" width="100%">'; - print '<tr class="liste_titre">'; - print '<td class="liste_titre">' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>'; - print '<td>'.$langs->trans('Date').'</td>'; - print '<td>'.$langs->trans('Type').'</td>'; - if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>'; - print '<td align="right">'.$langs->trans('Amount').'</td>'; - print '<td width="18"> </td>'; - print '</tr>'; + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + print '<table class="noborder paymenttable" width="100%">'; + print '<tr class="liste_titre">'; + print '<td class="liste_titre">' . ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')) . '</td>'; + print '<td>'.$langs->trans('Date').'</td>'; + print '<td>'.$langs->trans('Type').'</td>'; + if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>'; + print '<td align="right">'.$langs->trans('Amount').'</td>'; + print '<td width="18"> </td>'; + print '</tr>'; - $var=false; - if ($num > 0) - { - while ($i < $num) - { - $objp = $db->fetch_object($result); + $var=false; + if ($num > 0) + { + while ($i < $num) + { + $objp = $db->fetch_object($result); - print '<tr class="oddeven"><td>'; - $paymentstatic->id=$objp->rowid; - $paymentstatic->datepaye=$db->jdate($objp->dp); - $paymentstatic->ref=($objp->ref ? $objp->ref : $objp->rowid);; - $paymentstatic->num_paiement=$objp->num_paiement; - $paymentstatic->payment_code=$objp->payment_code; - print $paymentstatic->getNomUrl(1); - print '</td>'; - print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>'; - print '<td>'; - print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement; - print '</td>'; - if (! empty($conf->banque->enabled)) - { - $bankaccountstatic->id=$objp->baid; - $bankaccountstatic->ref=$objp->baref; - $bankaccountstatic->label=$objp->baref; + print '<tr class="oddeven"><td>'; + $paymentstatic->id=$objp->rowid; + $paymentstatic->datepaye=$db->jdate($objp->dp); + $paymentstatic->ref=($objp->ref ? $objp->ref : $objp->rowid);; + $paymentstatic->num_paiement=$objp->num_paiement; + $paymentstatic->payment_code=$objp->payment_code; + print $paymentstatic->getNomUrl(1); + print '</td>'; + print '<td>'.dol_print_date($db->jdate($objp->dp), 'day') . '</td>'; + print '<td>'; + print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement; + print '</td>'; + if (! empty($conf->banque->enabled)) + { + $bankaccountstatic->id=$objp->baid; + $bankaccountstatic->ref=$objp->baref; + $bankaccountstatic->label=$objp->baref; $bankaccountstatic->number = $objp->banumber; if (! empty($conf->accounting->enabled)) { @@ -2413,28 +2413,28 @@ else $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); } - print '<td align="right">'; - if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions'); - print '</td>'; - } - print '<td align="right">' . price($sign * $objp->amount) . '</td>'; - print '<td align="center">'; - if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) - { - print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">'; - print img_delete(); - print '</a>'; - } - print '</td>'; - print '</tr>'; - $totalpaye += $objp->amount; - $i++; - } - } - else - { - print '<tr class="oddeven"><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td></tr>'; - } + print '<td align="right">'; + if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions'); + print '</td>'; + } + print '<td align="right">' . price($sign * $objp->amount) . '</td>'; + print '<td align="center">'; + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) + { + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">'; + print img_delete(); + print '</a>'; + } + print '</td>'; + print '</tr>'; + $totalpaye += $objp->amount; + $i++; + } + } + else + { + print '<tr class="oddeven"><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td></tr>'; + } /* if ($object->paye == 0) @@ -2449,12 +2449,12 @@ else } */ - $db->free($result); - } - else - { - dol_print_error($db); - } + $db->free($result); + } + else + { + dol_print_error($db); + } if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE) { @@ -2466,7 +2466,7 @@ else print $langs->trans('AlreadyPaid'); print ' :</td><td align="right"'.(($totalpaye > 0)?' class="amountalreadypaid"':'').'>' . price($totalpaye) . '</td><td> </td></tr>'; - $resteapayer = $object->total_ttc - $totalpaye; + $resteapayer = $object->total_ttc - $totalpaye; $resteapayeraffiche = $resteapayer; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; @@ -2585,29 +2585,29 @@ else print '</table>'; - print '</div>'; - print '</div>'; - print '</div>'; + print '</div>'; + print '</div>'; + print '</div>'; - print '<div class="clearboth"></div><br>'; + print '<div class="clearboth"></div><br>'; - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - $blocname = 'contacts'; - $title = $langs->trans('ContactsAddresses'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $blocname = 'contacts'; + $title = $langs->trans('ContactsAddresses'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } - if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $colwidth=20; - $blocname = 'notes'; - $title = $langs->trans('Notes'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $colwidth=20; + $blocname = 'notes'; + $title = $langs->trans('Notes'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } - /* + /* * Lines */ print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline')?'#add':'#line_'.GETPOST('lineid')).'" method="POST">'; @@ -2621,7 +2621,7 @@ else include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } - print '<div class="div-table-responsive-no-min">'; + print '<div class="div-table-responsive-no-min">'; print '<table id="tablelines" class="noborder noshadow" width="100%">'; global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; @@ -2634,7 +2634,7 @@ else $num=count($object->lines); // Form to add new line - if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer) + if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer) { if ($action != 'editline') { @@ -2646,76 +2646,76 @@ else $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } - } + } - print '</table>'; - print '</div>'; - print '</form>'; + print '</table>'; + print '</div>'; + print '</form>'; - dol_fiche_end(); + dol_fiche_end(); - if ($action != 'presend') - { - /* + if ($action != 'presend') + { + /* * Boutons actions */ - print '<div class="tabsAction">'; + print '<div class="tabsAction">'; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + // modified by hook if (empty($reshook)) { - // Modify a validated invoice with no payments + // Modify a validated invoice with no payments if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) { print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a></div>'; } // Reopen a standard paid invoice - if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) - { - if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>'; - } - else - { - if ($user->rights->fournisseur->facture->creer) { - print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span></div>'; - } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - print '<div class="inline-block divButAction"><span class="butActionRefused">'.$langs->trans('ReOpen').'</span></div>'; - } - } - } + if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) + { + if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>'; + } + else + { + if ($user->rights->fournisseur->facture->creer) { + print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span></div>'; + } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { + print '<div class="inline-block divButAction"><span class="butActionRefused">'.$langs->trans('ReOpen').'</span></div>'; + } + } + } - // Send by mail - if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendByMail').'</a></div>'; - } - else print '<div class="inline-block divButAction"><span class="butActionRefused">'.$langs->trans('SendByMail').'</a></div>'; - } + // Send by mail + if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendByMail').'</a></div>'; + } + else print '<div class="inline-block divButAction"><span class="butActionRefused">'.$langs->trans('SendByMail').'</a></div>'; + } - // Make payments - if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) - { - print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create'.($object->fk_account>0?'&accountid='.$object->fk_account:'').'">'.$langs->trans('DoPayment').'</a></div>'; // must use facid because id is for payment id not invoice - } + // Make payments + if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) + { + print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create'.($object->fk_account>0?'&accountid='.$object->fk_account:'').'">'.$langs->trans('DoPayment').'</a></div>'; // must use facid because id is for payment id not invoice + } - // Classify paid - if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid"'; - print '>'.$langs->trans('ClassifyPaid').'</a></div>'; + // Classify paid + if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid"'; + print '>'.$langs->trans('ClassifyPaid').'</a></div>'; - //print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a>'; - } + //print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a>'; + } // Reverse back money or convert to reduction if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) { @@ -2743,24 +2743,24 @@ else } } - // Validate - if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT) - { - if (count($object->lines)) - { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"'; - print '>'.$langs->trans('Validate').'</a></div>'; - } - else - { - print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"'; - print '>'.$langs->trans('Validate').'</a></div>'; - } - } - } + // Validate + if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT) + { + if (count($object->lines)) + { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid"'; + print '>'.$langs->trans('Validate').'</a></div>'; + } + else + { + print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"'; + print '>'.$langs->trans('Validate').'</a></div>'; + } + } + } // Create event if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. @@ -2768,11 +2768,11 @@ else print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>'; } - // Clone - if ($action != 'edit' && $user->rights->fournisseur->facture->creer) - { - print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&socid='.$object->socid.'">'.$langs->trans('ToClone').'</a></div>'; - } + // Clone + if ($action != 'edit' && $user->rights->fournisseur->facture->creer) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=clone&socid='.$object->socid.'">'.$langs->trans('ToClone').'</a></div>'; + } // Create a credit note if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->statut > 0 && $user->rights->fournisseur->facture->creer) @@ -2783,67 +2783,67 @@ else } } - // Delete - if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer) - { - if ($object->getSommePaiement()) { - print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>'; - } else { - print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>'; - } - } - print '</div>'; + // Delete + if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer) + { + if ($object->getSommePaiement()) { + print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>'; + } else { + print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>'; + } + } + print '</div>'; - if ($action != 'edit') - { + if ($action != 'edit') + { print '<div class="fichecenter"><div class="fichehalfleft">'; /* * Documents generes */ - $ref=dol_sanitizeFileName($object->ref); - $subdir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref; - $filedir = $conf->fournisseur->facture->dir_output.'/'.$subdir; - $urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id; - $genallowed=$user->rights->fournisseur->facture->creer; - $delallowed=$user->rights->fournisseur->facture->supprimer; - $modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF)); + $ref=dol_sanitizeFileName($object->ref); + $subdir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref; + $filedir = $conf->fournisseur->facture->dir_output.'/'.$subdir; + $urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id; + $genallowed=$user->rights->fournisseur->facture->creer; + $delallowed=$user->rights->fournisseur->facture->supprimer; + $modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF)); - print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang); - $somethingshown=$formfile->numoffiles; + print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang); + $somethingshown=$formfile->numoffiles; - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '</div><div class="fichehalfright"><div class="ficheaddleft">'; - //print '</td><td valign="top" width="50%">'; - //print '<br>'; + print '</div><div class="fichehalfright"><div class="ficheaddleft">'; + //print '</td><td valign="top" width="50%">'; + //print '<br>'; - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown = $formactions->showactions($object,'invoice_supplier',$socid,1,'listaction'.($genallowed?'largetitle':'')); + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown = $formactions->showactions($object,'invoice_supplier',$socid,1,'listaction'.($genallowed?'largetitle':'')); print '</div></div></div>'; - //print '</td></tr></table>'; - } + //print '</td></tr></table>'; + } } - } + } - // Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } - // Presend form - $modelmail='supplier_order_send'; - $defaulttopic='SendBillRef'; - $diroutput = $conf->fournisseur->facture->dir_output; - $trackid = 'sin'.$object->id; + // Presend form + $modelmail='supplier_order_send'; + $defaulttopic='SendBillRef'; + $diroutput = $conf->fournisseur->facture->dir_output; + $trackid = 'sin'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; - } + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + } } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 973a7b95567..c19faf054ea 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -38,34 +38,34 @@ $micro_start_time=0; if (! empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { - list($usec, $sec) = explode(" ", microtime()); - $micro_start_time=((float) $usec + (float) $sec); - // Add Xdebug code coverage - //define('XDEBUGCOVERAGE',1); - if (defined('XDEBUGCOVERAGE')) { - xdebug_start_code_coverage(); - } + list($usec, $sec) = explode(" ", microtime()); + $micro_start_time=((float) $usec + (float) $sec); + // Add Xdebug code coverage + //define('XDEBUGCOVERAGE',1); + if (defined('XDEBUGCOVERAGE')) { + xdebug_start_code_coverage(); + } } // Removed magic_quotes if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP 5.0 and removed in PHP 5.5 { - if (get_magic_quotes_gpc()) - { - // Forcing parameter setting magic_quotes_gpc and cleaning parameters - // (Otherwise he would have for each position, condition - // Reading stripslashes variable according to state get_magic_quotes_gpc). - // Off mode recommended (just do $db->escape for insert / update). - function stripslashes_deep($value) - { - return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value)); - } - $_GET = array_map('stripslashes_deep', $_GET); - $_POST = array_map('stripslashes_deep', $_POST); - $_FILES = array_map('stripslashes_deep', $_FILES); - //$_COOKIE = array_map('stripslashes_deep', $_COOKIE); // Useless because a cookie should never be outputed on screen nor used into sql - @set_magic_quotes_runtime(0); - } + if (get_magic_quotes_gpc()) + { + // Forcing parameter setting magic_quotes_gpc and cleaning parameters + // (Otherwise he would have for each position, condition + // Reading stripslashes variable according to state get_magic_quotes_gpc). + // Off mode recommended (just do $db->escape for insert / update). + function stripslashes_deep($value) + { + return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value)); + } + $_GET = array_map('stripslashes_deep', $_GET); + $_POST = array_map('stripslashes_deep', $_POST); + $_FILES = array_map('stripslashes_deep', $_FILES); + //$_COOKIE = array_map('stripslashes_deep', $_COOKIE); // Useless because a cookie should never be outputed on screen nor used into sql + @set_magic_quotes_runtime(0); + } } /** @@ -77,44 +77,44 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP */ function test_sql_and_script_inject($val, $type) { - $inj = 0; - // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) - if ($type != 2) - { - $inj += preg_match('/delete\s+from/i', $val); - $inj += preg_match('/create\s+table/i', $val); - $inj += preg_match('/update.+set.+=/i', $val); - $inj += preg_match('/insert\s+into/i', $val); - $inj += preg_match('/select.+from/i', $val); - $inj += preg_match('/union.+select/i', $val); - $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); - $inj += preg_match('/(\.\.%2f)+/i', $val); - } - // For XSS Injection done by adding javascript with script - // This is all cases a browser consider text is javascript: - // When it found '<script', 'javascript:', '<style', 'onload\s=' on body tag, '="&' on a tag size with old browsers - // All examples on page: http://ha.ckers.org/xss.html#XSScalc + $inj = 0; + // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) + if ($type != 2) + { + $inj += preg_match('/delete\s+from/i', $val); + $inj += preg_match('/create\s+table/i', $val); + $inj += preg_match('/update.+set.+=/i', $val); + $inj += preg_match('/insert\s+into/i', $val); + $inj += preg_match('/select.+from/i', $val); + $inj += preg_match('/union.+select/i', $val); + $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); + $inj += preg_match('/(\.\.%2f)+/i', $val); + } + // For XSS Injection done by adding javascript with script + // This is all cases a browser consider text is javascript: + // When it found '<script', 'javascript:', '<style', 'onload\s=' on body tag, '="&' on a tag size with old browsers + // All examples on page: http://ha.ckers.org/xss.html#XSScalc // More on https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet - $inj += preg_match('/<script/i', $val); + $inj += preg_match('/<script/i', $val); $inj += preg_match('/<iframe/i', $val); $inj += preg_match('/Set\.constructor/i', $val); // ECMA script 6 - if (! defined('NOSTYLECHECK')) $inj += preg_match('/<style/i', $val); - $inj += preg_match('/base[\s]+href/si', $val); - $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> - $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> - $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)> - $inj += preg_match('/onload\s*=/i', $val); // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)> - //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ... + if (! defined('NOSTYLECHECK')) $inj += preg_match('/<style/i', $val); + $inj += preg_match('/base[\s]+href/si', $val); + $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> + $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> + $inj += preg_match('/onfocus\s*=/i', $val); // onfocus can be set on input text html tag like <input type='text' value='...' onfocus = alert(1)> + $inj += preg_match('/onload\s*=/i', $val); // onload can be set on svg tag <svg/onload=alert(1)> or other tag like body <body onload=alert(1)> + //$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ... $inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...' - //if ($type == 1) - //{ - $inj += preg_match('/javascript:/i', $val); - $inj += preg_match('/vbscript:/i', $val); - //} - // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param) - if ($type == 1) $inj += preg_match('/"/i', $val); // We refused " in GET parameters value - if ($type == 2) $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. - return $inj; + //if ($type == 1) + //{ + $inj += preg_match('/javascript:/i', $val); + $inj += preg_match('/vbscript:/i', $val); + //} + // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param) + if ($type == 1) $inj += preg_match('/"/i', $val); // We refused " in GET parameters value + if ($type == 2) $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. + return $inj; } /** @@ -126,26 +126,26 @@ function test_sql_and_script_inject($val, $type) */ function analyseVarsForSqlAndScriptsInjection(&$var, $type) { - if (is_array($var)) - { - foreach ($var as $key => $value) - { - if (analyseVarsForSqlAndScriptsInjection($value,$type)) - { - $var[$key] = $value; - } - else + if (is_array($var)) + { + foreach ($var as $key => $value) + { + if (analyseVarsForSqlAndScriptsInjection($value,$type)) { - print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')'; - exit; - } - } - return true; - } - else - { - return (test_sql_and_script_inject($var,$type) <= 0); - } + $var[$key] = $value; + } + else + { + print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')'; + exit; + } + } + return true; + } + else + { + return (test_sql_and_script_inject($var,$type) <= 0); + } } @@ -155,14 +155,14 @@ if ((defined('NOREQUIREDB') || defined('NOREQUIRETRAN')) && ! defined('NOREQUIRE // Sanity check on URL if (! empty($_SERVER["PHP_SELF"])) { - $morevaltochecklikepost=array($_SERVER["PHP_SELF"]); - analyseVarsForSqlAndScriptsInjection($morevaltochecklikepost,2); + $morevaltochecklikepost=array($_SERVER["PHP_SELF"]); + analyseVarsForSqlAndScriptsInjection($morevaltochecklikepost,2); } // Sanity check on GET parameters if (! defined('NOSCANGETFORINJECTION') && ! empty($_SERVER["QUERY_STRING"])) { - $morevaltochecklikeget=array($_SERVER["QUERY_STRING"]); - analyseVarsForSqlAndScriptsInjection($morevaltochecklikeget,1); + $morevaltochecklikeget=array($_SERVER["QUERY_STRING"]); + analyseVarsForSqlAndScriptsInjection($morevaltochecklikeget,1); } // Sanity check on POST if (! defined('NOSCANPOSTFORINJECTION')) @@ -211,14 +211,14 @@ session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on s // We need this lock as long as we read/write $_SESSION ['vars']. We can close released when finished. if (! defined('NOSESSION')) { - session_start(); - if (ini_get('register_globals')) // Deprecated in 5.3 and removed in 5.4. To solve bug in using $_SESSION - { - foreach ($_SESSION as $key=>$value) - { - if (isset($GLOBALS[$key])) unset($GLOBALS[$key]); - } - } + session_start(); + if (ini_get('register_globals')) // Deprecated in 5.3 and removed in 5.4. To solve bug in using $_SESSION + { + foreach ($_SESSION as $key=>$value) + { + if (isset($GLOBALS[$key])) unset($GLOBALS[$key]); + } + } } // Init the 5 global objects, this include will make the new and set properties for: $conf, $db, $langs, $user, $mysoc @@ -230,54 +230,54 @@ register_shutdown_function('dol_shutdown'); // Detection browser if (isset($_SERVER["HTTP_USER_AGENT"])) { - $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); - $conf->browser->name=$tmp['browsername']; - $conf->browser->os=$tmp['browseros']; - $conf->browser->version=$tmp['browserversion']; - $conf->browser->layout=$tmp['layout']; // 'classic', 'phone', 'tablet' - $conf->browser->phone=$tmp['phone']; // TODO deprecated, use ->layout - $conf->browser->tablet=$tmp['tablet']; // TODO deprecated, use ->layout - //var_dump($conf->browser); + $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); + $conf->browser->name=$tmp['browsername']; + $conf->browser->os=$tmp['browseros']; + $conf->browser->version=$tmp['browserversion']; + $conf->browser->layout=$tmp['layout']; // 'classic', 'phone', 'tablet' + $conf->browser->phone=$tmp['phone']; // TODO deprecated, use ->layout + $conf->browser->tablet=$tmp['tablet']; // TODO deprecated, use ->layout + //var_dump($conf->browser); - if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover=1; - if ($conf->browser->layout == 'phone') $conf->global->MAIN_TESTMENUHIDER=1; + if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover=1; + if ($conf->browser->layout == 'phone') $conf->global->MAIN_TESTMENUHIDER=1; } // Force HTTPS if required ($conf->file->main_force_https is 0/1 or https dolibarr root url) // $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off' if (! empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on')) { - $newurl=''; - if (is_numeric($conf->file->main_force_https)) - { - if ($conf->file->main_force_https == '1' && ! empty($_SERVER["SCRIPT_URI"])) // If SCRIPT_URI supported by server - { - if (preg_match('/^http:/i',$_SERVER["SCRIPT_URI"]) && ! preg_match('/^https:/i',$_SERVER["SCRIPT_URI"])) // If link is http - { - $newurl=preg_replace('/^http:/i','https:',$_SERVER["SCRIPT_URI"]); - } - } - else // Check HTTPS environment variable (Apache/mod_ssl only) - { - $newurl=preg_replace('/^http:/i','https:',DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]; - } - } - else - { - // Check HTTPS environment variable (Apache/mod_ssl only) - $newurl=$conf->file->main_force_https.$_SERVER["REQUEST_URI"]; - } - // Start redirect - if ($newurl) - { - dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl); - header("Location: ".$newurl); - exit; - } - else - { - dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING); - } + $newurl=''; + if (is_numeric($conf->file->main_force_https)) + { + if ($conf->file->main_force_https == '1' && ! empty($_SERVER["SCRIPT_URI"])) // If SCRIPT_URI supported by server + { + if (preg_match('/^http:/i',$_SERVER["SCRIPT_URI"]) && ! preg_match('/^https:/i',$_SERVER["SCRIPT_URI"])) // If link is http + { + $newurl=preg_replace('/^http:/i','https:',$_SERVER["SCRIPT_URI"]); + } + } + else // Check HTTPS environment variable (Apache/mod_ssl only) + { + $newurl=preg_replace('/^http:/i','https:',DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]; + } + } + else + { + // Check HTTPS environment variable (Apache/mod_ssl only) + $newurl=$conf->file->main_force_https.$_SERVER["REQUEST_URI"]; + } + // Start redirect + if ($newurl) + { + dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl); + header("Location: ".$newurl); + exit; + } + else + { + dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING); + } } @@ -288,74 +288,74 @@ if (! defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) require_once DOL_D // If install or upgrade process not done or not completely finished, we call the install page. if (! empty($conf->global->MAIN_NOT_INSTALLED) || ! empty($conf->global->MAIN_NOT_UPGRADED)) { - dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING); - header("Location: ".DOL_URL_ROOT."/install/index.php"); - exit; + dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING); + header("Location: ".DOL_URL_ROOT."/install/index.php"); + exit; } // If an upgrade process is required, we call the install page. if ((! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION)) || (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ! empty($conf->global->MAIN_VERSION_LAST_INSTALL) && ($conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) { - $versiontocompare=empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE; - require_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php'; - $dolibarrversionlastupgrade=preg_split('/[.-]/',$versiontocompare); - $dolibarrversionprogram=preg_split('/[.-]/',DOL_VERSION); - $rescomp=versioncompare($dolibarrversionprogram,$dolibarrversionlastupgrade); - if ($rescomp > 0) // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades - { - dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING); - header("Location: ".DOL_URL_ROOT."/install/index.php"); - exit; - } + $versiontocompare=empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE; + require_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php'; + $dolibarrversionlastupgrade=preg_split('/[.-]/',$versiontocompare); + $dolibarrversionprogram=preg_split('/[.-]/',DOL_VERSION); + $rescomp=versioncompare($dolibarrversionprogram,$dolibarrversionlastupgrade); + if ($rescomp > 0) // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades + { + dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING); + header("Location: ".DOL_URL_ROOT."/install/index.php"); + exit; + } } // Creation of a token against CSRF vulnerabilities if (! defined('NOTOKENRENEWAL')) { - // roulement des jetons car cree a chaque appel - if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; + // roulement des jetons car cree a chaque appel + if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; - // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] - $token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number - $_SESSION['newtoken'] = $token; + // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] + $token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number + $_SESSION['newtoken'] = $token; } if (! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) // Check validity of token, only if option enabled (this option breaks some features sometimes) { - if ($_SERVER['REQUEST_METHOD'] == 'POST' && ! GETPOST('token','alpha')) // Note, offender can still send request by GET - { - print "Access refused by CSRF protection in main.inc.php. Token not provided.\n"; - print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file).\n"; - die; - } - if ($_SERVER['REQUEST_METHOD'] === 'POST') // This test must be after loading $_SESSION['token']. - { - if (GETPOST('token', 'alpha') != $_SESSION['token']) - { - dol_syslog("Invalid token in ".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action','aZ09').", _POST['token']=".GETPOST('token','alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); - //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. - unset($_POST); - } - } + if ($_SERVER['REQUEST_METHOD'] == 'POST' && ! GETPOST('token','alpha')) // Note, offender can still send request by GET + { + print "Access refused by CSRF protection in main.inc.php. Token not provided.\n"; + print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file).\n"; + die; + } + if ($_SERVER['REQUEST_METHOD'] === 'POST') // This test must be after loading $_SESSION['token']. + { + if (GETPOST('token', 'alpha') != $_SESSION['token']) + { + dol_syslog("Invalid token in ".$_SERVER['HTTP_REFERER'].", action=".GETPOST('action','aZ09').", _POST['token']=".GETPOST('token','alpha').", _SESSION['token']=".$_SESSION['token'], LOG_WARNING); + //print 'Unset POST by CSRF protection in main.inc.php.'; // Do not output anything because this create problems when using the BACK button on browsers. + unset($_POST); + } + } } // Disable modules (this must be after session_start and after conf has been loaded) if (GETPOST('disablemodules','alpha')) $_SESSION["disablemodules"]=GETPOST('disablemodules','alpha'); if (! empty($_SESSION["disablemodules"])) { - $disabled_modules=explode(',',$_SESSION["disablemodules"]); - foreach($disabled_modules as $module) - { - if ($module) - { - if (empty($conf->$module)) $conf->$module=new stdClass(); - $conf->$module->enabled=false; - if ($module == 'fournisseur') // Special case - { - $conf->supplier_order->enabled=0; - $conf->supplier_invoice->enabled=0; - } - } - } + $disabled_modules=explode(',',$_SESSION["disablemodules"]); + foreach($disabled_modules as $module) + { + if ($module) + { + if (empty($conf->$module)) $conf->$module=new stdClass(); + $conf->$module->enabled=false; + if ($module == 'fournisseur') // Special case + { + $conf->supplier_order->enabled=0; + $conf->supplier_invoice->enabled=0; + } + } + } } @@ -365,433 +365,433 @@ if (! empty($_SESSION["disablemodules"])) $login=''; if (! defined('NOLOGIN')) { - // $authmode lists the different means of identification to be tested in order of preference. - // Example: 'http', 'dolibarr', 'ldap', 'http,forceuser' + // $authmode lists the different means of identification to be tested in order of preference. + // Example: 'http', 'dolibarr', 'ldap', 'http,forceuser' - // Authentication mode - if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication='http,dolibarr'; - // Authentication mode: forceuser - if ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) $dolibarr_auto_user='auto'; - // Set authmode - $authmode=explode(',',$dolibarr_main_authentication); + // Authentication mode + if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication='http,dolibarr'; + // Authentication mode: forceuser + if ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) $dolibarr_auto_user='auto'; + // Set authmode + $authmode=explode(',',$dolibarr_main_authentication); - // No authentication mode - if (! count($authmode)) - { - $langs->load('main'); - dol_print_error('',$langs->trans("ErrorConfigParameterNotDefined",'dolibarr_main_authentication')); - exit; - } + // No authentication mode + if (! count($authmode)) + { + $langs->load('main'); + dol_print_error('',$langs->trans("ErrorConfigParameterNotDefined",'dolibarr_main_authentication')); + exit; + } - // If login request was already post, we retrieve login from the session - // Call module if not realized that his request. - // At the end of this phase, the variable $login is defined. - $resultFetchUser=''; - $test=true; - if (! isset($_SESSION["dol_login"])) - { - // It is not already authenticated and it requests the login / password - include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + // If login request was already post, we retrieve login from the session + // Call module if not realized that his request. + // At the end of this phase, the variable $login is defined. + $resultFetchUser=''; + $test=true; + if (! isset($_SESSION["dol_login"])) + { + // It is not already authenticated and it requests the login / password + include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $dol_dst_observed=GETPOST("dst_observed",'int',3); - $dol_dst_first=GETPOST("dst_first",'int',3); - $dol_dst_second=GETPOST("dst_second",'int',3); - $dol_screenwidth=GETPOST("screenwidth",'int',3); - $dol_screenheight=GETPOST("screenheight",'int',3); - $dol_hide_topmenu=GETPOST('dol_hide_topmenu','int',3); - $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu','int',3); - $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen','int',3); - $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover','int',3); - $dol_use_jmobile=GETPOST('dol_use_jmobile','int',3); - //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); + $dol_dst_observed=GETPOST("dst_observed",'int',3); + $dol_dst_first=GETPOST("dst_first",'int',3); + $dol_dst_second=GETPOST("dst_second",'int',3); + $dol_screenwidth=GETPOST("screenwidth",'int',3); + $dol_screenheight=GETPOST("screenheight",'int',3); + $dol_hide_topmenu=GETPOST('dol_hide_topmenu','int',3); + $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu','int',3); + $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen','int',3); + $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover','int',3); + $dol_use_jmobile=GETPOST('dol_use_jmobile','int',3); + //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); - // If in demo mode, we check we go to home page through the public/demo/index.php page - if (! empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') // We ask index page - { - if (empty($_SERVER['HTTP_REFERER']) || ! preg_match('/public/',$_SERVER['HTTP_REFERER'])) - { - dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")"); - $url=''; - $url.=($url?'&':'').($dol_hide_topmenu?'dol_hide_topmenu='.$dol_hide_topmenu:''); - $url.=($url?'&':'').($dol_hide_leftmenu?'dol_hide_leftmenu='.$dol_hide_leftmenu:''); - $url.=($url?'&':'').($dol_optimize_smallscreen?'dol_optimize_smallscreen='.$dol_optimize_smallscreen:''); - $url.=($url?'&':'').($dol_no_mouse_hover?'dol_no_mouse_hover='.$dol_no_mouse_hover:''); - $url.=($url?'&':'').($dol_use_jmobile?'dol_use_jmobile='.$dol_use_jmobile:''); - $url=DOL_URL_ROOT.'/public/demo/index.php'.($url?'?'.$url:''); - header("Location: ".$url); - exit; - } - } + // If in demo mode, we check we go to home page through the public/demo/index.php page + if (! empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') // We ask index page + { + if (empty($_SERVER['HTTP_REFERER']) || ! preg_match('/public/',$_SERVER['HTTP_REFERER'])) + { + dol_syslog("Call index page from another url than demo page (call is done from page ".$_SERVER['HTTP_REFERER'].")"); + $url=''; + $url.=($url?'&':'').($dol_hide_topmenu?'dol_hide_topmenu='.$dol_hide_topmenu:''); + $url.=($url?'&':'').($dol_hide_leftmenu?'dol_hide_leftmenu='.$dol_hide_leftmenu:''); + $url.=($url?'&':'').($dol_optimize_smallscreen?'dol_optimize_smallscreen='.$dol_optimize_smallscreen:''); + $url.=($url?'&':'').($dol_no_mouse_hover?'dol_no_mouse_hover='.$dol_no_mouse_hover:''); + $url.=($url?'&':'').($dol_use_jmobile?'dol_use_jmobile='.$dol_use_jmobile:''); + $url=DOL_URL_ROOT.'/public/demo/index.php'.($url?'?'.$url:''); + header("Location: ".$url); + exit; + } + } - // Verification security graphic code - if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) - { - $sessionkey = 'dol_antispam_value'; - $ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); + // Verification security graphic code + if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) + { + $sessionkey = 'dol_antispam_value'; + $ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); - // Check code - if (! $ok) - { - dol_syslog('Bad value for code, connexion refused'); - $langs->load('main'); - $langs->load('errors'); + // Check code + if (! $ok) + { + dol_syslog('Bad value for code, connexion refused'); + $langs->load('main'); + $langs->load('errors'); - $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); - $test=false; + $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); + $test=false; - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); - // Call of triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); - if ($result < 0) { - $error++; - } - // End Call of triggers + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg='ErrorBadValueForCode - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End Call of triggers - // Hooks on failed login - $action=''; - $hookmanager->initHooks(array('login')); - $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); - $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; + // Hooks on failed login + $action=''; + $hookmanager->initHooks(array('login')); + $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); + $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; - // Note: exit is done later - } - } + // Note: exit is done later + } + } - $usertotest = (! empty($_COOKIE['login_dolibarr']) ? $_COOKIE['login_dolibarr'] : GETPOST("username","alpha",2)); - $passwordtotest = GETPOST('password','none',2); - $entitytotest = (GETPOST('entity','int') ? GETPOST('entity','int') : (!empty($conf->entity) ? $conf->entity : 1)); + $usertotest = (! empty($_COOKIE['login_dolibarr']) ? $_COOKIE['login_dolibarr'] : GETPOST("username","alpha",2)); + $passwordtotest = GETPOST('password','none',2); + $entitytotest = (GETPOST('entity','int') ? GETPOST('entity','int') : (!empty($conf->entity) ? $conf->entity : 1)); - // Define if we received data to test the login. - $goontestloop=false; - if (isset($_SERVER["REMOTE_USER"]) && in_array('http',$authmode)) $goontestloop=true; - if ($dolibarr_main_authentication == 'forceuser' && ! empty($dolibarr_auto_user)) $goontestloop=true; - if (GETPOST("username","alpha",2) || ! empty($_COOKIE['login_dolibarr']) || GETPOST('openid_mode','alpha',1)) $goontestloop=true; + // Define if we received data to test the login. + $goontestloop=false; + if (isset($_SERVER["REMOTE_USER"]) && in_array('http',$authmode)) $goontestloop=true; + if ($dolibarr_main_authentication == 'forceuser' && ! empty($dolibarr_auto_user)) $goontestloop=true; + if (GETPOST("username","alpha",2) || ! empty($_COOKIE['login_dolibarr']) || GETPOST('openid_mode','alpha',1)) $goontestloop=true; - if (! is_object($langs)) // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. - { - include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; - $langs=new Translate("",$conf); - $langcode=(GETPOST('lang','aZ09',1)?GETPOST('lang','aZ09',1):(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT)); - $langs->setDefaultLang($langcode); - } + if (! is_object($langs)) // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages. + { + include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; + $langs=new Translate("",$conf); + $langcode=(GETPOST('lang','aZ09',1)?GETPOST('lang','aZ09',1):(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT)); + $langs->setDefaultLang($langcode); + } - // Validation of login/pass/entity - // If ok, the variable login will be returned - // If error, we will put error message in session under the name dol_loginmesg - if ($test && $goontestloop) - { - $login = checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmode); - if ($login) - { - $dol_authmode=$conf->authmode; // This properties is defined only when logged, to say what mode was successfully used - $dol_tz=$_POST["tz"]; - $dol_tz_string=$_POST["tz_string"]; - $dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string); - $dol_tz_string=preg_replace('/,/','/',$dol_tz_string); - $dol_tz_string=preg_replace('/\s/','_',$dol_tz_string); - $dol_dst=0; - if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $datenow=dol_now(); - $datefirst=dol_stringtotime($_POST["dst_first"]); - $datesecond=dol_stringtotime($_POST["dst_second"]); - if ($datenow >= $datefirst && $datenow < $datesecond) $dol_dst=1; - } - //print $datefirst.'-'.$datesecond.'-'.$datenow.'-'.$dol_tz.'-'.$dol_tzstring.'-'.$dol_dst; exit; - } + // Validation of login/pass/entity + // If ok, the variable login will be returned + // If error, we will put error message in session under the name dol_loginmesg + if ($test && $goontestloop) + { + $login = checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmode); + if ($login) + { + $dol_authmode=$conf->authmode; // This properties is defined only when logged, to say what mode was successfully used + $dol_tz=$_POST["tz"]; + $dol_tz_string=$_POST["tz_string"]; + $dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string); + $dol_tz_string=preg_replace('/,/','/',$dol_tz_string); + $dol_tz_string=preg_replace('/\s/','_',$dol_tz_string); + $dol_dst=0; + if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $datenow=dol_now(); + $datefirst=dol_stringtotime($_POST["dst_first"]); + $datesecond=dol_stringtotime($_POST["dst_second"]); + if ($datenow >= $datefirst && $datenow < $datesecond) $dol_dst=1; + } + //print $datefirst.'-'.$datesecond.'-'.$datenow.'-'.$dol_tz.'-'.$dol_tzstring.'-'.$dol_dst; exit; + } - if (! $login) - { - dol_syslog('Bad password, connexion refused',LOG_DEBUG); - $langs->load('main'); - $langs->load('errors'); + if (! $login) + { + dol_syslog('Bad password, connexion refused',LOG_DEBUG); + $langs->load('main'); + $langs->load('errors'); - // Bad password. No authmode has found a good password. - // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions - if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); + // Bad password. No authmode has found a good password. + // We set a generic message if not defined inside function checkLoginPassEntity or subfunctions + if (empty($_SESSION["dol_loginmesg"])) $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); - // Call of triggers - include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2)); - if ($result < 0) { - $error++; - } - // End Call of triggers + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.GETPOST("username","alpha",2); + // Call of triggers + include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST("username","alpha",2)); + if ($result < 0) { + $error++; + } + // End Call of triggers - // Hooks on failed login - $action=''; - $hookmanager->initHooks(array('login')); - $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); - $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; + // Hooks on failed login + $action=''; + $hookmanager->initHooks(array('login')); + $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); + $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; - // Note: exit is done in next chapter - } - } + // Note: exit is done in next chapter + } + } - // End test login / passwords - if (! $login || (in_array('ldap',$authmode) && empty($passwordtotest))) // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success. - { - // No data to test login, so we show the login page + // End test login / passwords + if (! $login || (in_array('ldap',$authmode) && empty($passwordtotest))) // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success. + { + // No data to test login, so we show the login page dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." showing the login form and exit"); if (defined('NOREDIRECTBYMAINTOLOGIN')) return 'ERROR_NOT_LOGGED'; - else dol_loginfunction($langs,$conf,(! empty($mysoc)?$mysoc:'')); - exit; - } + else dol_loginfunction($langs,$conf,(! empty($mysoc)?$mysoc:'')); + exit; + } - $resultFetchUser=$user->fetch('', $login, '', 1, ($entitytotest > 0 ? $entitytotest : -1)); - if ($resultFetchUser <= 0) - { - dol_syslog('User not found, connexion refused'); - session_destroy(); - session_name($sessionname); - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie - session_start(); // Fixing the bug of register_globals here is useless since session is empty - - if ($resultFetchUser == 0) - { - $langs->load('main'); - $langs->load('errors'); - - $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); - - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; - } - if ($resultFetchUser < 0) - { - $_SESSION["dol_loginmesg"]=$user->error; - - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg=$user->error; - } - - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); - if ($result < 0) { - $error++; - } - // End call triggers - - // Hooks on failed login - $action=''; - $hookmanager->initHooks(array('login')); - $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); - $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; - - $paramsurl=array(); - if (GETPOST('textbrowser','int')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); - if (GETPOST('nojs','int')) $paramsurl[]='nojs='.GETPOST('nojs','int'); - if (GETPOST('lang','aZ09')) $paramsurl[]='lang='.GETPOST('lang','aZ09'); - header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):'')); - exit; - } - } - else - { - // We are already into an authenticated session - $login=$_SESSION["dol_login"]; - $entity=$_SESSION["dol_entity"]; - dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG); - - $resultFetchUser=$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1)); - if ($resultFetchUser <= 0) - { - // Account has been removed after login - dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING); - session_destroy(); - session_name($sessionname); - session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie - session_start(); // Fixing the bug of register_globals here is useless since session is empty - - if ($resultFetchUser == 0) - { - $langs->load('main'); - $langs->load('errors'); - - $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); - - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; - } - if ($resultFetchUser < 0) - { - $_SESSION["dol_loginmesg"]=$user->error; - - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg=$user->error; - } - - // TODO @deprecated Remove this. Hook must be used, not this trigger. - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); - if ($result < 0) { - $error++; - } - // End call triggers - - // Hooks on failed login - $action=''; - $hookmanager->initHooks(array('login')); - $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); - $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; - - $paramsurl=array(); - if (GETPOST('textbrowser','int')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); - if (GETPOST('nojs','int')) $paramsurl[]='nojs='.GETPOST('nojs','int'); - if (GETPOST('lang','aZ09')) $paramsurl[]='lang='.GETPOST('lang','aZ09'); - header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):'')); - exit; - } - else + $resultFetchUser=$user->fetch('', $login, '', 1, ($entitytotest > 0 ? $entitytotest : -1)); + if ($resultFetchUser <= 0) { - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context - $hookmanager->initHooks(array('main')); + dol_syslog('User not found, connexion refused'); + session_destroy(); + session_name($sessionname); + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie + session_start(); // Fixing the bug of register_globals here is useless since session is empty - // Code for search criteria persistence. - if (! empty($_GET['save_lastsearch_values'])) // Keep $_GET here - { - $relativepathstring = preg_replace('/\?.*$/','',$_SERVER["HTTP_REFERER"]); - $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/','',$relativepathstring); // Get full path except host server - // Clean $relativepathstring - if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); - $relativepathstring = preg_replace('/^\//', '', $relativepathstring); - $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); - //var_dump($relativepathstring); + if ($resultFetchUser == 0) + { + $langs->load('main'); + $langs->load('errors'); - if (! empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring])) - { - $_SESSION['lastsearch_values_'.$relativepathstring]=$_SESSION['lastsearch_values_tmp_'.$relativepathstring]; - unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]); - } - } + $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); - $action = ''; - $reshook = $hookmanager->executeHooks('updateSession', array(), $user, $action); - if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } - } - } + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; + } + if ($resultFetchUser < 0) + { + $_SESSION["dol_loginmesg"]=$user->error; - // Is it a new session that has started ? - // If we are here, this means authentication was successfull. - if (! isset($_SESSION["dol_login"])) - { - // New session for this login has started. - $error=0; + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg=$user->error; + } - // Store value into session (values always stored) - $_SESSION["dol_login"]=$user->login; - $_SESSION["dol_authmode"]=isset($dol_authmode)?$dol_authmode:''; - $_SESSION["dol_tz"]=isset($dol_tz)?$dol_tz:''; - $_SESSION["dol_tz_string"]=isset($dol_tz_string)?$dol_tz_string:''; - $_SESSION["dol_dst"]=isset($dol_dst)?$dol_dst:''; - $_SESSION["dol_dst_observed"]=isset($dol_dst_observed)?$dol_dst_observed:''; - $_SESSION["dol_dst_first"]=isset($dol_dst_first)?$dol_dst_first:''; - $_SESSION["dol_dst_second"]=isset($dol_dst_second)?$dol_dst_second:''; - $_SESSION["dol_screenwidth"]=isset($dol_screenwidth)?$dol_screenwidth:''; - $_SESSION["dol_screenheight"]=isset($dol_screenheight)?$dol_screenheight:''; - $_SESSION["dol_company"]=$conf->global->MAIN_INFO_SOCIETE_NOM; - $_SESSION["dol_entity"]=$conf->entity; - // Store value into session (values stored only if defined) - if (! empty($dol_hide_topmenu)) $_SESSION['dol_hide_topmenu']=$dol_hide_topmenu; - if (! empty($dol_hide_leftmenu)) $_SESSION['dol_hide_leftmenu']=$dol_hide_leftmenu; - if (! empty($dol_optimize_smallscreen)) $_SESSION['dol_optimize_smallscreen']=$dol_optimize_smallscreen; - if (! empty($dol_no_mouse_hover)) $_SESSION['dol_no_mouse_hover']=$dol_no_mouse_hover; - if (! empty($dol_use_jmobile)) $_SESSION['dol_use_jmobile']=$dol_use_jmobile; + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers - dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id()); + // Hooks on failed login + $action=''; + $hookmanager->initHooks(array('login')); + $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); + $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; - $db->begin(); + $paramsurl=array(); + if (GETPOST('textbrowser','int')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); + if (GETPOST('nojs','int')) $paramsurl[]='nojs='.GETPOST('nojs','int'); + if (GETPOST('lang','aZ09')) $paramsurl[]='lang='.GETPOST('lang','aZ09'); + header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):'')); + exit; + } + } + else + { + // We are already into an authenticated session + $login=$_SESSION["dol_login"]; + $entity=$_SESSION["dol_entity"]; + dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG); - $user->update_last_login_date(); - - $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; - - // TODO @deprecated Remove this. Hook must be used, not this trigger. - $user->trigger_mesg = $loginfo; - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf); - if ($result < 0) { - $error++; - } - // End call triggers - - // Hooks on successfull login - $action=''; - $hookmanager->initHooks(array('login')); - $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginfo'=>$loginfo); - $reshook=$hookmanager->executeHooks('afterLogin',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; - - if ($error) - { - $db->rollback(); - session_destroy(); - dol_print_error($db,'Error in some hooks afterLogin (or old trigger USER_LOGIN)'); - exit; - } - else + $resultFetchUser=$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1)); + if ($resultFetchUser <= 0) { - $db->commit(); - } + // Account has been removed after login + dol_syslog("Can't load user even if session logged. _SESSION['dol_login']=".$login, LOG_WARNING); + session_destroy(); + session_name($sessionname); + session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie + session_start(); // Fixing the bug of register_globals here is useless since session is empty - // Change landing page if defined. - $landingpage=(empty($user->conf->MAIN_LANDING_PAGE)?(empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE):$user->conf->MAIN_LANDING_PAGE); - if (! empty($landingpage)) // Example: /index.php - { - $newpath=dol_buildpath($landingpage, 1); - if ($_SERVER["PHP_SELF"] != $newpath) // not already on landing page (avoid infinite loop) - { - header('Location: '.$newpath); - exit; - } - } - } + if ($resultFetchUser == 0) + { + $langs->load('main'); + $langs->load('errors'); + + $_SESSION["dol_loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg='ErrorCantLoadUserFromDolibarrDatabase - login='.$login; + } + if ($resultFetchUser < 0) + { + $_SESSION["dol_loginmesg"]=$user->error; + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg=$user->error; + } + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + + // Hooks on failed login + $action=''; + $hookmanager->initHooks(array('login')); + $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginmesg'=>$_SESSION["dol_loginmesg"]); + $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; + + $paramsurl=array(); + if (GETPOST('textbrowser','int')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); + if (GETPOST('nojs','int')) $paramsurl[]='nojs='.GETPOST('nojs','int'); + if (GETPOST('lang','aZ09')) $paramsurl[]='lang='.GETPOST('lang','aZ09'); + header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl)?'?'.implode('&',$paramsurl):'')); + exit; + } + else + { + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context + $hookmanager->initHooks(array('main')); + + // Code for search criteria persistence. + if (! empty($_GET['save_lastsearch_values'])) // Keep $_GET here + { + $relativepathstring = preg_replace('/\?.*$/','',$_SERVER["HTTP_REFERER"]); + $relativepathstring = preg_replace('/^https?:\/\/[^\/]*/','',$relativepathstring); // Get full path except host server + // Clean $relativepathstring + if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); + $relativepathstring = preg_replace('/^\//', '', $relativepathstring); + $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); + //var_dump($relativepathstring); + + if (! empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring])) + { + $_SESSION['lastsearch_values_'.$relativepathstring]=$_SESSION['lastsearch_values_tmp_'.$relativepathstring]; + unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]); + } + } + + $action = ''; + $reshook = $hookmanager->executeHooks('updateSession', array(), $user, $action); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + } + } + + // Is it a new session that has started ? + // If we are here, this means authentication was successfull. + if (! isset($_SESSION["dol_login"])) + { + // New session for this login has started. + $error=0; + + // Store value into session (values always stored) + $_SESSION["dol_login"]=$user->login; + $_SESSION["dol_authmode"]=isset($dol_authmode)?$dol_authmode:''; + $_SESSION["dol_tz"]=isset($dol_tz)?$dol_tz:''; + $_SESSION["dol_tz_string"]=isset($dol_tz_string)?$dol_tz_string:''; + $_SESSION["dol_dst"]=isset($dol_dst)?$dol_dst:''; + $_SESSION["dol_dst_observed"]=isset($dol_dst_observed)?$dol_dst_observed:''; + $_SESSION["dol_dst_first"]=isset($dol_dst_first)?$dol_dst_first:''; + $_SESSION["dol_dst_second"]=isset($dol_dst_second)?$dol_dst_second:''; + $_SESSION["dol_screenwidth"]=isset($dol_screenwidth)?$dol_screenwidth:''; + $_SESSION["dol_screenheight"]=isset($dol_screenheight)?$dol_screenheight:''; + $_SESSION["dol_company"]=$conf->global->MAIN_INFO_SOCIETE_NOM; + $_SESSION["dol_entity"]=$conf->entity; + // Store value into session (values stored only if defined) + if (! empty($dol_hide_topmenu)) $_SESSION['dol_hide_topmenu']=$dol_hide_topmenu; + if (! empty($dol_hide_leftmenu)) $_SESSION['dol_hide_leftmenu']=$dol_hide_leftmenu; + if (! empty($dol_optimize_smallscreen)) $_SESSION['dol_optimize_smallscreen']=$dol_optimize_smallscreen; + if (! empty($dol_no_mouse_hover)) $_SESSION['dol_no_mouse_hover']=$dol_no_mouse_hover; + if (! empty($dol_use_jmobile)) $_SESSION['dol_use_jmobile']=$dol_use_jmobile; + + dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id()); + + $db->begin(); + + $user->update_last_login_date(); + + $loginfo = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; + + // TODO @deprecated Remove this. Hook must be used, not this trigger. + $user->trigger_mesg = $loginfo; + // Call triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf); + if ($result < 0) { + $error++; + } + // End call triggers + + // Hooks on successfull login + $action=''; + $hookmanager->initHooks(array('login')); + $parameters=array('dol_authmode'=>$dol_authmode, 'dol_loginfo'=>$loginfo); + $reshook=$hookmanager->executeHooks('afterLogin',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; + + if ($error) + { + $db->rollback(); + session_destroy(); + dol_print_error($db,'Error in some hooks afterLogin (or old trigger USER_LOGIN)'); + exit; + } + else + { + $db->commit(); + } + + // Change landing page if defined. + $landingpage=(empty($user->conf->MAIN_LANDING_PAGE)?(empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE):$user->conf->MAIN_LANDING_PAGE); + if (! empty($landingpage)) // Example: /index.php + { + $newpath=dol_buildpath($landingpage, 1); + if ($_SERVER["PHP_SELF"] != $newpath) // not already on landing page (avoid infinite loop) + { + header('Location: '.$newpath); + exit; + } + } + } - // If user admin, we force the rights-based modules - if ($user->admin) - { - $user->rights->user->user->lire=1; - $user->rights->user->user->creer=1; - $user->rights->user->user->password=1; - $user->rights->user->user->supprimer=1; - $user->rights->user->self->creer=1; - $user->rights->user->self->password=1; - } + // If user admin, we force the rights-based modules + if ($user->admin) + { + $user->rights->user->user->lire=1; + $user->rights->user->user->creer=1; + $user->rights->user->user->password=1; + $user->rights->user->user->supprimer=1; + $user->rights->user->self->creer=1; + $user->rights->user->self->password=1; + } - /* + /* * Overwrite some configs globals (try to avoid this and have code to use instead $user->conf->xxx) */ - // Set liste_limit - if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0 - if (isset($user->conf->PRODUIT_LIMIT_SIZE)) $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; // Can be 0 + // Set liste_limit + if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0 + if (isset($user->conf->PRODUIT_LIMIT_SIZE)) $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; // Can be 0 - // Replace conf->css by personalized value if theme not forced - if (empty($conf->global->MAIN_FORCETHEME) && ! empty($user->conf->MAIN_THEME)) - { - $conf->theme=$user->conf->MAIN_THEME; - $conf->css = "/theme/".$conf->theme."/style.css.php"; - } + // Replace conf->css by personalized value if theme not forced + if (empty($conf->global->MAIN_FORCETHEME) && ! empty($user->conf->MAIN_THEME)) + { + $conf->theme=$user->conf->MAIN_THEME; + $conf->css = "/theme/".$conf->theme."/style.css.php"; + } } // Case forcing style from url @@ -814,7 +814,7 @@ else $conf->use_javascript_ajax=0; // Set MAIN_OPTIMIZEFORTEXTBROWSER if (GETPOST('textbrowser','int') || (! empty($conf->browser->name) && $conf->browser->name == 'lynxlinks') || ! empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) // If we must enable text browser { - $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=1; + $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=1; } // Set terminal output option according to conf->browser. @@ -843,39 +843,39 @@ if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea' if (! defined('NOREQUIRETRAN')) { - if (! GETPOST('lang','aZ09')) // If language was not forced on URL - { - // If user has chosen its own language - if (! empty($user->conf->MAIN_LANG_DEFAULT)) - { - // If different than current language - //print ">>>".$langs->getDefaultLang()."-".$user->conf->MAIN_LANG_DEFAULT; - if ($langs->getDefaultLang() != $user->conf->MAIN_LANG_DEFAULT) - { - $langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); - } - } - } + if (! GETPOST('lang','aZ09')) // If language was not forced on URL + { + // If user has chosen its own language + if (! empty($user->conf->MAIN_LANG_DEFAULT)) + { + // If different than current language + //print ">>>".$langs->getDefaultLang()."-".$user->conf->MAIN_LANG_DEFAULT; + if ($langs->getDefaultLang() != $user->conf->MAIN_LANG_DEFAULT) + { + $langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } + } + } } if (! defined('NOLOGIN')) { - // If the login is not recovered, it is identified with an account that does not exist. - // Hacking attempt? - if (! $user->login) accessforbidden(); + // If the login is not recovered, it is identified with an account that does not exist. + // Hacking attempt? + if (! $user->login) accessforbidden(); - // Check if user is active - if ($user->statut < 1) - { - // If not active, we refuse the user - $langs->load("other"); - dol_syslog("Authentification ko as login is disabled"); - accessforbidden($langs->trans("ErrorLoginDisabled")); - exit; - } + // Check if user is active + if ($user->statut < 1) + { + // If not active, we refuse the user + $langs->load("other"); + dol_syslog("Authentification ko as login is disabled"); + accessforbidden($langs->trans("ErrorLoginDisabled")); + exit; + } - // Load permissions - $user->getrights(); + // Load permissions + $user->getrights(); } @@ -886,8 +886,8 @@ dol_syslog("--- Access to ".$_SERVER["PHP_SELF"].' - action='.GETPOST('action',' // Load main languages files if (! defined('NOREQUIRETRAN')) { - $langs->load("main"); - $langs->load("dict"); + $langs->load("main"); + $langs->load("dict"); } // Define some constants used for style of arrays @@ -904,27 +904,27 @@ $mesgs=array(); $warnings=array(); $errors=array(); // Constants used to defined number of lines in textarea if (empty($conf->browser->firefox)) { - define('ROWS_1',1); - define('ROWS_2',2); - define('ROWS_3',3); - define('ROWS_4',4); - define('ROWS_5',5); - define('ROWS_6',6); - define('ROWS_7',7); - define('ROWS_8',8); - define('ROWS_9',9); + define('ROWS_1',1); + define('ROWS_2',2); + define('ROWS_3',3); + define('ROWS_4',4); + define('ROWS_5',5); + define('ROWS_6',6); + define('ROWS_7',7); + define('ROWS_8',8); + define('ROWS_9',9); } else { - define('ROWS_1',0); - define('ROWS_2',1); - define('ROWS_3',2); - define('ROWS_4',3); - define('ROWS_5',4); - define('ROWS_6',5); - define('ROWS_7',6); - define('ROWS_8',7); - define('ROWS_9',8); + define('ROWS_1',0); + define('ROWS_2',1); + define('ROWS_3',2); + define('ROWS_4',3); + define('ROWS_5',4); + define('ROWS_6',5); + define('ROWS_7',6); + define('ROWS_8',7); + define('ROWS_9',8); } $heightforframes=48; @@ -970,32 +970,32 @@ if (! defined('NOREQUIREMENU')) if (! function_exists("llxHeader")) { - /** - * Show HTML header HTML + BODY + Top menu + left menu + DIV - * - * @param string $head Optionnal head lines - * @param string $title HTML title - * @param string $help_url Url links to help page - * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage - * For other external page: http://server/url - * @param string $target Target to use on links - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param array $arrayofjs Array of complementary js files - * @param array $arrayofcss Array of complementary css files - * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) - * @param string $morecssonbody More CSS on body tag. - * @param string $replacemainareaby Replace call to main_area() by a print of this string - * @return void - */ + /** + * Show HTML header HTML + BODY + Top menu + left menu + DIV + * + * @param string $head Optionnal head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @return void + */ function llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='') { - global $conf; + global $conf; - // html header + // html header top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - print '<body id="mainbody"'.($morecssonbody?' class="'.$morecssonbody.'"':'').'>' . "\n"; + print '<body id="mainbody"'.($morecssonbody?' class="'.$morecssonbody.'"':'').'>' . "\n"; // top menu and left menu area if (empty($conf->dol_hide_topmenu)) @@ -1027,25 +1027,25 @@ if (! function_exists("llxHeader")) */ function top_httphead($contenttype='text/html') { - global $conf; + global $conf; - if ($contenttype == 'text/html' ) header("Content-Type: text/html; charset=".$conf->file->character_set_client); - else header("Content-Type: ".$contenttype); - // Security options - header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) - header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) - if (! empty($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) - { - // For example, to restrict script, object, frames or img to some domains - // script-src https://api.google.com https://anotherhost.com; object-src https://youtube.com; child-src https://youtube.com; img-src: https://static.example.com - // For example, to restrict everything to one domain, except object, ... - // default-src https://cdn.example.net; object-src 'none' - header("Content-Security-Policy: ".$conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY); - } + if ($contenttype == 'text/html' ) header("Content-Type: text/html; charset=".$conf->file->character_set_client); + else header("Content-Type: ".$contenttype); + // Security options + header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) + header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) + if (! empty($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) + { + // For example, to restrict script, object, frames or img to some domains + // script-src https://api.google.com https://anotherhost.com; object-src https://youtube.com; child-src https://youtube.com; img-src: https://static.example.com + // For example, to restrict everything to one domain, except object, ... + // default-src https://cdn.example.net; object-src 'none' + header("Content-Security-Policy: ".$conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY); + } - // On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1. - /*if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { + // On the fly GZIP compression for all pages (if browser support it). Must set the bit 3 of constant to 1. + /*if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x04)) { ob_start("ob_gzhandler"); }*/ } @@ -1066,206 +1066,206 @@ function top_httphead($contenttype='text/html') */ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disablejmobile=0, $disablenofollow=0) { - global $user, $conf, $langs, $db; + global $user, $conf, $langs, $db; - top_httphead(); + top_httphead(); - if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default + if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default - if (! empty($conf->global->MAIN_ACTIVATE_HTML4)) { - $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; - }else { - $doctype = '<!doctype html>'; - } - print $doctype."\n"; - if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print '<html lang="'.substr($langs->defaultlang,0,2).'" manifest="'.DOL_URL_ROOT.'/cache.manifest">'."\n"; - else print '<html lang="'.substr($langs->defaultlang,0,2).'">'."\n"; - //print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n"; - if (empty($disablehead)) - { - print "<head>\n"; + if (! empty($conf->global->MAIN_ACTIVATE_HTML4)) { + $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; + }else { + $doctype = '<!doctype html>'; + } + print $doctype."\n"; + if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print '<html lang="'.substr($langs->defaultlang,0,2).'" manifest="'.DOL_URL_ROOT.'/cache.manifest">'."\n"; + else print '<html lang="'.substr($langs->defaultlang,0,2).'">'."\n"; + //print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n"; + if (empty($disablehead)) + { + print "<head>\n"; if (GETPOST('dol_basehref','alpha')) print '<base href="'.dol_escape_htmltag(GETPOST('dol_basehref','alpha')).'">'."\n"; - // Displays meta - print '<meta name="robots" content="noindex'.($disablenofollow?'':',nofollow').'">'."\n"; // Do not index - print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'; // Scale for mobile device - print '<meta name="author" content="Dolibarr Development Team">'."\n"; - // Favicon + // Displays meta + print '<meta name="robots" content="noindex'.($disablenofollow?'':',nofollow').'">'."\n"; // Do not index + print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'; // Scale for mobile device + print '<meta name="author" content="Dolibarr Development Team">'."\n"; + // Favicon $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1); - if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; - if (empty($conf->dol_use_jmobile)) print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview - //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">'."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n"; + if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; + if (empty($conf->dol_use_jmobile)) print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview + //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print '<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1">'."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser','int')) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n"; - // Displays title - $appli=constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + // Displays title + $appli=constant('DOL_APPLICATION_TITLE'); + if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; - if ($title && ! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/',$conf->global->MAIN_HTML_TITLE)) print '<title>'.dol_htmlentities($title).''; - else if ($title) print ''.dol_htmlentities($appli.' - '.$title).''; - else print "".dol_htmlentities($appli).""; - print "\n"; + if ($title && ! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/',$conf->global->MAIN_HTML_TITLE)) print ''.dol_htmlentities($title).''; + else if ($title) print ''.dol_htmlentities($appli.' - '.$title).''; + else print "".dol_htmlentities($appli).""; + print "\n"; - //$ext=''; - //if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION); - $ext='version='.urlencode(DOL_VERSION); + //$ext=''; + //if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION); + $ext='version='.urlencode(DOL_VERSION); - if (GETPOST('version','int')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js - if (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext.='&testmenuhider='.(GETPOST('testmenuhider','int')?GETPOST('testmenuhider','int'):$conf->global->MAIN_TESTMENUHIDER); + if (GETPOST('version','int')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js + if (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext.='&testmenuhider='.(GETPOST('testmenuhider','int')?GETPOST('testmenuhider','int'):$conf->global->MAIN_TESTMENUHIDER); - $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss','aZ09')?'&optioncss='.GETPOST('optioncss','aZ09',1):'').'&userid='.$user->id.'&entity='.$conf->entity; - $themeparam.=($ext?'&'.$ext:''); - if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; - if (GETPOST('dol_hide_topmenu','int')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu','int'); } - if (GETPOST('dol_hide_leftmenu','int')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu','int'); } - if (GETPOST('dol_optimize_smallscreen','int')) { $themeparam.='&dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen','int'); } - if (GETPOST('dol_no_mouse_hover','int')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover','int'); } - if (GETPOST('dol_use_jmobile','int')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile','int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile','int'); } + $themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss','aZ09')?'&optioncss='.GETPOST('optioncss','aZ09',1):'').'&userid='.$user->id.'&entity='.$conf->entity; + $themeparam.=($ext?'&'.$ext:''); + if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache']; + if (GETPOST('dol_hide_topmenu','int')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu','int'); } + if (GETPOST('dol_hide_leftmenu','int')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu','int'); } + if (GETPOST('dol_optimize_smallscreen','int')) { $themeparam.='&dol_optimize_smallscreen='.GETPOST('dol_optimize_smallscreen','int'); } + if (GETPOST('dol_no_mouse_hover','int')) { $themeparam.='&dol_no_mouse_hover='.GETPOST('dol_no_mouse_hover','int'); } + if (GETPOST('dol_use_jmobile','int')) { $themeparam.='&dol_use_jmobile='.GETPOST('dol_use_jmobile','int'); $conf->dol_use_jmobile=GETPOST('dol_use_jmobile','int'); } - if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) - { - print ''."\n"; - $jquerytheme = 'smoothness'; - if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; - if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery - else print ''."\n"; // JQuery - if (! defined('DISABLE_JQUERY_TIPTIP')) print ''."\n"; // Tooltip - if (! defined('DISABLE_JQUERY_JNOTIFY')) print ''."\n"; // JNotify - /* Removed a old hidden problematic feature never used in Dolibarr. If an external module need datatable, the module must provide all lib it needs and manage version problems with other dolibarr components + if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) + { + print ''."\n"; + $jquerytheme = 'smoothness'; + if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; + if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery + else print ''."\n"; // JQuery + if (! defined('DISABLE_JQUERY_TIPTIP')) print ''."\n"; // Tooltip + if (! defined('DISABLE_JQUERY_JNOTIFY')) print ''."\n"; // JNotify + /* Removed a old hidden problematic feature never used in Dolibarr. If an external module need datatable, the module must provide all lib it needs and manage version problems with other dolibarr components if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) // jQuery datatables { print ''."\n"; print ''."\n"; print ''."\n"; }*/ - if (! defined('DISABLE_SELECT2') && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) // jQuery plugin "mutiselect", "multiple-select", "select2"... - { - $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; - print ''."\n"; - } - // jQuery Timepicker - if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) - { - print ''."\n"; - } - } + if (! defined('DISABLE_SELECT2') && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) // jQuery plugin "mutiselect", "multiple-select", "select2"... + { + $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; + print ''."\n"; + } + // jQuery Timepicker + if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) + { + print ''."\n"; + } + } - if (! defined('DISABLE_FONT_AWSOME')) - { - print ''."\n"; - print ''."\n"; - } + if (! defined('DISABLE_FONT_AWSOME')) + { + print ''."\n"; + print ''."\n"; + } - print ''."\n"; - // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' - $themepath=dol_buildpath($conf->css,1); - $themesubdir=''; - if (! empty($conf->modules_parts['theme'])) // This slow down - { - foreach($conf->modules_parts['theme'] as $reldir) - { - if (file_exists(dol_buildpath($reldir.$conf->css, 0))) - { + print ''."\n"; + // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' + $themepath=dol_buildpath($conf->css,1); + $themesubdir=''; + if (! empty($conf->modules_parts['theme'])) // This slow down + { + foreach($conf->modules_parts['theme'] as $reldir) + { + if (file_exists(dol_buildpath($reldir.$conf->css, 0))) + { $themepath=dol_buildpath($reldir.$conf->css, 1); $themesubdir=$reldir; break; - } - } - } - //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; - print ''."\n"; - if (! empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) print ''."\n".''."\n"; + } + } + } + //print 'themepath='.$themepath.' themeparam='.$themeparam;exit; + print ''."\n"; + if (! empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) print ''."\n".''."\n"; - // CSS forced by modules (relative url starting with /) - if (! empty($conf->modules_parts['css'])) - { - $arraycss=(array) $conf->modules_parts['css']; - foreach($arraycss as $modcss => $filescss) - { - $filescss=(array) $filescss; // To be sure filecss is an array - foreach($filescss as $cssfile) - { - if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); - // cssfile is a relative path - print ''."\n".''."\n"; - } - } - } - // CSS forced by page in top_htmlhead call (relative url starting with /) - if (is_array($arrayofcss)) - { - foreach($arrayofcss as $cssfile) - { - print ''."\n".''."\n"; - } - } + // CSS forced by modules (relative url starting with /) + if (! empty($conf->modules_parts['css'])) + { + $arraycss=(array) $conf->modules_parts['css']; + foreach($arraycss as $modcss => $filescss) + { + $filescss=(array) $filescss; // To be sure filecss is an array + foreach($filescss as $cssfile) + { + if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); + // cssfile is a relative path + print ''."\n".''."\n"; + } + } + } + // CSS forced by page in top_htmlhead call (relative url starting with /) + if (is_array($arrayofcss)) + { + foreach($arrayofcss as $cssfile) + { + print ''."\n".''."\n"; + } + } - // Output standard javascript links - if (! defined('DISABLE_JQUERY') && ! $disablejs && ! empty($conf->use_javascript_ajax)) - { - // JQuery. Must be before other includes - print ''."\n"; - if (defined('JS_JQUERY') && constant('JS_JQUERY')) print ''."\n"; - else print ''."\n"; - if (! empty($conf->global->MAIN_FEATURES_LEVEL) && ! defined('JS_JQUERY_MIGRATE_DISABLED')) - { - if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print ''."\n"; - else print ''."\n"; - } - if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) print ''."\n"; - else print ''."\n"; - if (! defined('DISABLE_JQUERY_TABLEDND')) print ''."\n"; - if (! defined('DISABLE_JQUERY_TIPTIP')) print ''."\n"; - // jQuery jnotify - if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) - { - print ''."\n"; - print ''."\n"; - } - // Flot - if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && ! defined('DISABLE_JQUERY_FLOT')) - { - if (constant('JS_JQUERY_FLOT')) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - else - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - } - // jQuery jeditable - if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! defined('DISABLE_JQUERY_JEDITABLE')) - { - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - } - // jQuery DataTables - /* Removed a old hidden problematic feature never used in Dolibarr. If an external module need datatable, the module must provide all lib it needs and manage version problems with other dolibarr components + // Output standard javascript links + if (! defined('DISABLE_JQUERY') && ! $disablejs && ! empty($conf->use_javascript_ajax)) + { + // JQuery. Must be before other includes + print ''."\n"; + if (defined('JS_JQUERY') && constant('JS_JQUERY')) print ''."\n"; + else print ''."\n"; + if (! empty($conf->global->MAIN_FEATURES_LEVEL) && ! defined('JS_JQUERY_MIGRATE_DISABLED')) + { + if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print ''."\n"; + else print ''."\n"; + } + if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) print ''."\n"; + else print ''."\n"; + if (! defined('DISABLE_JQUERY_TABLEDND')) print ''."\n"; + if (! defined('DISABLE_JQUERY_TIPTIP')) print ''."\n"; + // jQuery jnotify + if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) + { + print ''."\n"; + print ''."\n"; + } + // Flot + if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && ! defined('DISABLE_JQUERY_FLOT')) + { + if (constant('JS_JQUERY_FLOT')) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + else + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + } + // jQuery jeditable + if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! defined('DISABLE_JQUERY_JEDITABLE')) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + // jQuery DataTables + /* Removed a old hidden problematic feature never used in Dolibarr. If an external module need datatable, the module must provide all lib it needs and manage version problems with other dolibarr components if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) { print ''."\n"; @@ -1389,93 +1389,93 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs */ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $helppagename='') { - global $user, $conf, $langs, $db; - global $dolibarr_main_authentication, $dolibarr_main_demo; - global $hookmanager,$menumanager; + global $user, $conf, $langs, $db; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $hookmanager,$menumanager; - $searchform=''; - $bookmarks=''; + $searchform=''; + $bookmarks=''; - // Instantiate hooks of thirdparty module - $hookmanager->initHooks(array('toprightmenu')); + // Instantiate hooks of thirdparty module + $hookmanager->initHooks(array('toprightmenu')); - $toprightmenu=''; + $toprightmenu=''; - // For backward compatibility with old modules - if (empty($conf->headerdone)) - { - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); - print ''; - } + // For backward compatibility with old modules + if (empty($conf->headerdone)) + { + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); + print ''; + } - /* + /* * Top menu */ - if (empty($conf->dol_hide_topmenu) && (! defined('NOREQUIREMENU') || ! constant('NOREQUIREMENU'))) - { - print "\n".''."\n"; + if (empty($conf->dol_hide_topmenu) && (! defined('NOREQUIREMENU') || ! constant('NOREQUIREMENU'))) + { + print "\n".''."\n"; - print '
        '; + print '
        '; - // Show menu entries - print '
        '."\n"; - $menumanager->atarget=$target; - $menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n - print "
        \n"; + // Show menu entries + print '
        '."\n"; + $menumanager->atarget=$target; + $menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n + print "
        \n"; - // Define link to login card - $appli=constant('DOL_APPLICATION_TITLE'); - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) - { - $appli=$conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) - { + // Define link to login card + $appli=constant('DOL_APPLICATION_TITLE'); + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) + { + $appli=$conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) + { if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli.=" ".DOL_VERSION; - } - else $appli.=" ".DOL_VERSION; + } + else $appli.=" ".DOL_VERSION; + } + else $appli.=" ".DOL_VERSION; - if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $appli.="
        ".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL; + if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $appli.="
        ".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL; - $logouttext=''; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - //$logouthtmltext=$appli.'
        '; - if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') - { - $logouthtmltext.=$langs->trans("Logout").'
        '; + $logouttext=''; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + //$logouthtmltext=$appli.'
        '; + if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') + { + $logouthtmltext.=$langs->trans("Logout").'
        '; - $logouttext .=''; - //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); - $logouttext .=''; - $logouttext .=''; - } - else - { - $logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode",$_SESSION["dol_authmode"]); - $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); - } - } + $logouttext .=''; + //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); + $logouttext .=''; + $logouttext .=''; + } + else + { + $logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode",$_SESSION["dol_authmode"]); + $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); + } + } - print '\n"; + print "
        \n"; print '
        '; - //unset($form); + //unset($form); print '
        '; - print "\n\n"; - } + print "\n\n"; + } - if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) print '
        '; + if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) print '
        '; } @@ -1586,73 +1586,73 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a */ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='', $acceptdelayedhtml=0) { - global $user, $conf, $langs, $db, $form; - global $hookmanager, $menumanager; + global $user, $conf, $langs, $db, $form; + global $hookmanager, $menumanager; - $searchform=''; - $bookmarks=''; + $searchform=''; + $bookmarks=''; - if (! empty($menu_array_before)) dol_syslog("Deprecated parameter menu_array_before was used when calling main::left_menu function. Menu entries of module should now be defined into module descriptor and not provided when calling left_menu.", LOG_WARNING); + if (! empty($menu_array_before)) dol_syslog("Deprecated parameter menu_array_before was used when calling main::left_menu function. Menu entries of module should now be defined into module descriptor and not provided when calling left_menu.", LOG_WARNING); - if (empty($conf->dol_hide_leftmenu) && (! defined('NOREQUIREMENU') || ! constant('NOREQUIREMENU'))) - { - // Instantiate hooks of thirdparty module - $hookmanager->initHooks(array('searchform','leftblock')); + if (empty($conf->dol_hide_leftmenu) && (! defined('NOREQUIREMENU') || ! constant('NOREQUIREMENU'))) + { + // Instantiate hooks of thirdparty module + $hookmanager->initHooks(array('searchform','leftblock')); print "\n".''."\n".'
        '."\n"; - print "\n"; + print "\n"; - if ($conf->use_javascript_ajax && $conf->browser->layout != 'phone' && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) - { - if (! is_object($form)) $form=new Form($db); - $selected=-1; - $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); - } - else - { - // Define $searchform - if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && $user->rights->societe->lire) - { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'maxwidth100', 'sall', 'T', 'searchleftt', img_object('','company')); - } + if ($conf->use_javascript_ajax && $conf->browser->layout != 'phone' && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) + { + if (! is_object($form)) $form=new Form($db); + $selected=-1; + $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1); + } + else + { + // Define $searchform + if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && $user->rights->societe->lire) + { + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'maxwidth100', 'sall', 'T', 'searchleftt', img_object('','company')); + } - if (! empty($conf->societe->enabled) && $user->rights->societe->lire) - { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'maxwidth100', 'sall', 'A', 'searchleftc', img_object('','contact')); - } + if (! empty($conf->societe->enabled) && $user->rights->societe->lire) + { + $langs->load("companies"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'maxwidth100', 'sall', 'A', 'searchleftc', img_object('','contact')); + } - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) - ) - { - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'maxwidth100', 'sall', 'P', 'searchleftp', img_object('','product')); - } + if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) + ) + { + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'maxwidth100', 'sall', 'P', 'searchleftp', img_object('','product')); + } - if (! empty($conf->projet->enabled) && $user->rights->projet->lire) - { - $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'maxwidth100', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); - } + if (! empty($conf->projet->enabled) && $user->rights->projet->lire) + { + $langs->load("projects"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'maxwidth100', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + } - if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) - { - $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'maxwidth100', 'sall', 'M', 'searchleftm', img_object('','user')); - } + if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) + { + $langs->load("members"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'maxwidth100', 'sall', 'M', 'searchleftm', img_object('','user')); + } - if (! empty($conf->user->enabled) && $user->rights->user->user->lire) - { - $langs->load("users"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'maxwidth100', 'sall', 'M', 'searchleftuser', img_object('','user')); - } - } + if (! empty($conf->user->enabled) && $user->rights->user->user->lire) + { + $langs->load("users"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'maxwidth100', 'sall', 'M', 'searchleftuser', img_object('','user')); + } + } - // Execute hook printSearchForm - $parameters=array('searchform'=>$searchform); - $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks + // Execute hook printSearchForm + $parameters=array('searchform'=>$searchform); + $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { $searchform.=$hookmanager->resPrint; @@ -1660,72 +1660,72 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra else $searchform=$hookmanager->resPrint; if ($conf->use_javascript_ajax && $conf->browser->layout == 'phone') - { - $searchform='
        '; - $searchform.='' . "\n"; - $searchform.='
        '; - } + $searchform.='
        '; + } - // Define $bookmarks - if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) - { - include_once (DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'); - $langs->load("bookmarks"); + // Define $bookmarks + if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) + { + include_once (DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'); + $langs->load("bookmarks"); - $bookmarks=printBookmarksList($db, $langs); - } + $bookmarks=printBookmarksList($db, $langs); + } - // Left column - print ''."\n"; + // Left column + print ''."\n"; - print '
        global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Left menu"').'>'."\n\n"; + print '
        global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Left menu"').'>'."\n\n"; - // Show left menu with other forms - $menumanager->menu_array = $menu_array_before; - $menumanager->menu_array_after = $menu_array_after; - $menumanager->showmenu('left', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // output menu_array and menu found in database + // Show left menu with other forms + $menumanager->menu_array = $menu_array_before; + $menumanager->menu_array_after = $menu_array_after; + $menumanager->showmenu('left', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // output menu_array and menu found in database - // Dolibarr version + help + bug report link + // Dolibarr version + help + bug report link print "\n"; - print "\n"; - print '
        '."\n"; + print "\n"; + print '
        '."\n"; - // Version - if (empty($conf->global->MAIN_HIDE_VERSION)) // Version is already on help picto and on login page. - { - $doliurl='https://www.dolibarr.org'; - //local communities - if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.fr'; - if (preg_match('/es/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.es'; - if (preg_match('/de/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.de'; - if (preg_match('/it/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.it'; - if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.gr'; + // Version + if (empty($conf->global->MAIN_HIDE_VERSION)) // Version is already on help picto and on login page. + { + $doliurl='https://www.dolibarr.org'; + //local communities + if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.fr'; + if (preg_match('/es/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.es'; + if (preg_match('/de/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.de'; + if (preg_match('/it/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.it'; + if (preg_match('/gr/i',$langs->defaultlang)) $doliurl='https://www.dolibarr.gr'; - $appli=constant('DOL_APPLICATION_TITLE'); - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) - { - $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; - if (preg_match('/\d\.\d/', $appli)) - { - if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - else $appli.=" ".DOL_VERSION; - } - else $appli.=" ".DOL_VERSION; - print '
        '; - if ($doliurl) print ''; - else print ''; - print $appli; - if ($doliurl) print ''; - else print ''; - print '
        '."\n"; - } + $appli=constant('DOL_APPLICATION_TITLE'); + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) + { + $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; + if (preg_match('/\d\.\d/', $appli)) + { + if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + else $appli.=" ".DOL_VERSION; + } + else $appli.=" ".DOL_VERSION; + print '
        '; + if ($doliurl) print ''; + else print ''; + print $appli; + if ($doliurl) print ''; + else print ''; + print '
        '."\n"; + } // Link to bugtrack if (! empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) @@ -1753,26 +1753,26 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra print '
        '; } - print "
        \n"; - print "\n"; - print "\n"; + print "
        \n"; + print "\n"; + print "\n"; - print "
        \n"; - print "\n"; - print "\n"; + print "
        \n"; + print "\n"; + print "\n"; - // Execute hook printLeftBlock - $parameters=array(); - $reshook=$hookmanager->executeHooks('printLeftBlock',$parameters); // Note that $action and $object may have been modified by some hooks - print $hookmanager->resPrint; + // Execute hook printLeftBlock + $parameters=array(); + $reshook=$hookmanager->executeHooks('printLeftBlock',$parameters); // Note that $action and $object may have been modified by some hooks + print $hookmanager->resPrint; - print '
        '; // End div id="side-nav" div id="id-left" - } + print '
        '; // End div id="side-nav" div id="id-left" + } - print "\n"; - print ''."\n"; + print "\n"; + print ''."\n"; - if (empty($leftmenuwithoutmainarea)) main_area($title); + if (empty($leftmenuwithoutmainarea)) main_area($title); } @@ -1784,15 +1784,15 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra */ function main_area($title='') { - global $conf, $langs; + global $conf, $langs; if (empty($conf->dol_hide_leftmenu)) print '
        '; - print "\n"; + print "\n"; - print ''."\n".'
        '."\n"; + print ''."\n".'
        '."\n"; - if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode",$conf->global->MAIN_ONLY_LOGIN_ALLOWED)); + if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode",$conf->global->MAIN_ONLY_LOGIN_ALLOWED)); } @@ -1809,34 +1809,34 @@ function getHelpParamFor($helppagename,$langs) $helppage=''; $mode=''; - if (preg_match('/^http/i',$helppagename)) - { - // If complete URL - $helpbaseurl='%s'; - $helppage=$helppagename; - $mode='local'; - } - else - { - // If WIKI URL - if (preg_match('/^es/i',$langs->defaultlang)) - { - $helpbaseurl='http://wiki.dolibarr.org/index.php/%s'; - if (preg_match('/ES:([^|]+)/i',$helppagename,$reg)) $helppage=$reg[1]; - } - if (preg_match('/^fr/i',$langs->defaultlang)) - { - $helpbaseurl='http://wiki.dolibarr.org/index.php/%s'; - if (preg_match('/FR:([^|]+)/i',$helppagename,$reg)) $helppage=$reg[1]; - } - if (empty($helppage)) // If help page not already found - { - $helpbaseurl='http://wiki.dolibarr.org/index.php/%s'; - if (preg_match('/EN:([^|]+)/i',$helppagename,$reg)) $helppage=$reg[1]; - } - $mode='wiki'; - } - return array('helpbaseurl'=>$helpbaseurl,'helppage'=>$helppage,'mode'=>$mode); + if (preg_match('/^http/i',$helppagename)) + { + // If complete URL + $helpbaseurl='%s'; + $helppage=$helppagename; + $mode='local'; + } + else + { + // If WIKI URL + if (preg_match('/^es/i',$langs->defaultlang)) + { + $helpbaseurl='http://wiki.dolibarr.org/index.php/%s'; + if (preg_match('/ES:([^|]+)/i',$helppagename,$reg)) $helppage=$reg[1]; + } + if (preg_match('/^fr/i',$langs->defaultlang)) + { + $helpbaseurl='http://wiki.dolibarr.org/index.php/%s'; + if (preg_match('/FR:([^|]+)/i',$helppagename,$reg)) $helppage=$reg[1]; + } + if (empty($helppage)) // If help page not already found + { + $helpbaseurl='http://wiki.dolibarr.org/index.php/%s'; + if (preg_match('/EN:([^|]+)/i',$helppagename,$reg)) $helppage=$reg[1]; + } + $mode='wiki'; + } + return array('helpbaseurl'=>$helpbaseurl,'helppage'=>$helppage,'mode'=>$mode); } @@ -1855,120 +1855,120 @@ function getHelpParamFor($helppagename,$langs) */ function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='',$img='') { - global $conf,$langs; + global $conf,$langs; - if (empty($htmlinputid)) { - $htmlinputid = $htmlinputname; - } + if (empty($htmlinputid)) { + $htmlinputid = $htmlinputname; + } - $ret=''; - $ret.='
        '; + $ret=''; + $ret.=''; if (empty($conf->global->MAIN_HTML5_PLACEHOLDER)) { - $ret.=''; + $ret.=''; } - $ret.=''; - $ret.=''; - $ret.='global->MAIN_HTML5_PLACEHOLDER)) $ret.=' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"'; - $ret.=($accesskey?' accesskey="'.$accesskey.'"':''); - if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.strip_tags($title).'"'; // Will work only if MAIN_HTML5_PLACEHOLDER is set to 1 - else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; - $ret.=' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />'; - $ret.=''; - $ret.="\n"; - return $ret; + $ret.=''; + $ret.=''; + $ret.='global->MAIN_HTML5_PLACEHOLDER)) $ret.=' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"'; + $ret.=($accesskey?' accesskey="'.$accesskey.'"':''); + if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.strip_tags($title).'"'; // Will work only if MAIN_HTML5_PLACEHOLDER is set to 1 + else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; + $ret.=' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />'; + $ret.=''; + $ret.="\n"; + return $ret; } if (! function_exists("llxFooter")) { - /** - * Show HTML footer - * Close div /DIV class=fiche + /DIV id-right + /DIV id-container + /BODY + /HTML. - * If global var $delayedhtmlcontent was filled, we output it just before closing the body. - * - * @param string $comment A text to add as HTML comment into HTML generated page + /** + * Show HTML footer + * Close div /DIV class=fiche + /DIV id-right + /DIV id-container + /BODY + /HTML. + * If global var $delayedhtmlcontent was filled, we output it just before closing the body. + * + * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) - * @return void - */ - function llxFooter($comment='',$zone='private') - { - global $conf, $langs, $user, $object; - global $delayedhtmlcontent; + * @return void + */ + function llxFooter($comment='',$zone='private') + { + global $conf, $langs, $user, $object; + global $delayedhtmlcontent; - // Global html output events ($mesgs, $errors, $warnings) - dol_htmloutput_events(); + // Global html output events ($mesgs, $errors, $warnings) + dol_htmloutput_events(); - // Code for search criteria persistence. - // Save $user->lastsearch_values if defined (define on list pages when a form field search_xxx exists) - if (is_object($user) && ! empty($user->lastsearch_values_tmp) && is_array($user->lastsearch_values_tmp)) - { - // Clean data - foreach($user->lastsearch_values_tmp as $key => $val) - { - unset($_SESSION['lastsearch_values_tmp_'.$key]); - if (count($val)) - { - if (empty($val['sortfield'])) unset($val['sortfield']); - if (empty($val['sortorder'])) unset($val['sortorder']); - dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criteria)"); - $_SESSION['lastsearch_values_tmp_'.$key]=json_encode($val); - unset($_SESSION['lastsearch_values_'.$key]); - } - } - } + // Code for search criteria persistence. + // Save $user->lastsearch_values if defined (define on list pages when a form field search_xxx exists) + if (is_object($user) && ! empty($user->lastsearch_values_tmp) && is_array($user->lastsearch_values_tmp)) + { + // Clean data + foreach($user->lastsearch_values_tmp as $key => $val) + { + unset($_SESSION['lastsearch_values_tmp_'.$key]); + if (count($val)) + { + if (empty($val['sortfield'])) unset($val['sortfield']); + if (empty($val['sortorder'])) unset($val['sortorder']); + dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criteria)"); + $_SESSION['lastsearch_values_tmp_'.$key]=json_encode($val); + unset($_SESSION['lastsearch_values_'.$key]); + } + } + } - // Core error message - if (! empty($conf->global->MAIN_CORE_ERROR)) - { - // Ajax version - if ($conf->use_javascript_ajax) - { - $title = img_warning().' '.$langs->trans('CoreErrorTitle'); - print ajax_dialog($title, $langs->trans('CoreErrorMessage')); - } - // html version - else - { - $msg = img_warning().' '.$langs->trans('CoreErrorMessage'); - print '
        '.$msg.'
        '; - } + // Core error message + if (! empty($conf->global->MAIN_CORE_ERROR)) + { + // Ajax version + if ($conf->use_javascript_ajax) + { + $title = img_warning().' '.$langs->trans('CoreErrorTitle'); + print ajax_dialog($title, $langs->trans('CoreErrorMessage')); + } + // html version + else + { + $msg = img_warning().' '.$langs->trans('CoreErrorMessage'); + print '
        '.$msg.'
        '; + } - //define("MAIN_CORE_ERROR",0); // Constant was defined and we can't change value of a constant - } + //define("MAIN_CORE_ERROR",0); // Constant was defined and we can't change value of a constant + } - print "\n\n"; + print "\n\n"; - print '
        '."\n"; // End div fiche + print '
        '."\n"; // End div fiche if (empty($conf->dol_hide_leftmenu)) print '
        '; // End div id-right - print "\n"; - if ($comment) print ''."\n"; + print "\n"; + if ($comment) print ''."\n"; - printCommonFooter($zone); + printCommonFooter($zone); - if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) print ' '."\n"; // End div container + if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile)) print ' '."\n"; // End div container - if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent; + if (! empty($delayedhtmlcontent)) print $delayedhtmlcontent; - // TODO Move this in lib_head.js.php + // TODO Move this in lib_head.js.php - // Wrapper to show tooltips (html or onclick popup) - if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover)) - { - print "\n\n"; - print '' . "\n"; - } + } - // Wrapper to manage document_preview - if (! empty($conf->use_javascript_ajax) && ($conf->browser->layout != 'phone')) - { - print "\n\n"; - print '' . "\n"; - } + } - // Wrapper to manage dropdown - if (! empty($conf->use_javascript_ajax) && ! defined('JS_JQUERY_DISABLE_DROPDOWN')) - { - print "\n\n"; - print ''; - } + } - // Wrapper to add log when clicking on download or preview - if (! empty($conf->blockedlog->enabled) && is_object($object) && $object->id > 0 && $object->statut > 0) - { - if (in_array($object->element, array('facture'))) // Restrict for the moment to element 'facture' - { - print "\n\n"; - ?> + // Wrapper to add log when clicking on download or preview + if (! empty($conf->blockedlog->enabled) && is_object($object) && $object->id > 0 && $object->statut > 0) + { + if (in_array($object->element, array('facture'))) // Restrict for the moment to element 'facture' + { + print "\n\n"; + ?> \n"; print ''."\n"; - print "\n"; - print "\n"; - } + print "\n"; + print "\n"; + } } diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 5b5a10b598b..2affb8057e1 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -540,164 +540,164 @@ if ($socid && $action != 'edit' && $action != "create") print ' '.img_picto($langs->trans("SwiftValid"),'info'); } } - print ''; + print ''; - if (! empty($conf->prelevement->enabled)) - { - // RUM + if (! empty($conf->prelevement->enabled)) + { + // RUM //print '
        '; - print ''; + print ''; // FRSTRECUR print ''; - } + } - // Default - print ''; + // Default + print ''; - // Generate doc - print ''; + // Language code (if multilang) + if ($conf->global->MAIN_MULTILANGS) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + $formadmin=new FormAdmin($db); + $defaultlang=$codelang?$codelang:$langs->getDefaultLang(); + $morecss='maxwidth150'; + if (! empty($conf->browser->phone)) $morecss='maxwidth100'; + $out.= $formadmin->select_language($defaultlang, 'lang_idrib'.$rib->id, 0, 0, 0, 0, 0, $morecss); + } + // Button + $genbutton = 'dol_no_mouse_hover) && $modulepart != 'unpaid') + { + $langs->load("errors"); + $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); + } + if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; + if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton=''; + $out.= $genbutton; + $out.= ''; + } + print $out; + print ''; - // Edit/Delete - print ''; + print ''; + print img_picto($langs->trans("Delete"),'delete'); + print ''; + } + print ''; - print ''; - } + print ''; + } - if (count($rib_list) == 0) - { - $colspan=8; - if (! empty($conf->prelevement->enabled)) $colspan+=2; - print ''; - } + if (count($rib_list) == 0) + { + $colspan=8; + if (! empty($conf->prelevement->enabled)) $colspan+=2; + print ''; + } - print '
        '; - $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); - print $form->selectarray('search_gender', $arraygender, $search_gender, 1); - print ''; + $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); + print $form->selectarray('search_gender', $arraygender, $search_gender, 1); + print ''; - print $form->selectyesno('search_employee', $search_employee, 1, false, 1); - print ''; + print $form->selectyesno('search_employee', $search_employee, 1, false, 1); + print ''; - print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200'); - print ''; + print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200'); + print ''; - if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) { - $crit=$val; + $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); $searchclass=''; if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; @@ -402,22 +402,22 @@ $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // N print $hookmanager->resPrint; if (! empty($arrayfields['u.datec']['checked'])) { - // Date creation - print ''; - print ''; + print ''; - print ''; + print ''; - print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); - print ''; + print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut); + print ''; @@ -444,16 +444,16 @@ if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_t // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { - foreach($extrafields->attribute_label as $key => $val) - { - if (! empty($arrayfields["ef.".$key]['checked'])) - { - $align=$extrafields->getAlignFlag($key); + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); $sortonfield = "ef.".$key; if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); - } - } + } + } } // Hook fields $parameters=array('arrayfields'=>$arrayfields); @@ -471,151 +471,151 @@ $i = 0; $totalarray=array(); while ($i < min($num,$limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($result); $userstatic->id=$obj->rowid; $userstatic->ref=$obj->label; $userstatic->login=$obj->login; $userstatic->statut=$obj->statut; - $userstatic->email=$obj->email; - $userstatic->gender=$obj->gender; - $userstatic->societe_id=$obj->fk_soc; - $userstatic->firstname=$obj->firstname; + $userstatic->email=$obj->email; + $userstatic->gender=$obj->gender; + $userstatic->societe_id=$obj->fk_soc; + $userstatic->firstname=$obj->firstname; $userstatic->lastname=$obj->lastname; $userstatic->employee=$obj->employee; $userstatic->photo=$obj->photo; $li=$userstatic->getNomUrl(-1,'',0,0,24,1,'login'); - print "
        '; + print ''; print $li; - if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) - { - print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); - } - else if ($obj->admin) - { - print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); - } - print ''.$obj->lastname.''.$obj->lastname.''.$obj->firstname.''; if ($obj->gender) print $langs->trans("Gender".$obj->gender); print ''.yn($obj->employee).''.$obj->accountancy_code.''.$obj->email.'"; - if ($obj->fk_soc) - { - $companystatic->id=$obj->fk_soc; - $companystatic->name=$obj->name; - $companystatic->canvas=$obj->canvas; - print $companystatic->getNomUrl(1); - } - else if ($obj->ldap_sid) - { - print $langs->trans("DomainUser"); - } - else - { - print $langs->trans("InternalUser"); - } - print ''; - if (! $obj->entity) - { - print $langs->trans("AllEntities"); - } - else - { - $mc->getInfo($obj->entity); - print $mc->label; - } - print ''; + if (! $obj->entity) + { + print $langs->trans("AllEntities"); + } + else + { + $mc->getInfo($obj->entity); + print $mc->label; + } + print ''; - if ($obj->login2) - { - $user2->id=$obj->id2; - $user2->login=$obj->login2; - $user2->lastname=$obj->lastname2; - $user2->firstname=$obj->firstname2; - $user2->gender=$obj->gender2; - $user2->photo=$obj->photo2; - $user2->admin=$obj->admin2; - $user2->email=$obj->email2; - $user2->socid=$obj->fk_soc2; - print $user2->getNomUrl(-1,'',0,0,24,0,''); - if (! empty($conf->multicompany->enabled) && $obj->admin2 && ! $obj->entity2) - { - print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); - } - else if ($obj->admin2) - { - print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); - } - } - print ''; + if ($obj->login2) + { + $user2->id=$obj->id2; + $user2->login=$obj->login2; + $user2->lastname=$obj->lastname2; + $user2->firstname=$obj->firstname2; + $user2->gender=$obj->gender2; + $user2->photo=$obj->photo2; + $user2->admin=$obj->admin2; + $user2->email=$obj->email2; + $user2->socid=$obj->fk_soc2; + print $user2->getNomUrl(-1,'',0,0,24,0,''); + if (! empty($conf->multicompany->enabled) && $obj->admin2 && ! $obj->entity2) + { + print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); + } + else if ($obj->admin2) + { + print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); + } + } + print ''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").''.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''.$userstatic->getLibStatut(3).''.$userstatic->getLibStatut(3).'
        '.$prelevement->buildRumNumber($object->code_client, $rib->datec, $rib->id).''.$rib->rum.''.$rib->rum.''.$rib->frstrecur.''; - if (!$rib->default_rib) { - print ''; - print img_picto($langs->trans("Disabled"),'off'); - print ''; - } else { - print img_picto($langs->trans("Enabled"),'on'); - } - print ''; + if (!$rib->default_rib) { + print ''; + print img_picto($langs->trans("Disabled"),'off'); + print ''; + } else { + print img_picto($langs->trans("Enabled"),'on'); + } + print ''; + // Generate doc + print ''; - $buttonlabel = $langs->trans("BuildDoc"); - $forname='builddocrib'.$rib->id; + $buttonlabel = $langs->trans("BuildDoc"); + $forname='builddocrib'.$rib->id; - include_once DOL_DOCUMENT_ROOT.'/core/modules/bank/modules_bank.php'; - $modellist=ModeleBankAccountDoc::liste_modeles($db); + include_once DOL_DOCUMENT_ROOT.'/core/modules/bank/modules_bank.php'; + $modellist=ModeleBankAccountDoc::liste_modeles($db); - $out = ''; - if (is_array($modellist) && count($modellist)) - { - $out.= '
        '; - $out.= ''; - $out.= ''; - $out.= ''; - $out.= ''; + $out = ''; + if (is_array($modellist) && count($modellist)) + { + $out.= ''; + $out.= ''; + $out.= ''; + $out.= ''; + $out.= ''; - if (is_array($modellist) && count($modellist) == 1) // If there is only one element - { - $arraykeys=array_keys($modellist); - $modelselected=$arraykeys[0]; - } - if (! empty($conf->global->BANKADDON_PDF)) $modelselected = $conf->global->BANKADDON_PDF; + if (is_array($modellist) && count($modellist) == 1) // If there is only one element + { + $arraykeys=array_keys($modellist); + $modelselected=$arraykeys[0]; + } + if (! empty($conf->global->BANKADDON_PDF)) $modelselected = $conf->global->BANKADDON_PDF; - $out.= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); - $out.= ajax_combobox('modelrib'.$rib->id); + $out.= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100'); + $out.= ajax_combobox('modelrib'.$rib->id); - // Language code (if multilang) - if ($conf->global->MAIN_MULTILANGS) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; - $formadmin=new FormAdmin($db); - $defaultlang=$codelang?$codelang:$langs->getDefaultLang(); - $morecss='maxwidth150'; - if (! empty($conf->browser->phone)) $morecss='maxwidth100'; - $out.= $formadmin->select_language($defaultlang, 'lang_idrib'.$rib->id, 0, 0, 0, 0, 0, $morecss); - } - // Button - $genbutton = 'dol_no_mouse_hover) && $modulepart != 'unpaid') - { - $langs->load("errors"); - $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); - } - if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; - if (empty($modellist) && ! $showempty && $modulepart != 'unpaid') $genbutton=''; - $out.= $genbutton; - $out.= '
        '; - } - print $out; - print '
        '; - if ($user->rights->societe->creer) - { - print ''; - print img_picto($langs->trans("Modify"),'edit'); - print ''; + // Edit/Delete + print ''; + if ($user->rights->societe->creer) + { + print ''; + print img_picto($langs->trans("Modify"),'edit'); + print ''; - print ' '; + print ' '; - print ''; - print img_picto($langs->trans("Delete"),'delete'); - print ''; - } - print '
        '.$langs->trans("NoBANRecord").'
        '.$langs->trans("NoBANRecord").'
        '; - print '
        '; - } else { - dol_print_error($db); - } + print ''; + print '
        '; + } else { + dol_print_error($db); + } - dol_fiche_end(); + dol_fiche_end(); - if ($socid && $action != 'edit' && $action != 'create') - { - /* + if ($socid && $action != 'edit' && $action != 'create') + { + /* * Barre d'actions */ - print '
        '; + print '
        '; - if ($user->rights->societe->creer) - { - print ''.$langs->trans("Add").''; - } + if ($user->rights->societe->creer) + { + print ''.$langs->trans("Add").''; + } - print '
        '; - } + print '
        '; + } - if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) - { - print '
        '; - print ''; // ancre + if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) + { + print '
        '; + print ''; // ancre - /* + /* * Documents generes */ - $filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id; - $urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; - $genallowed=$user->rights->societe->creer; - $delallowed=$user->rights->societe->supprimer; + $filedir=$conf->societe->multidir_output[$object->entity].'/'.$object->id; + $urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; + $genallowed=$user->rights->societe->creer; + $delallowed=$user->rights->societe->supprimer; - $var=true; + $var=true; - print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); + print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang); - print '
        '; + print '
        '; - print '
        '; + print '
        '; - print '
        '; - } - /* + print '
        '; + } + /* include_once DOL_DOCUMENT_ROOT.'/core/modules/bank/modules_bank.php'; $modellist=ModeleBankAccountDoc::liste_modeles($db); //print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e76306fe983..145d16ef8b8 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -194,8 +194,8 @@ if (empty($reshook)) // Validation else if ($action == 'confirm_validate' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->validate_advance))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->validate_advance))) ) { $result = $object->valid($user); @@ -258,7 +258,7 @@ if (empty($reshook)) if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) { $object->ref = GETPOST('ref'); $object->date_livraison = $date_delivery; - $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); + $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); @@ -279,7 +279,7 @@ if (empty($reshook)) $object->ref = GETPOST('ref'); $object->date_livraison = $date_delivery; $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); + $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); @@ -381,7 +381,7 @@ if (empty($reshook)) // Hooks $parameters = array('objFrom' => $srcobject); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + // modified by hook if ($reshook < 0) $error ++; } else { @@ -404,23 +404,23 @@ if (empty($reshook)) { $db->commit(); - // Define output language - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $model=$object->modelpdf; + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; - $ret = $object->fetch($id); // Reload to get new records - $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); - } + $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result < 0) dol_print_error($db,$result); + } header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); exit(); @@ -451,8 +451,8 @@ if (empty($reshook)) // Close proposal else if ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) { - // prevent browser refresh from reopening proposal several times - if ($object->statut == SupplierProposal::STATUS_SIGNED) { + // prevent browser refresh from reopening proposal several times + if ($object->statut == SupplierProposal::STATUS_SIGNED) { $object->setStatut(SupplierProposal::STATUS_CLOSE); } } @@ -465,7 +465,7 @@ if (empty($reshook)) } else { // prevent browser refresh from closing proposal several times if ($object->statut == SupplierProposal::STATUS_VALIDATED) { - $object->cloture($user, GETPOST('statut'), GETPOST('note','none')); + $object->cloture($user, GETPOST('statut'), GETPOST('note','none')); } } } @@ -518,12 +518,12 @@ if (empty($reshook)) // Add a product line if ($action == 'addline' && $user->rights->supplier_proposal->creer) { - $langs->load('errors'); - $error = 0; + $langs->load('errors'); + $error = 0; // Set if we used free entry or predefined product - $predef=''; - $ref_fourn = GETPOST('fourn_ref'); + $predef=''; + $ref_fourn = GETPOST('fourn_ref'); $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); @@ -583,117 +583,117 @@ if (empty($reshook)) // Ecrase $txtva par celui du produit if ((GETPOST('prod_entry_mode') != 'free') && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { - $productsupplier = new ProductFournisseur($db); + $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless - { - $idprod=0; - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - } - if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) - { - $idprod=$reg[1]; - $res=$productsupplier->fetch($idprod); - // Call to init properties of $productsupplier - // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price - $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist - } - elseif (GETPOST('idprodfournprice') > 0) - { - //$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. - $qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); - $res=$productsupplier->fetch($idprod); - } + if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless + { + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) + } + if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + { + $idprod=$reg[1]; + $res=$productsupplier->fetch($idprod); + // Call to init properties of $productsupplier + // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price + $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist + } + elseif (GETPOST('idprodfournprice') > 0) + { + //$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); + } - if ($idprod > 0) - { - $pu_ht = $productsupplier->fourn_pu; - $price_base_type = $productsupplier->fourn_price_base_type; - $type = $productsupplier->type; - $label = $productsupplier->label; - $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); + if ($idprod > 0) + { + $pu_ht = $productsupplier->fourn_pu; + $price_base_type = $productsupplier->fourn_price_base_type; + $type = $productsupplier->type; + $label = $productsupplier->label; + $desc = $productsupplier->description; + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); - $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); - $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); - if (empty($tva_tx)) $tva_npr=0; - $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); - $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); + $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); + $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); + if (empty($tva_tx)) $tva_npr=0; + $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); + $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); - $result=$object->addline( - $desc, - $pu_ht, - $qty, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $productsupplier->id, - $remise_percent, - $price_base_type, - $pu_ttc, - $tva_npr, - $type, - -1, - 0, - GETPOST('fk_parent_line'), - $fournprice, - $buyingprice, - $label, - $array_options, - $ref_fourn, - $fk_unit - ); - //var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit; - } - if ($idprod == -99 || $idprod == 0) - { - // Product not selected - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); - } - if ($idprod == -1) - { - // Quantity too low - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); - } + $result=$object->addline( + $desc, + $pu_ht, + $qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $productsupplier->id, + $remise_percent, + $price_base_type, + $pu_ttc, + $tva_npr, + $type, + -1, + 0, + GETPOST('fk_parent_line'), + $fournprice, + $buyingprice, + $label, + $array_options, + $ref_fourn, + $fk_unit + ); + //var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit; + } + if ($idprod == -99 || $idprod == 0) + { + // Product not selected + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); + } + if ($idprod == -1) + { + // Quantity too low + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); + } } else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) // Free product { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); - $tva_tx = str_replace('*', '', $tva_tx); - $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); - $desc = $product_desc; - $type = GETPOST('type'); + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label') ? GETPOST('product_label') : ''); + $desc = $product_desc; + $type = GETPOST('type'); - $fk_unit= GETPOST('units', 'alpha'); + $fk_unit= GETPOST('units', 'alpha'); - $tva_tx = price2num($tva_tx); // When vat is text input field + $tva_tx = price2num($tva_tx); // When vat is text input field - // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); - $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); + // Local Taxes + $localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); + $localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - if (GETPOST('price_ht')!=='') - { - $price_base_type = 'HT'; - $ht = price2num(GETPOST('price_ht')); - $ttc = 0; - } - else - { - $ttc = price2num(GETPOST('price_ttc')); - $ht = $ttc / (1 + ($tva_tx / 100)); - $price_base_type = 'HT'; - } + if (GETPOST('price_ht')!=='') + { + $price_base_type = 'HT'; + $ht = price2num(GETPOST('price_ht')); + $ttc = 0; + } + else + { + $ttc = price2num(GETPOST('price_ttc')); + $ht = $ttc / (1 + ($tva_tx / 100)); + $price_base_type = 'HT'; + } $result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_fourn, $fk_unit); - //$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit); + //$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit); } @@ -706,9 +706,9 @@ if (empty($reshook)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -716,7 +716,7 @@ if (empty($reshook)) $ret = $object->fetch($id); // Reload to get new records $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) dol_print_error($db,$result); + if ($result < 0) dol_print_error($db,$result); } unset($_POST['prod_entry_mode']); @@ -729,7 +729,7 @@ if (empty($reshook)) unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); - unset($_POST['label']); + unset($_POST['label']); unset($_POST['product_ref']); unset($_POST['product_label']); unset($_POST['product_desc']); @@ -958,9 +958,9 @@ $now = dol_now(); // Add new askprice if ($action == 'create') { - $currency_code = $conf->currency; + $currency_code = $conf->currency; - print load_fiche_titre($langs->trans("NewAskPrice")); + print load_fiche_titre($langs->trans("NewAskPrice")); $soc = new Societe($db); if ($socid > 0) @@ -997,8 +997,8 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled)) { - if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; - if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; + if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; + if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } } else @@ -1036,7 +1036,7 @@ if ($action == 'create') } else { print ''; print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - print ' '.$langs->trans("AddThirdParty").''; + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; @@ -1051,19 +1051,19 @@ if ($action == 'create') $form->select_types_paiements(GETPOST('mode_reglement_id') > 0 ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id'); print ''; - // Bank Account - if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) { - print '' . $langs->trans('BankAccount') . ''; - $form->select_comptes(GETPOST('fk_account')>0 ? GETPOST('fk_account','int') : $fk_account, 'fk_account', 0, '', 1); - print ''; - } + // Bank Account + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) { + print '' . $langs->trans('BankAccount') . ''; + $form->select_comptes(GETPOST('fk_account')>0 ? GETPOST('fk_account','int') : $fk_account, 'fk_account', 0, '', 1); + print ''; + } - // Shipping Method - if (! empty($conf->expedition->enabled)) { - print '' . $langs->trans('SendingMethod') . ''; - print $form->selectShippingMethod(GETPOST('shipping_method_id') > 0 ? GETPOST('shipping_method_id', 'int') : $shipping_method_id, 'shipping_method_id', '', 1); - print ''; - } + // Shipping Method + if (! empty($conf->expedition->enabled)) { + print '' . $langs->trans('SendingMethod') . ''; + print $form->selectShippingMethod(GETPOST('shipping_method_id') > 0 ? GETPOST('shipping_method_id', 'int') : $shipping_method_id, 'shipping_method_id', '', 1); + print ''; + } // Delivery date (or manufacturing) print '' . $langs->trans("DeliveryDate") . ''; @@ -1115,15 +1115,15 @@ if ($action == 'create') { print ''; print ''.fieldLabel('Currency','multicurrency_code').''; - print ''; - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print ''; + print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print ''; } // Other attributes $parameters = array('colspan' => ' colspan="3"'); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } @@ -1181,7 +1181,7 @@ if ($action == 'create') if (! empty($conf->global->SUPPLIER_PROPOSAL_CLONE_ON_CREATE_PAGE)) { - print '
        '; + print '
        '; // For backward compatibility print ''; @@ -1339,34 +1339,34 @@ if ($action == 'create') // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref.='
        '.$langs->trans('Project') . ' '; - if ($user->rights->supplier_proposal->creer) - { - if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } + $langs->load("projects"); + $morehtmlref.='
        '.$langs->trans('Project') . ' '; + if ($user->rights->supplier_proposal->creer) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.=''; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } } $morehtmlref.=''; @@ -1468,17 +1468,17 @@ if ($action == 'create') print '
        '; print ''; if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { - if($action == 'actualizemulticurrencyrate') { + if($action == 'actualizemulticurrencyrate') { list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); - } - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); + } + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); - if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { - print '
                '; - print ''.$langs->trans("ActualizeCurrency").''; - print '
        '; - } + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); + if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { + print '
                '; + print ''.$langs->trans("ActualizeCurrency").''; + print '
        '; + } } print ''; } @@ -1498,22 +1498,22 @@ if ($action == 'create') if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) { - // Bank Account - print ''; - print ''; - if ($action != 'editbankaccount' && $user->rights->supplier_proposal->creer) - print ''; - print '
        '; - print $langs->trans('BankAccount'); - print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
        '; - print ''; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print ''; - print ''; + // Bank Account + print ''; + print ''; + if ($action != 'editbankaccount' && $user->rights->supplier_proposal->creer) + print ''; + print '
        '; + print $langs->trans('BankAccount'); + print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
        '; + print ''; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print ''; + print ''; } // Other attributes @@ -1619,7 +1619,7 @@ if ($action == 'create') include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } - print '
        '; + print '
        '; print ''; // Add free products/services form @@ -1643,7 +1643,7 @@ if ($action == 'create') } print '
        '; - print '
        '; + print '
        '; print "\n"; dol_fiche_end(); @@ -1684,15 +1684,15 @@ if ($action == 'create') $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook + // modified by hook if (empty($reshook)) { if ($action != 'statut' && $action != 'editline') { // Validate if ($object->statut == SupplierProposal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0 && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->creer)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->validate_advance))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->creer)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->validate_advance))) ) { if (count($object->lines) > 0) print ''; @@ -1733,8 +1733,8 @@ if ($action == 'create') // Close if ($object->statut == SupplierProposal::STATUS_SIGNED && $user->rights->supplier_proposal->cloturer) { - print ''; + print ''; } // Clone diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 4438812cc60..fa33f9bae43 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -313,7 +313,7 @@ if ($action == 'add') } */ - //$filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; + //$filename = 'image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $linkwithoutdomain)?'':'/').$linkwithoutdomain; $tmp = preg_replace('/'.preg_quote($regs[0][$key],'/').'/i', '', $tmp); } $objectpage->htmlheader = trim($tmp); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 7daf0dace88..a56c2be2055 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -32,7 +32,7 @@ $path=dirname(__FILE__).'/'; // Test if batch mode if (substr($sapi_type, 0, 3) == 'cgi') { - echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; exit(-1); } @@ -116,10 +116,10 @@ if ($resql) $sql2 = "SELECT mc.rowid, mc.lastname as lastname, mc.firstname as firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag"; $sql2.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql2.= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id; - if ($conf->global->MAILING_LIMIT_SENDBYCLI > 0) - { - $sql2.= " LIMIT ".$conf->global->MAILING_LIMIT_SENDBYCLI; - } + if ($conf->global->MAILING_LIMIT_SENDBYCLI > 0) + { + $sql2.= " LIMIT ".$conf->global->MAILING_LIMIT_SENDBYCLI; + } $resql2=$db->query($sql2); if ($resql2) @@ -157,31 +157,31 @@ if ($resql) // Make subtsitutions on topic and body $other=explode(';',$obj2->other); $tmpfield=explode('=',$other[0],2); $other1=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); - $tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); - $tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); - $tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); - $tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); - $signature = ((!empty($user->signature) && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''); + $tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]); + $signature = ((!empty($user->signature) && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''); - $object = null; // Not defined with mass emailing - $parameters=array('mode'=>'emailing'); - $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount'), $object); // Note: On mass emailing, this is null because we don't know object + $object = null; // Not defined with mass emailing + $parameters=array('mode'=>'emailing'); + $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount'), $object); // Note: On mass emailing, this is null because we don't know object - // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) - $substitutionarray['__ID__'] = $obj->source_id; - $substitutionarray['__EMAIL__'] = $obj->email; - $substitutionarray['__LASTNAME__'] = $obj->lastname; - $substitutionarray['__FIRSTNAME__'] = $obj->firstname; - $substitutionarray['__MAILTOEMAIL__'] = ''.$obj->email.''; - $substitutionarray['__OTHER1__'] = $other1; - $substitutionarray['__OTHER2__'] = $other2; - $substitutionarray['__OTHER3__'] = $other3; - $substitutionarray['__OTHER4__'] = $other4; - $substitutionarray['__OTHER5__'] = $other5; - $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) + // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) + $substitutionarray['__ID__'] = $obj->source_id; + $substitutionarray['__EMAIL__'] = $obj->email; + $substitutionarray['__LASTNAME__'] = $obj->lastname; + $substitutionarray['__FIRSTNAME__'] = $obj->firstname; + $substitutionarray['__MAILTOEMAIL__'] = ''.$obj->email.''; + $substitutionarray['__OTHER1__'] = $other1; + $substitutionarray['__OTHER2__'] = $other2; + $substitutionarray['__OTHER3__'] = $other3; + $substitutionarray['__OTHER4__'] = $other4; + $substitutionarray['__OTHER5__'] = $other5; + $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter) $substitutionarray['__SIGNATURE__'] = $signature; // For backward compatibility - $substitutionarray['__CHECK_READ__'] = ''; - $substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").''; + $substitutionarray['__CHECK_READ__'] = ''; + $substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").''; $onlinepaymentenabled = 0; if (! empty($conf->paypal->enabled)) $onlinepaymentenabled++; @@ -232,22 +232,22 @@ if ($resql) // Fabrication du mail $trackid='emailing-'.$obj2->source_type.$obj2->source_id; $mail = new CMailFile( - $newsubject, - $sendto, - $from, - $newmessage, - array(), - array(), - array(), - '', - '', - 0, - $msgishtml, - $errorsto, - '', - $trackid, - '', - 'emailing' + $newsubject, + $sendto, + $from, + $newmessage, + array(), + array(), + array(), + '', + '', + 0, + $msgishtml, + $errorsto, + '', + $trackid, + '', + 'emailing' ); if ($mail->error) @@ -314,7 +314,7 @@ if ($resql) $error++; } - //Update status communication of contact prospect + //Update status communication of contact prospect $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj2->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; dol_syslog("card.php: set prospect contact status", LOG_DEBUG); @@ -326,9 +326,9 @@ if ($resql) } } - if (!empty($conf->global->MAILING_DELAY)) { - sleep($conf->global->MAILING_DELAY); - } + if (!empty($conf->global->MAILING_DELAY)) { + sleep($conf->global->MAILING_DELAY); + } } } From afdc176f472aa67e667ca481f694c0a5006393ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Oct 2017 08:52:00 +0200 Subject: [PATCH 1128/1137] Fix scrutinizer --- htdocs/adherents/class/subscription.class.php | 2 +- htdocs/api/class/api_documents.class.php | 12 ++++++----- htdocs/blockedlog/class/blockedlog.class.php | 20 +++++++++---------- .../core/class/emailsenderprofile.class.php | 2 ++ htdocs/core/lib/files.lib.php | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index bdb43dd41d3..397be6ee8da 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -216,7 +216,7 @@ class Subscription extends CommonObject $result=$member->fetch($this->fk_adherent); $result=$member->update_end_date($user); - if (is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined) + if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined) { $result=$accountline->delete($user); // Return false if refused because line is conciliated if ($result > 0) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 397910a6e2f..b47584eea99 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -130,18 +130,20 @@ class Documents extends DolibarrApi } /** - * Return the list of documents of an element + * Return the list of documents of a dedicated element (from its ID or Ref) * - * @param string $modulepart Name of module or area concerned ('facture', 'project', 'member', ...) - * @param int $id ID of element + * @param string $modulepart Name of module or area concerned ('facture', 'project', 'member', ...) + * @param int $id ID of element * @param string $ref Ref of element - * @return array Array of documents with path + * @param string $sortfield Sort criteria ('','fullname','relativename','name','date','size') + * @param string $sortorder Sort order ('asc' or 'desc') + * @return array Array of documents with path * * @throws RestException * * @url GET list */ - function getDocumentsListByElement($modulepart, $id=0, $ref='') + function getDocumentsListByElement($modulepart, $id=0, $ref='', $sortfield='', $sortorder='') { global $conf; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 8a1508b7a04..4bce16fb796 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -21,13 +21,15 @@ class BlockedLog { - /** * Id of the log * @var int */ public $id; + public $error = ''; + public $errors = array(); + /** * Unique fingerprint of the log * @var string @@ -78,7 +80,7 @@ class BlockedLog public $object_data = null; - public $error = 0; + /** * Constructor @@ -126,7 +128,7 @@ class BlockedLog /** * try to retrieve user author - */ + */ public function getUser() { global $langs, $cachedUser; @@ -188,8 +190,6 @@ class BlockedLog $this->object_data->amounts = $object->amounts; } - - } /** @@ -231,7 +231,7 @@ class BlockedLog $this->action = $obj->action; $this->element = $obj->element; - $this->fk_object = trim($obj->fk_object); + $this->fk_object = $obj->fk_object; $this->date_object = $this->db->jdate($obj->date_object); $this->ref_object = $obj->ref_object; @@ -432,10 +432,10 @@ class BlockedLog /** * return log object for a element. * - * @param string $element element to search - * @param int $fk_object id of object to search - * @param int $limit max number of element, 0 for all - * @param string $order sort of query + * @param string $element element to search + * @param int $fk_object id of object to search + * @param int $limit max number of element, 0 for all + * @param string $order sort of query * @return array array of object log */ public function getLog($element, $fk_object, $limit = 0, $order = -1) { diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 66e37744cc7..f779e949dc3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -273,6 +273,8 @@ class EmailSenderProfile extends CommonObject $result = ''; $companylink = ''; + $label=$this->label; + $url=''; //$url = dol_buildpath('/monmodule/emailsenderprofile_card.php',1).'?id='.$this->id; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 44a404c6c67..2f59c7e388c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -47,7 +47,7 @@ function dol_basename($pathfile) * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, * but must not contains the start and end '/'. Filter is checked into basename only. * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath. - * @param string $sortcriteria Sort criteria ("","fullname","relativename","name","date","size") + * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only * @param int $nohook Disable all hooks From 87814af7b6170f1501dba0a492a1bc8568a01ccf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Oct 2017 09:29:10 +0200 Subject: [PATCH 1129/1137] Move function colorIsLight into functions.lib.php Fix scrutinizer bugs. --- .../accountancy/class/bookkeeping.class.php | 21 +++++--- htdocs/adherents/class/adherent.class.php | 4 +- .../adherents/class/adherent_type.class.php | 2 +- htdocs/adherents/type.php | 4 +- htdocs/admin/mails_templates.php | 6 +-- htdocs/api/class/api_access.class.php | 4 +- htdocs/api/class/api_documents.class.php | 4 +- htdocs/cashdesk/class/Facturation.class.php | 53 ++++++++++--------- htdocs/categories/class/categorie.class.php | 17 ++---- htdocs/core/db/DoliDB.class.php | 8 +-- htdocs/core/lib/functions.lib.php | 34 ++++++++++++ htdocs/core/lib/functions2.lib.php | 34 ------------ 12 files changed, 99 insertions(+), 92 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 52f7a473bed..2d828298b51 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1079,22 +1079,26 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return number <0 if KO, >0 if OK */ - public function updateByMvt($piece_num='', $field='', $value='', $mode='') { + public function updateByMvt($piece_num='', $field='', $value='', $mode='') + { + $error=0; + $this->db->begin(); + $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . $mode . " as ab"; $sql .= ' SET ab.' . $field . '=' . (is_numeric($value)?$value:"'".$value."'"); $sql .= ' WHERE ab.piece_num=' . $piece_num ; $resql = $this->db->query($sql); if (! $resql) { - $error ++; + $error++; $this->errors[] = 'Error ' . $this->db->lasterror(); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } if ($error) { $this->db->rollback(); - return - 1 * $error; + return -1 * $error; } else { $this->db->commit(); @@ -1521,11 +1525,16 @@ class BookKeeping extends CommonObject * @param string $piece_num Piece num * @return void */ - public function transformTransaction($direction=0,$piece_num='') { + public function transformTransaction($direction=0,$piece_num='') + { + $error = 0; + $this->db->begin(); - if ($direction==0) { + + if ($direction==0) + { $next_piecenum=$this->getNextNumMvt(); - if ($result < 0) { + if ($next_piecenum < 0) { $error++; } $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'(doc_date, doc_type,'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c197d1a2362..33be4abb8e6 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1563,7 +1563,7 @@ class Adherent extends CommonObject * @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) * @param int $maxlen length max label * @param string $option Page for link ('card', 'category', 'subscription', ...) - * @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref + * @param string $mode ''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref * @param string $morecss Add more css on link * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string Chaine avec URL @@ -1574,6 +1574,8 @@ class Adherent extends CommonObject if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0; + $notooltip=0; + $result=''; $label=''; $link=''; $linkstart=''; $linkend=''; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 99c343a1ff0..f65e363cef9 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -167,7 +167,7 @@ class AdherentType extends CommonObject $sql.= "libelle = '".$this->db->escape($this->label) ."',"; $sql.= "subscription = '".$this->db->escape($this->subscription)."',"; $sql.= "note = '".$this->db->escape($this->note)."',"; - $sql.= "vote = '".$this->db->escape($this->vote)."',"; + $sql.= "vote = ".(integer) $this->db->escape($this->vote).","; $sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'"; $sql.= " WHERE rowid =".$this->id; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index c9edce35f60..7eaefa6fc33 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -107,7 +107,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) $object->subscription = (int) trim($subscription); $object->note = trim($comment); $object->mail_valid = trim($mail_valid); - $object->vote = (boolean) trim($vote); + $object->vote = trim($vote); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -160,7 +160,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object->subscription = (int) trim($subscription); $object->note = trim($comment); $object->mail_valid = trim($mail_valid); - $object->vote = (boolean) trim($vote); + $object->vote = trim($vote); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 111084388ce..4e25e93084b 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1019,9 +1019,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } print ''; } - elseif ($context == 'add' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; - elseif ($context == 'edit' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; - elseif ($context == 'hide' & in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; + elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; + elseif ($context == 'edit' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; + elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue; else { $size=''; $class=''; $classtd=''; diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index b2dcfefa49f..5848620f735 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -83,10 +83,10 @@ class DolibarrApiAccess implements iAuthenticate // api key can be provided in url with parameter api_key=xxx or ni header with header DOLAPIKEY:xxx $api_key = ''; - if (isset($_GET['api_key'])) + if (isset($_GET['api_key'])) // For backward compatibility { // TODO Add option to disable use of api key on url. Return errors if used. - $api_key = $_GET['api_key']; // For backward compatibility + $api_key = $_GET['api_key']; } if (isset($_GET['DOLAPIKEY'])) { diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index b47584eea99..92b48dfd0c6 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -256,9 +256,11 @@ class Documents extends DolibarrApi // Define $uploadir $object = null; - $entity = $user->entity; + $entity = DolibarrApiAccess::$user->entity; if ($ref) { + $tmpreldir=''; + if ($modulepart == 'facture' || $modulepart == 'invoice') { $modulepart='facture'; diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index b55524a874a..8bfd1d3082c 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -117,7 +117,7 @@ class Facturation } // Define part of HT, VAT, TTC - $resultarray=calcul_price_total($this->qte, $this->prix(), $this->remisePercent(), $txtva, -1, -1, 0, 'HT', $use_npr, $product->type, $mysoc, $localtaxarray); + $resultarray=calcul_price_total($this->qte, $this->prix(), $this->remisePercent(), $txtva, -1, -1, 0, 'HT', $vat_npr, $product->type, $mysoc, $localtaxarray); // Calcul du total ht sans remise $total_ht = $resultarray[0]; @@ -207,6 +207,9 @@ class Facturation $total_ht=0; $total_ttc=0; + $total_vat = 0; + $total_localtax1 = 0; + $total_localtax2 = 0; $tab=array(); $tab = $_SESSION['poscart']; @@ -309,7 +312,7 @@ class Facturation public function ref($aRef=null) { - if ( !$aRef ) + if (is_null($aRef)) { return $this->ref; } @@ -330,9 +333,9 @@ class Facturation * @param int $aQte Qty * @return int Qty */ - public function qte( $aQte=null ) + public function qte($aQte=null) { - if ( !$aQte ) + if (is_null($aQte)) { return $this->qte; } @@ -357,7 +360,7 @@ class Facturation public function stock($aStock=null) { - if ( !$aStock ) + if (is_null($aStock)) { return $this->stock; } @@ -381,7 +384,7 @@ class Facturation public function remisePercent($aRemisePercent=null) { - if ( !$aRemisePercent ) + if (is_null($aRemisePercent)) { return $this->remise_percent; } @@ -405,7 +408,7 @@ class Facturation public function montantRemise($aMontantRemise=null) { - if ( !$aMontantRemise ) { + if (is_null($aMontantRemise)) { return $this->montant_remise; @@ -427,10 +430,10 @@ class Facturation * @param int $aPrix Price * @return string Stock */ - public function prix ( $aPrix=null ) + public function prix($aPrix=null) { - if ( !$aPrix ) { + if (is_null($aPrix)) { return $this->prix; @@ -454,7 +457,7 @@ class Facturation */ public function tva($aTva=null) { - if ( !$aTva ) { + if (is_null($aTva)) { return $this->tva; @@ -478,7 +481,7 @@ class Facturation */ public function numInvoice($aNumFacture=null) { - if ( !$aNumFacture ) { + if (is_null($aNumFacture)) { return $this->num_facture; @@ -499,10 +502,10 @@ class Facturation * @param int $aModeReglement Payment mode * @return int Payment mode */ - public function getSetPaymentMode( $aModeReglement=null ) + public function getSetPaymentMode($aModeReglement=null) { - if ( !$aModeReglement ) { + if (is_null($aModeReglement)) { return $this->mode_reglement; @@ -524,10 +527,10 @@ class Facturation * @param int $aMontantEncaisse Amount * @return int Amount */ - public function montantEncaisse( $aMontantEncaisse=null ) + public function montantEncaisse($aMontantEncaisse=null) { - if ( !$aMontantEncaisse ) { + if (is_null($aMontantEncaisse)) { return $this->montant_encaisse; @@ -549,10 +552,10 @@ class Facturation * @param int $aMontantRendu Amount * @return int Amount */ - public function montantRendu( $aMontantRendu=null ) + public function montantRendu($aMontantRendu=null) { - if ( !$aMontantRendu ) { + if (is_null($aMontantRendu)) { return $this->montant_rendu; } else if ( $aMontantRendu == 'RESET' ) { @@ -573,9 +576,9 @@ class Facturation * @param date $aPaiementLe Date * @return date Date */ - public function paiementLe( $aPaiementLe=null ) + public function paiementLe($aPaiementLe=null) { - if ( !$aPaiementLe ) { + if (is_null($aPaiementLe)) { return $this->paiement_le; @@ -596,9 +599,9 @@ class Facturation * @param int $aTotalHt Total amount * @return int Total amount */ - public function prixTotalHt( $aTotalHt=null ) + public function prixTotalHt($aTotalHt=null) { - if ( !$aTotalHt ) { + if (is_null($aTotalHt)) { return $this->prix_total_ht; @@ -619,9 +622,9 @@ class Facturation * @param int $aMontantTva Amount vat * @return int Amount vat */ - public function montantTva( $aMontantTva=null ) + public function montantTva($aMontantTva=null) { - if ( !$aMontantTva ) { + if (is_null($aMontantTva)) { return $this->montant_tva; @@ -643,9 +646,9 @@ class Facturation * @param int $aTotalTtc Amount ttc * @return int Amount ttc */ - public function prixTotalTtc( $aTotalTtc=null ) + public function prixTotalTtc($aTotalTtc=null) { - if ( !$aTotalTtc ) + if (is_null($aTotalTtc)) { return $this->prix_total_ttc; } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6242691d1f1..7a7a6f06a1f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -163,7 +163,7 @@ class Categorie extends CommonObject */ public $socid; /** - * @var int Category type + * @var string Category type * * @see Categorie::TYPE_PRODUCT * @see Categorie::TYPE_SUPPLIER @@ -1327,6 +1327,7 @@ class Categorie extends CommonObject { $w = array(); $i = 0; + $forced_color=''; foreach ($way as $cat) { $i++; @@ -1340,12 +1341,7 @@ class Categorie extends CommonObject $forced_color='categtextwhite'; if ($cat->color) { - $hex=$cat->color; - $r = hexdec($hex[0].$hex[1]); - $g = hexdec($hex[2].$hex[3]); - $b = hexdec($hex[4].$hex[5]); - $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm - if ($bright >= 0.5) $forced_color='categtextblack'; // Higher than 60% + if (colorIsLight($cat->color)) $forced_color='categtextblack'; } } } @@ -1602,12 +1598,7 @@ class Categorie extends CommonObject $forced_color='categtextwhite'; if ($this->color) { - $hex=$this->color; - $r = hexdec($hex[0].$hex[1]); - $g = hexdec($hex[2].$hex[3]); - $b = hexdec($hex[4].$hex[5]); - $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm - if ($bright >= 0.5) $forced_color='categtextblack'; // Higher than 60% + if (colorIsLight($this->color)) $forced_color='categtextblack'; } $link = ''; diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 9fc1739334c..99b799d5d6e 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -59,7 +59,7 @@ abstract class DoliDB implements Database public $lastqueryerror; /** @var string Last error message */ public $lasterror; - /** @var int Last error number */ + /** @var string Last error number. For example: 'DB_ERROR_RECORD_ALREADY_EXISTS', '12345', ... */ public $lasterrno; /** @var bool Status */ @@ -238,16 +238,16 @@ abstract class DoliDB implements Database else $return.=', '; $return.=preg_replace('/[^0-9a-z_\.]/i','',$val); - + $tmpsortorder = trim($orders[$i]); - + // Only ASC and DESC values are valid SQL if (strtoupper($tmpsortorder) === 'ASC') { $return .= ' ASC'; } elseif (strtoupper($tmpsortorder) === 'DESC') { $return .= ' DESC'; } - + $i++; } return $return; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f56cd2f523d..2626e917460 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6791,3 +6791,37 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield=' return ''; } } + +/** + * Return true if the color is light + * + * @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') + * @return int -1 : Error with argument passed |0 : color is dark | 1 : color is light + */ +function colorIsLight($stringcolor) +{ + $res = -1; + if (!empty($stringcolor)) + { + $res = 0; + $tmp=explode(',', $stringcolor); + if (count($tmp) > 1) // This is a comma RGB ('255','255','255') + { + $r = $tmp[0]; + $g = $tmp[1]; + $b = $tmp[2]; + } + else + { + $hexr=$stringcolor[0].$stringcolor[1]; + $hexg=$stringcolor[2].$stringcolor[3]; + $hexb=$stringcolor[4].$stringcolor[5]; + $r = hexdec($hexr); + $g = hexdec($hexg); + $b = hexdec($hexb); + } + $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm + if ($bright > 0.6) $res = 1; + } + return $res; +} diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 3d2e2bb359b..98d113525c1 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2153,40 +2153,6 @@ function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88)) return array(hexdec($reg[1]),hexdec($reg[2]),hexdec($reg[3])); } -/** - * Return true if the color is light - * - * @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') - * @return int -1 : Error with argument passed |0 : color is dark | 1 : color is light - */ -function colorIsLight($stringcolor) -{ - $res = -1; - if (!empty($stringcolor)) - { - $res = 0; - $tmp=explode(',', $stringcolor); - if (count($tmp) > 1) // This is a comma RGB ('255','255','255') - { - $r = $tmp[0]; - $g = $tmp[1]; - $b = $tmp[2]; - } - else - { - $hexr=$stringcolor[0].$stringcolor[1]; - $hexg=$stringcolor[2].$stringcolor[3]; - $hexb=$stringcolor[4].$stringcolor[5]; - $r = hexdec($hexr); - $g = hexdec($hexg); - $b = hexdec($hexb); - } - $bright = (max($r, $g, $b) + min($r, $g, $b)) / 510.0; // HSL algorithm - if ($bright > 0.6) $res = 1; - } - return $res; -} - /** * Applies the Cartesian product algorithm to an array * Source: http://stackoverflow.com/a/15973172 From 82348cc1e9edb703e0d0be293f9f489c8fbb31e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Oct 2017 10:17:57 +0200 Subject: [PATCH 1130/1137] NEW Can filter on date on the page showing existing bindings --- htdocs/accountancy/customer/lines.php | 31 +++++++++++++++++++- htdocs/accountancy/customer/list.php | 1 + htdocs/accountancy/expensereport/lines.php | 33 +++++++++++++++++++++- htdocs/accountancy/expensereport/list.php | 1 + htdocs/accountancy/supplier/lines.php | 33 +++++++++++++++++++++- htdocs/accountancy/supplier/list.php | 1 + 6 files changed, 97 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 0e3e71c1527..13602160c48 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -32,6 +32,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; // Langs $langs->load("bills"); @@ -51,6 +53,9 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); +$search_day=GETPOST("search_day","int"); +$search_month=GETPOST("search_month","int"); +$search_year=GETPOST("search_year","int"); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); @@ -95,6 +100,9 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_amount = ''; $search_account = ''; $search_vat = ''; + $search_day = ''; + $search_month = ''; + $search_year = ''; $search_country = ''; $search_tvaintra = ''; } @@ -131,6 +139,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { */ $form = new Form($db); +$formother = new FormOther($db); llxHeader('', $langs->trans("CustomersVentilation") . ' - ' . $langs->trans("Dispatched")); @@ -197,6 +206,19 @@ if (strlen(trim($search_account))) { if (strlen(trim($search_vat))) { $sql .= natural_search("fd.tva_tx", $search_vat); } +if ($search_month > 0) +{ + if ($search_year > 0 && empty($search_day)) + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; + else if ($search_year > 0 && ! empty($search_day)) + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; + else + $sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'"; +} +else if ($search_year > 0) +{ + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'"; +} if (strlen(trim($search_country))) { $sql .= natural_search("co.label", $search_country); } @@ -237,6 +259,9 @@ if ($result) { $param .= "&search_account=" . $search_account; if ($search_vat) $param .= "&search_vat=" . $search_vat; + if ($search_day) $param.='&search_day='.urlencode($search_day); + if ($search_month) $param.='&search_month='.urlencode($search_month); + if ($search_year) $param.='&search_year='.urlencode($search_year); if ($search_country) $param .= "&search_country=" . $search_country; if ($search_tvaintra) @@ -267,7 +292,11 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_year,'search_year',1, 20, 5); + print ''; print ''; //print ''; print ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 51f62ecabf6..2d26a2d06d8 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -115,6 +115,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_amount = ''; $search_account = ''; $search_vat = ''; + $search_day = ''; $search_month = ''; $search_year = ''; } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 156d80f09e4..750a5bc9f25 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; // Langs $langs->load("compta"); @@ -50,6 +52,9 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); +$search_day=GETPOST("search_day","int"); +$search_month=GETPOST("search_month","int"); +$search_year=GETPOST("search_year","int"); // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -90,6 +95,9 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_amount = ''; $search_account = ''; $search_vat = ''; + $search_day = ''; + $search_month = ''; + $search_year = ''; } if (is_array($changeaccount) && count($changeaccount) > 0) { @@ -123,6 +131,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { * View */ +$form = new Form($db); +$formother = new FormOther($db); + llxHeader('', $langs->trans("ExpenseReportsVentilation") . ' - ' . $langs->trans("Dispatched")); print ''."\n"; - $out .= ' '."\n"; + $out .= ' '."\n"; } return $out; } + /** * Returns the rights used for this class * @return stdClass diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2ea2447f5bc..7130287b6bd 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -806,13 +806,13 @@ class ExtraFields * @param string $key Key of attribute * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) * @param string $moreparam To add more parametes on html input tag - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @param mixed $showsize Value for css to define size. May also be a numeric. * @param int $objectid Current object id * @return string */ - function showInputField($key, $value, $moreparam='', $keyprefix='', $keysuffix='', $showsize=0, $objectid=0) + function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0, $objectid=0) { global $conf,$langs; @@ -831,51 +831,51 @@ class ExtraFields if ($computed) { - if ($keysuffix != 'search_') return ''.$langs->trans("AutomaticallyCalculated").''; - else return ''; + if ($keyprefix != 'search_') return ''.$langs->trans("AutomaticallyCalculated").''; + else return ''; } if (empty($showsize)) { - if ($type == 'date') - { - //$showsize=10; - $showsize = 'minwidth100imp'; - } + if ($type == 'date') + { + //$showsize=10; + $showsize = 'minwidth100imp'; + } elseif ($type == 'datetime') - { - //$showsize=19; - $showsize = 'minwidth200imp'; - } - elseif (in_array($type,array('int','double','price'))) - { - //$showsize=10; - $showsize = 'maxwidth75'; - } - elseif ($type == 'url') - { - $showsize='minwidth400'; - } - elseif ($type == 'boolean') - { - $showsize=''; - } - else - { - if (round($size) < 12) - { - $showsize = 'minwidth100'; - } - else if (round($size) <= 48) - { - $showsize = 'minwidth200'; - } - else - { - //$showsize=48; - $showsize = 'minwidth400'; - } - } + { + //$showsize=19; + $showsize = 'minwidth200imp'; + } + elseif (in_array($type,array('int','double','price'))) + { + //$showsize=10; + $showsize = 'maxwidth75'; + } + elseif ($type == 'url') + { + $showsize='minwidth400'; + } + elseif ($type == 'boolean') + { + $showsize=''; + } + else + { + if (round($size) < 12) + { + $showsize = 'minwidth100'; + } + else if (round($size) <= 48) + { + $showsize = 'minwidth200'; + } + else + { + //$showsize=48; + $showsize = 'minwidth400'; + } + } } if (in_array($type,array('date','datetime'))) @@ -893,26 +893,26 @@ class ExtraFields if (! is_object($form)) $form=new Form($this->db); // TODO Must also support $moreparam - $out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, ($keysuffix != 'search_' ? 1 : 0), 1, 0, 1); + $out = $form->select_date($value, $keyprefix.'options_'.$key.$keysuffix, $showtime, $showtime, $required, '', 1, ($keyprefix != 'search_' ? 1 : 0), 1, 0, 1); } elseif (in_array($type,array('int'))) { $tmp=explode(',',$size); $newsize=$tmp[0]; - $out=''; + $out=''; } elseif ($type == 'varchar') { - $out=''; + $out=''; } elseif (in_array($type, array('mail', 'phone', 'url'))) { - $out=''; + $out=''; } elseif ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($keysuffix.'options_'.$key.$keyprefix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_5,'90%'); + $doleditor=new DolEditor($keyprefix.'options_'.$key.$keysuffix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_5,'90%'); $out=$doleditor->Create(1); } elseif ($type == 'boolean') @@ -923,21 +923,21 @@ class ExtraFields } else { $checked=' value="1" '; } - $out=''; + $out=''; } elseif ($type == 'price') { if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value=price($value); } - $out=' '.$langs->getCurrencySymbol($conf->currency); + $out=' '.$langs->getCurrencySymbol($conf->currency); } elseif ($type == 'double') { if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. $value=price($value); } - $out=' '; + $out=' '; } elseif ($type == 'select') { @@ -945,10 +945,10 @@ class ExtraFields if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), 0); + $out.= ajax_combobox($keyprefix.'options_'.$key.$keysuffix, array(), 0); } - $out.=''; $out.=''; foreach ($param['options'] as $key => $val) { @@ -967,10 +967,10 @@ class ExtraFields if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($keysuffix.'options_'.$key.$keyprefix, array(), 0); + $out.= ajax_combobox($keyprefix.'options_'.$key.$keysuffix, array(), 0); } - $out.=''; if (is_array($param['options'])) { $param_list=array_keys($param['options']); @@ -1132,7 +1132,7 @@ class ExtraFields $form = new Form($db); $value_arr=explode(',',$value); - $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, (empty($param['options'])?null:$param['options']), $value_arr, '', 0, '', 0, '100%'); + $out=$form->multiselectarray($keyprefix.'options_'.$key.$keysuffix, (empty($param['options'])?null:$param['options']), $value_arr, '', 0, '', 0, '100%'); } elseif ($type == 'radio') @@ -1140,11 +1140,11 @@ class ExtraFields $out=''; foreach ($param['options'] as $keyopt => $val) { - $out.=''.$val.'
        '; + $out.='/>
        '; } } elseif ($type == 'chkbxlst') @@ -1268,15 +1268,15 @@ class ExtraFields if (empty($labeltoshow)) $labeltoshow = '(not defined)'; - if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { + if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { + $data[$obj->rowid]=$labeltoshow; + } + + if (! empty($InfoFieldList[3])) { + $parent = $parentName . ':' . $obj->{$parentField}; + } + $data[$obj->rowid]=$labeltoshow; - } - - if (! empty($InfoFieldList[3])) { - $parent = $parentName . ':' . $obj->{$parentField}; - } - - $data[$obj->rowid]=$labeltoshow; } $i ++; @@ -1286,7 +1286,7 @@ class ExtraFields require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $form = new Form($db); - $out=$form->multiselectarray($keysuffix.'options_'.$key.$keyprefix, $data, $value_arr, '', 0, '', 0, '100%'); + $out=$form->multiselectarray($keyprefix.'options_'.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); } else { print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.
        '; @@ -1305,40 +1305,41 @@ class ExtraFields dol_include_once($InfoFieldList[1]); if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) { - $valuetoshow=$value; - if (!empty($value)) - { - $object = new $InfoFieldList[0]($this->db); - $resfetch=$object->fetch($value); - if ($resfetch > 0) - { - $valuetoshow=$object->ref; - if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ->ref is not name but id (because name is not unique) - } - } - $out.=''; + $valuetoshow=$value; + if (!empty($value)) + { + $object = new $InfoFieldList[0]($this->db); + $resfetch=$object->fetch($value); + if ($resfetch > 0) + { + $valuetoshow=$object->ref; + if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ->ref is not name but id (because name is not unique) + } + } + $out.=''; } else { - dol_syslog('Error bad setup of extrafield', LOG_WARNING); - $out.='Error bad setup of extrafield'; + dol_syslog('Error bad setup of extrafield', LOG_WARNING); + $out.='Error bad setup of extrafield'; } } elseif ($type == 'password') { // If prefix is 'search_', field is used as a filter, we use a common text field. - $out=''; + $out=''; } if (!empty($hidden)) { - $out=''; + $out=''; } /* Add comments if ($type == 'date') $out.=' (YYYY-MM-DD)'; - elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; - */ + elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; + */ return $out; } + /** * Return HTML string to put an output field into a page * From 51ce8bf2a5741ae0bcca4b76e4d1f5ce96d1010e Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 16 Oct 2017 21:08:09 +0200 Subject: [PATCH 1137/1137] js --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a07a95f1e6d..d33dca39ee1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4713,7 +4713,7 @@ abstract class CommonObject } $out .= "\n"; // Add code to manage list depending on others - if (! empty($conf->use_javascript_ajax)) + if (! empty($conf->use_javascript_ajax)) { $out .= ' '."\n"; $out .= ' '."\n"; + } } return $out; }