diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index b07f76a22df..6074a49f537 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -69,7 +69,15 @@ class BookKeeping extends CommonObject public $doc_date; public $date_lim_reglement; - public $doc_type; + + /** + * @var string doc_type + */ + public $doc_type; + + /** + * @var string doc_ref + */ public $doc_ref; /** @@ -82,12 +90,35 @@ class BookKeeping extends CommonObject */ public $fk_docdet; - public $thirdparty_code; + /** + * @var string thirdparty code + */ + public $thirdparty_code; + + /** + * @var string subledger account + */ public $subledger_account; + + /** + * @var string subledger label + */ public $subledger_label; + + /** + * @var string doc_type + */ public $numero_compte; - public $label_compte; - public $label_operation; + + /** + * @var string label compte + */ + public $label_compte; + + /** + * @var string label operation + */ + public $label_operation; public $debit; public $credit; public $montant; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 6774a4042b8..1898a270222 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -231,9 +231,10 @@ $disable_delete = 0; // Bank account if (! empty($conf->banque->enabled)) { + $bankline=new AccountLine($db); + if ($object->fk_account > 0) { - $bankline=new AccountLine($db); $bankline->fetch($object->bank_line); if ($bankline->rappro) { diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index b0c97265682..f3c5a10e95b 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -10,7 +10,7 @@ if (empty($conf) || ! is_object($conf)) if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; // Loop to complete the sql search criterias from extrafields -if (! empty($extrafieldsobjectkey) && ! empty($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... +if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... { foreach ($search_array_options as $key => $val) { diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index 08d7eded1ad..ec8e687203f 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -89,9 +89,9 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'29','Group insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'31','Personne morale de droit étranger, immatriculée au RCS'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'32','Personne morale de droit étranger, non immatriculée au RCS'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'35','Régime auto-entrepreneur'); - + insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'41','Etablissement public ou régie à caractère industriel ou commercial'); - + insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'51','Société coopérative commerciale particulière'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'52','Société en nom collectif'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'53','Société en commandite'); @@ -108,18 +108,18 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'63','Soci insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'64','Société non commerciale d assurances'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'65','Société civile'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'69','Personnes de droit privé inscrites au RCS'); - + insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'71','Administration de l état'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'72','Collectivité territoriale'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'73','Etablissement public administratif'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'74','Personne morale de droit public administratif'); - + insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'81','Organisme gérant régime de protection social à adhésion obligatoire'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'82','Organisme mutualiste'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'83','Comité d entreprise'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'84','Organisme professionnel'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'85','Organisme de retraite à adhésion non obligatoire'); - + insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'91','Syndicat de propriétaires'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'92','Association loi 1901 ou assimilé'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'93','Fondation'); @@ -159,6 +159,17 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '506', 'KG insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '507', 'Ltd. - Limited Company'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '508', 'OHG - Offene Handelsgesellschaft'); +-- Denmark +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8001', 'Aktieselvskab A/S'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8002', 'Anparts Selvskab ApS'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8003', 'Personlig ejet selvskab'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8004', 'Iværksætterselvskab IVS'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8005', 'Interessentskab I/S'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8006', 'Holdingselskab'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8007', 'Selskab Med Begrænset Hæftelse SMBA'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8008', 'Kommanditselskab K/S'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8009', 'SPE-selskab'); + -- Greece INSERT INTO llx_c_forme_juridique (code,fk_pays,libelle,isvatexempted,active) VALUES ('10201',102,'Ατομική επιχείρηση',0,1); INSERT INTO llx_c_forme_juridique (code,fk_pays,libelle,isvatexempted,active) VALUES ('10202',102,'Εταιρική επιχείρηση',0,1); @@ -313,4 +324,5 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17802', 'Asociación General', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17803', 'Sociedad de Responsabilidad Limitada', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17804', 'Sociedad Civil', 1); -INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17805', 'Sociedad Anónima', 1); \ No newline at end of file +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17805', 'Sociedad Anónima', 1); + diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 0c9498fb594..123badcd901 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -72,6 +72,16 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8001', 'Aktieselvskab A/S'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8002', 'Anparts Selvskab ApS'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8003', 'Personlig ejet selvskab'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8004', 'Iværksætterselvskab IVS'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8005', 'Interessentskab I/S'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8006', 'Holdingselskab'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8007', 'Selskab Med Begrænset Hæftelse SMBA'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8008', 'Kommanditselskab K/S'); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (80, '8009', 'SPE-selskab'); + ALTER TABLE llx_payment_salary ADD COLUMN ref varchar(30) NULL after rowid; ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount; @@ -142,26 +152,26 @@ UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL; CREATE TABLE llx_emailcollector_emailcollector( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - entity integer DEFAULT 1 NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + entity integer DEFAULT 1 NOT NULL, ref varchar(128) NOT NULL, - label varchar(255), + label varchar(255), description text, - host varchar(255), - user varchar(128), + host varchar(255), + user varchar(128), password varchar(128), source_directory varchar(255) NOT NULL, target_directory varchar(255), - datelastresult datetime, - codelastresult varchar(16), + datelastresult datetime, + codelastresult varchar(16), lastresult varchar(255), - note_public text, - note_private text, - date_creation datetime NOT NULL, - tms timestamp NOT NULL, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp NOT NULL, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), status integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; @@ -174,28 +184,28 @@ CREATE TABLE llx_emailcollector_emailcollectoraction( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, fk_emailcollector INTEGER NOT NULL, - type varchar(128) NOT NULL, - actionparam varchar(255) NULL, - date_creation datetime NOT NULL, - tms timestamp NOT NULL, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), + type varchar(128) NOT NULL, + actionparam varchar(255) NULL, + date_creation datetime NOT NULL, + tms timestamp NOT NULL, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), status integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; CREATE TABLE llx_emailcollector_emailcollectorfilter( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, fk_emailcollector INTEGER NOT NULL, - type varchar(128) NOT NULL, - rulevalue varchar(255) NULL, - date_creation datetime NOT NULL, - tms timestamp NOT NULL, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), + type varchar(128) NOT NULL, + rulevalue varchar(255) NULL, + date_creation datetime NOT NULL, + tms timestamp NOT NULL, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), status integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 9766935d4d0..ae30ac43dae 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -177,7 +177,7 @@ class ProjectStats extends Stats if (! empty($this->status)) $sqlwhere[] = " t.fk_opp_status IN (" . $this->status . ")"; - if (! $user->rights->projet->all->lire) $sqlwhere[] = " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users + if (! $user->rights->projet->all->lire) $sqlwhere[] = " t.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users if (count($sqlwhere) > 0) { $sqlwhere_str = ' WHERE ' . implode(' AND ', $sqlwhere); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c8cb474b12d..6b83bf28ba5 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -14,6 +14,7 @@ * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 David Beniamine * * 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 @@ -2137,7 +2138,16 @@ else // Employee print ''; print ''.fieldLabel('Employee','employee',0).''; - print $form->selectyesno("employee",$object->employee,1); + if ($caneditfield) + { + print $form->selectyesno("employee",$object->employee,1); + }else{ + if ($object->employee){ + print $langs->trans("Yes"); + }else{ + print $langs->trans("No"); + } + } print ''; // Hierarchy @@ -2341,7 +2351,12 @@ else { print ''.$langs->trans("ColorUser").''; print ''; - print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset'); + if ($caneditfield) + { + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', null, 1, '', 'hideifnotset'); + }else{ + print $formother->showColor($object->color, ''); + } print ''; } @@ -2364,7 +2379,12 @@ else foreach ($cats as $cat) { $arrayselected[] = $cat->id; } - print $form->multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); + if ($caneditfield) + { + print $form->multiselectarray( 'usercats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%' ); + }else{ + print $form->showCategories( $object->id, 'user', 1 ); + } print ""; } @@ -2447,7 +2467,12 @@ else print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields,'edit'); + if ($caneditfield) + { + print $object->showOptionals($extrafields,'edit'); + }else{ + print $object->showOptionals($extrafields,'view'); + } } // Signature @@ -2496,7 +2521,11 @@ else print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print ''; + if($caneditfield){ + print ''; + }else{ + print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); + } print ''; print "\n"; @@ -2506,7 +2535,12 @@ else print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print ''; + if($caneditfield) + { + print ''; + }else{ + print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); + } print ''; print "\n"; @@ -2521,21 +2555,36 @@ else // Weeklyhours print ''.$langs->trans("WeeklyHours").''; print ''; - print ''; + if($caneditfield) + { + print ''; + }else{ + print price2num($object->weeklyhours); + } print ''; print "\n"; // Date employment print ''.$langs->trans("DateEmployment").''; print ''; - print $form->selectDate(GETPOST('dateemployment')?GETPOST('dateemployment'):$object->dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 0); + if($caneditfield) + { + print $form->selectDate(GETPOST('dateemployment')?GETPOST('dateemployment'):$object->dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 0); + }else{ + print dol_print_date($object->dateemployment, 'day'); + } print ''; print "\n"; // Date employmentEnd print ''.$langs->trans("DateEmploymentEnd").''; print ''; - print $form->selectDate(GETPOST('dateemploymentend')?GETPOST('dateemploymentend'):$object->dateemploymentend, 'dateemploymentend', 0, 0, 1, 'formdateemploymentend', 1, 0); + if($caneditfield) + { + print $form->selectDate(GETPOST('dateemploymentend')?GETPOST('dateemploymentend'):$object->dateemploymentend, 'dateemploymentend', 0, 0, 1, 'formdateemploymentend', 1, 0); + }else{ + print dol_print_date($object->dateemploymentend, 'day'); + } print ''; print "\n"; @@ -2543,7 +2592,12 @@ else // Date birth print ''.$langs->trans("DateToBirth").''; print ''; - print $form->selectDate(GETPOST('birth')?GETPOST('birth'):$object->birth, 'birth', 0, 0, 1, 'updateuser', 1, 0); + if($caneditfield) + { + echo $form->selectDate(GETPOST('birth')?GETPOST('birth'):$object->birth, 'birth', 0, 0, 1, 'updateuser', 1, 0); + }else{ + print dol_print_date($object->birth, 'day'); + } print ''; print "\n";