diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index ebfe0c4834b..3ae699709af 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -327,7 +327,7 @@ if ($modecompta == 'CREANCES-DETTES') { $var=!$var; print ""; - // Third party + // Product $fullname=$name[$key]; if ($key >= 0) { $linkname=''.img_object($langs->trans("ShowProduct"),'product').' '.$fullname.''; @@ -339,23 +339,24 @@ if ($modecompta == 'CREANCES-DETTES') { // Amount w/o VAT print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount_ht[$key]); + //print ''; print ''; // Amount with VAT print ''; - if ($key > 0) { + /*if ($key > 0) { print ''; } else { print ''; - } + }*/ print price($amount[$key]); - print ''; + //print ''; print ''; // Percent; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d33f8546f8a..0d2e3163be6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -207,7 +207,7 @@ class FormFile return $this->getDocumentsLink($modulepart, $filename, $filedir); } $printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false; - + $hookmanager->initHooks(array('formfile')); $forname='builddoc'; $out=''; $var=true; @@ -450,14 +450,18 @@ class FormFile $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=''; - $out.= $genbutton; $out.= ''; if ($printer) $out.= ''; - + if($hookmanager->hooks['formfile']) + { + foreach($hookmanager->hooks['formfile'] as $module) + { + if(method_exists($module, 'formBuilddocLineOptions')) $out .= ''; + } + } $out.= ''; // Execute hooks @@ -529,6 +533,7 @@ class FormFile $out.= ($param?'&'.$param:''); $out.= '">'.img_printer().''; } + if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file); } $out.= ''; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index ceaa41b404c..fa0e48556c8 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -198,6 +198,7 @@ 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->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+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__); 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 || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.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 || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 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->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 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->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, '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->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -- Check deposit diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index b7a12f34262..5ab46b6c4f2 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -66,4 +66,4 @@ ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_ob DROP table llx_adherent_options; DROP table llx_adherent_options_label; - +ALTER TABLE `llx_user` ADD `accountancy_code` VARCHAR( 24 ) NULL; diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index ae7fddc28be..6c83994a936 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -1,51 +1,51 @@ --- =================================================================== --- Copyright (C) 2013 Laurent Destailleur --- 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 . --- --- =================================================================== - - -CREATE TABLE llx_cronjob -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - datec datetime, - jobtype varchar(10) NOT NULL, - label text NOT NULL, - command varchar(255), - classesname varchar(255), - objectname varchar(255), - methodename varchar(255), - params text NOT NULL, - md5params varchar(32), - module_name varchar(255), - priority integer DEFAULT 0, - datelastrun datetime, - datenextrun datetime, - datestart datetime, - dateend datetime, - datelastresult datetime, - lastresult text, - lastoutput text, - unitfrequency integer NOT NULL DEFAULT 0, - frequency integer NOT NULL DEFAULT 0, - nbrun integer, - status integer NOT NULL DEFAULT 1, - fk_user_author integer DEFAULT NULL, - fk_user_mod integer DEFAULT NULL, - note text - +-- =================================================================== +-- Copyright (C) 2013 Laurent Destailleur +-- 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 . +-- +-- =================================================================== + + +CREATE TABLE llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text + )ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 6042b0906ce..9fd1db59c91 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -62,5 +62,6 @@ create table llx_user statut tinyint DEFAULT 1, photo varchar(255), -- filename or url of photo lang varchar(6), - color varchar(6) + color varchar(6), + accountancy_code varchar(24) NULL )ENGINE=innodb; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 8253c98860d..97b18be18d3 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -226,6 +226,7 @@ if ($search_all) $sql.= " OR s.code_client LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_all)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_all)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($search_all)."%'"; $sql.= ")"; } if ($search_nom) @@ -235,6 +236,7 @@ if ($search_nom) $sql.= " OR s.code_client LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.email LIKE '%".$db->escape($search_nom)."%'"; $sql.= " OR s.url LIKE '%".$db->escape($search_nom)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($search_nom)."%'"; $sql.= ")"; } if ($search_town) $sql .= " AND s.town LIKE '%".$db->escape($search_town)."%'"; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a98e5c5dbd8..39fc2132042 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -96,6 +96,8 @@ class User extends CommonObject var $users; // To store all tree of users hierarchy var $parentof; // To store an array of all parents for all ids. + + var $accountancy_code; // Accountancy code in prevision of the complete accountancy module /** @@ -149,6 +151,7 @@ class User extends CommonObject $sql.= " u.datepreviouslogin as datep,"; $sql.= " u.photo as photo,"; $sql.= " u.openid as openid,"; + $sql.= " u.accountancy_code,"; $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -209,6 +212,7 @@ class User extends CommonObject $this->openid = $obj->openid; $this->lang = $obj->lang; $this->entity = $obj->entity; + $this->accountancy_code = $obj->accountancy_code; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -1114,6 +1118,7 @@ class User extends CommonObject $this->address = empty($this->address)?'':$this->address; $this->zip = empty($this->zip)?'':$this->zip; $this->town = empty($this->town)?'':$this->town; + $this->accountancy_code = trim($this->accountancy_code); // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1142,6 +1147,7 @@ class User extends CommonObject $sql.= ", email = '".$this->db->escape($this->email)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; + $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 53de51df268..66cb62ef362 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -188,6 +188,7 @@ if ($action == 'add' && $canadduser) $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->note = GETPOST("note"); $object->ldap_sid = GETPOST("ldap_sid"); @@ -324,6 +325,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->openid = GETPOST("openid"); $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; @@ -1192,6 +1194,10 @@ else } print ''; print "\n"; + + // Accountancy code + print ''.$langs->trans("AccountancyCode").''; + print ''.$object->accountancy_code.''; // Status print ''.$langs->trans("Status").''; @@ -1821,6 +1827,21 @@ else } print ''; print "\n"; + + // Accountancy code + print ""; + print ''.$langs->trans("AccountancyCode").''; + print ''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print ''; // Status print ''.$langs->trans("Status").'';