From 301b97f6d230d3519ee27a82ab20064f0bbfe941 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Mar 2020 10:05:22 +0100 Subject: [PATCH 01/11] FIX Update fiscalyear.class.php to filter on entity --- htdocs/core/class/fiscalyear.class.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 0eed1a56580..10015e3c363 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -1,5 +1,7 @@ +/* Copyright (C) 2014-2020 Alexandre Spangaro + * Copyright (C) 2020 OScss-Shop + * * * 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 @@ -381,13 +383,19 @@ class Fiscalyear extends CommonObject * @param int $dateend Date end to scan * @return string Number of entries */ - public function getAccountancyEntriesByFiscalYear($datestart, $dateend) + public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '') { global $conf; + if(empty($datestart) ) + $datestart = $this->date_start; + if(empty($dateend) ) + $dateend = $this->date_end; + $sql = "SELECT count(DISTINCT piece_num) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping "; - $sql.= " WHERE doc_date >= '".$datestart."' and doc_date <= '".$dateend."'"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping"; + $sql.= " WHERE entity IN (".getEntity('bookkeeping', 0).")"; + $sql.= " AND doc_date >= '".$this->db->idate($datestart)."' and doc_date <= '".$this->db->idate($dateend)."'"; $resql=$this->db->query($sql); if ($resql) @@ -407,13 +415,19 @@ class Fiscalyear extends CommonObject * @param int $dateend Date end to scan * @return string Number of movements */ - public function getAccountancyMovementsByFiscalYear($datestart, $dateend) + public function getAccountancyMovementsByFiscalYear($datestart = '', $dateend = '') { global $conf; + if(empty($datestart) ) + $datestart = $this->date_start; + if(empty($dateend) ) + $dateend = $this->date_end; + $sql = "SELECT count(rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping "; - $sql.= " WHERE doc_date >= '".$datestart."' AND doc_date <= '".$dateend."'"; + $sql.= " WHERE entity IN (".getEntity('bookkeeping', 0).")"; + $sql.= " AND doc_date >= '".$this->db->idate($datestart)."' and doc_date <= '".$this->db->idate($dateend)."'"; $resql=$this->db->query($sql); if ($resql) From a6a1ba0db28e71377a019cc4cdc0fa6a783bc9c9 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 12:47:00 +0100 Subject: [PATCH 02/11] Update README.md --- doc/images/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/images/README.md b/doc/images/README.md index 798cf599b4c..7422d246d40 100644 --- a/doc/images/README.md +++ b/doc/images/README.md @@ -10,7 +10,11 @@ https://github.com/Dolibarr/foundation -* Few icons are from http://led24.de/iconset/. This is original README file for this source: +* Few icons are / were from website led24.de + +* Attention: This website is no longer available! + +This is original README file for this source: ------------------------------------------------------- You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to http://led24.de/iconset/ or http://led24.de/ would be appreciated. From 8e712c6d0e3da7dc5757c91c04b5795b728a7698 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 13:13:11 +0100 Subject: [PATCH 03/11] Update https for country websites Update https for country websites --- htdocs/admin/system/about.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 64f8fba72ad..3cfc18accc9 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -86,31 +86,31 @@ print ''; if (preg_match('/^fr_/i', $langs->getDefaultLang())) { print '
  • '; - print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("France")).''; + print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("France")).''; print '
  • '; } if (preg_match('/^el_/i', $langs->getDefaultLang())) { print '
  • '; - print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Greece")).''; + print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Greece")).''; print '
  • '; } if (preg_match('/^es_/i', $langs->getDefaultLang())) { print '
  • '; - print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Spain")).''; + print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Spain")).''; print '
  • '; } if (preg_match('/^it_/i', $langs->getDefaultLang())) { print '
  • '; - print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Italy")).''; + print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Italy")).''; print '
  • '; } if (preg_match('/^de_/i', $langs->getDefaultLang())) { print '
  • '; - print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).''; + print ''.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).''; print '
  • '; } print '
  • '; From 1491414d5b0a3719e785803df42b4d12d0c17a63 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 13:34:12 +0100 Subject: [PATCH 04/11] Update 1. add $help_url |DE:Modul_Benutzer 2. change comment 'Creation d'un champ optionnel' -> 'Creation of an optional field' 3. change comment 'Edition d'un champ optionnel ' -> 'Editing an optional field' --- htdocs/user/admin/user_extrafields.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 1f87b5fbe90..2653dfc9090 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -60,7 +60,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Users"); -$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; +$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer'; llxHeader('', $langs->trans("UsersSetup"), $help_url); @@ -88,8 +88,8 @@ if ($action != 'create' && $action != 'edit') /* ************************************************************************** */ /* */ -/* Creation d'un champ optionnel - /* */ +/* Creation of an optional field */ +/* */ /* ************************************************************************** */ if ($action == 'create') @@ -102,7 +102,7 @@ if ($action == 'create') /* ************************************************************************** */ /* */ -/* Edition d'un champ optionnel */ +/* Editing an optional field */ /* */ /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) From c8446662bff88b70427256187ff54b57cb4e1d02 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 14:25:20 +0100 Subject: [PATCH 05/11] create README.txt --- htdocs/includes/jquery/README.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 htdocs/includes/jquery/README.txt diff --git a/htdocs/includes/jquery/README.txt b/htdocs/includes/jquery/README.txt new file mode 100644 index 00000000000..536f413ef04 --- /dev/null +++ b/htdocs/includes/jquery/README.txt @@ -0,0 +1,5 @@ +README: +jQuery is a JavaScript library + +https://jquery.com/ +https://jquery.com/download/ From a8024b652c8895a2be7ea55b7ad89afedcb96647 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 14:31:09 +0100 Subject: [PATCH 06/11] Create README.txt --- htdocs/includes/geoip2/README.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 htdocs/includes/geoip2/README.txt diff --git a/htdocs/includes/geoip2/README.txt b/htdocs/includes/geoip2/README.txt new file mode 100644 index 00000000000..5b311efb5a1 --- /dev/null +++ b/htdocs/includes/geoip2/README.txt @@ -0,0 +1,5 @@ +README + +https://dev.maxmind.com/geoip/geoip2/geolite2/ + +License: https://creativecommons.org/licenses/by-sa/4.0/ From 5b1e8c4ebdbb3d2f890ed862f6a90490456596f8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 14:44:26 +0100 Subject: [PATCH 07/11] Update tcpdi.php --- htdocs/includes/tcpdi/tcpdi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/tcpdi/tcpdi.php b/htdocs/includes/tcpdi/tcpdi.php index 675e2226b4a..f4c0bd00391 100644 --- a/htdocs/includes/tcpdi/tcpdi.php +++ b/htdocs/includes/tcpdi/tcpdi.php @@ -9,7 +9,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, From 58aa06b58494b4a40bec40fd2c4f5317507cfc85 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 16 Mar 2020 15:39:08 +0100 Subject: [PATCH 08/11] Update adodb-time.inc.php See Wiki: https://adodb.org/dokuwiki/doku.php?id=v5:datetime:datetime_index Download: https://github.com/ADOdb/ADOdb/blob/master/adodb-time.inc.php --- htdocs/includes/adodbtime/adodb-time.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/adodbtime/adodb-time.inc.php b/htdocs/includes/adodbtime/adodb-time.inc.php index c74778bb991..030196db275 100644 --- a/htdocs/includes/adodbtime/adodb-time.inc.php +++ b/htdocs/includes/adodbtime/adodb-time.inc.php @@ -1,7 +1,8 @@ Date: Mon, 16 Mar 2020 15:41:54 +0100 Subject: [PATCH 09/11] Create README.txt --- htdocs/includes/adodbtime/README.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 htdocs/includes/adodbtime/README.txt diff --git a/htdocs/includes/adodbtime/README.txt b/htdocs/includes/adodbtime/README.txt new file mode 100644 index 00000000000..3e2969a2868 --- /dev/null +++ b/htdocs/includes/adodbtime/README.txt @@ -0,0 +1,7 @@ +README +====== + +ADOdb Date Library, part of the ADOdb abstraction library + +See Wiki: https://adodb.org/dokuwiki/doku.php?id=v5:datetime:datetime_index +Download: https://github.com/ADOdb/ADOdb/blob/master/adodb-time.inc.php From 105c2e99787bb3b7baf9173cefc278e91c686efc Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 16 Mar 2020 17:31:16 +0100 Subject: [PATCH 10/11] fix ldcompta10 --- .../class/accountancyexport.class.php | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index bb1f1b8679c..7cfdde49402 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1088,9 +1088,24 @@ class AccountancyExport { $soc = $this->db->fetch_object($resql); - $address = str_replace(array("\t", "\n", "\r"), " ", $soc->address); + $address=array('','',''); + if (strpos($soc->address,"\n")!==false) { + $address = explode("\n",$soc->address); + if (is_array($address) && count($address)>0) { + foreach($address as $key=>$data) { + $address[$key]=str_replace(array("\t", "\n", "\r"), "", $data); + $address[$key]=dol_trunc($address[$key],40,'right','UTF-8',1); + } + } + } else { + $address[0] = substr(str_replace(array("\t", "\r"), " ", $soc->address),0,40); + $address[1] = substr(str_replace(array("\t", "\r"), " ", $soc->address),41,40); + $address[2] = substr(str_replace(array("\t", "\r"), " ", $soc->address),82,40); + + } $type_enregistrement = 'C'; + //TYPE print $type_enregistrement.$separator; //NOCL print $soc->code_client.$separator; @@ -1099,15 +1114,15 @@ class AccountancyExport //LIBI print $separator; //TITR - print getFormeJuridiqueLabel($soc->fk_forme_juridique).$separator; + print $separator; //RSSO print $soc->nom.$separator; //CAD1 - print substr($address, 0, 40).$separator; + print $address[0].$separator; //CAD2 - print substr($address, 41, 40).$separator; + print $address[1].$separator; //CAD3 - print substr($address, 82, 40).$separator; + print $address[2].$separator; //COPO print $soc->zip.$separator; //BUDI @@ -1129,7 +1144,7 @@ class AccountancyExport //COMM print $separator; //SIRE - print $soc->siret.$separator; + print str_replace(" ", "", $soc->siret).$separator; //RIBP print $separator; //DOBQ @@ -1267,8 +1282,6 @@ class AccountancyExport } else { print $separator; } - // SECT - print $separator; // CTRE print $separator; // NORL @@ -1286,13 +1299,13 @@ class AccountancyExport // CDES print $separator; // QTUE - print '0'.$separator; + print $separator; // MTDV - print $separator; - // CODV print '0'.$separator; - // TXDV + // CODV print $separator; + // TXDV + print '0'.$separator; // MOPM print $separator; // BONP From 74655b759cab6e8649891c8f6857dc762ad0694b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 16 Mar 2020 16:34:28 +0000 Subject: [PATCH 11/11] Fixing style errors. --- .../accountancy/class/accountancyexport.class.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 7cfdde49402..6c628ae52c3 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1089,19 +1089,18 @@ class AccountancyExport $soc = $this->db->fetch_object($resql); $address=array('','',''); - if (strpos($soc->address,"\n")!==false) { - $address = explode("\n",$soc->address); + if (strpos($soc->address, "\n")!==false) { + $address = explode("\n", $soc->address); if (is_array($address) && count($address)>0) { foreach($address as $key=>$data) { $address[$key]=str_replace(array("\t", "\n", "\r"), "", $data); - $address[$key]=dol_trunc($address[$key],40,'right','UTF-8',1); + $address[$key]=dol_trunc($address[$key], 40, 'right', 'UTF-8', 1); } } } else { - $address[0] = substr(str_replace(array("\t", "\r"), " ", $soc->address),0,40); - $address[1] = substr(str_replace(array("\t", "\r"), " ", $soc->address),41,40); - $address[2] = substr(str_replace(array("\t", "\r"), " ", $soc->address),82,40); - + $address[0] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 0, 40); + $address[1] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 41, 40); + $address[2] = substr(str_replace(array("\t", "\r"), " ", $soc->address), 82, 40); } $type_enregistrement = 'C';