From 8192e9dc67abfcd572c386bac761d93889bb7d87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Mar 2020 03:02:49 +0100 Subject: [PATCH 01/41] FIX Missing token in form --- htdocs/adherents/stats/index.php | 2 ++ htdocs/comm/propal/stats/index.php | 2 ++ htdocs/commande/stats/index.php | 2 ++ htdocs/compta/deplacement/stats/index.php | 2 ++ htdocs/compta/facture/stats/index.php | 2 ++ htdocs/expensereport/stats/index.php | 2 ++ htdocs/fichinter/stats/index.php | 2 ++ htdocs/projet/stats/index.php | 1 + htdocs/projet/tasks/stats/index.php | 1 + htdocs/salaries/stats/index.php | 2 ++ htdocs/ticket/stats/index.php | 1 - 11 files changed, 18 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index f02c012a48e..10eca32ac13 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -145,6 +145,8 @@ print '
'; // Show filter box /*print '
'; +print ''; + print ''; print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("Member").''; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 4a2b8dea419..030db477631 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -242,7 +242,9 @@ print '
'; //{ // Show filter box print ''; + print ''; print ''; + print ''; print ''; // Company diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index e9eca9dafa9..c465cdcb8c9 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -255,7 +255,9 @@ print '
'; // Show filter box print ''; +print ''; print ''; + print '
'.$langs->trans("Filter").'
'; print ''; // Company diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index c9c48fd9b93..cf745b784fc 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -227,7 +227,9 @@ print '
'; // Show filter box print ''; +print ''; print ''; + print '
'.$langs->trans("Filter").'
'; print ''; // Company diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index bd749e02dee..a72b03b47a3 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -235,7 +235,9 @@ print '
'; // Show filter box print ''; +print ''; print ''; + print '
'.$langs->trans("Filter").'
'; print ''; // Company diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 60ab9001972..359f49f2dea 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -211,7 +211,9 @@ print '
'; // Show filter box print ''; +print ''; print ''; + print '
'.$langs->trans("Filter").'
'; print ''; // Company diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 78f3289d638..d2efb5bb3ed 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -225,7 +225,9 @@ print '
'; //{ // Show filter box print ''; + print ''; print ''; + print '
'.$langs->trans("Filter").'
'; print ''; // Company diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 38fa476fcab..00747e55d0e 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -272,6 +272,7 @@ dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, ''); print '
'; print ''; +print ''; print '
'.$langs->trans("Filter").'
'; print ''; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index dafd5ae0071..c758664d2c6 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -139,6 +139,7 @@ dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, ''); print '
'; print ''; +print ''; print '
'.$langs->trans("Filter").'
'; print ''; diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index e96b6776664..25c5be2c79d 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -193,6 +193,8 @@ print '
'; // Show filter box print ''; +print ''; + print '
'.$langs->trans("Filter").'
'; print ''; // User diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 1f5f06ccc1f..cf8ed28db96 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -229,7 +229,6 @@ print '
'; print ''; print ''; - print '
'.$langs->trans("Filter").'
'; print ''; // Company From 37fce0d3eeece5032fad40731f7eedc9de48119b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Mar 2020 14:45:37 +0100 Subject: [PATCH 02/41] Fix position on merou Fix preselected value on contact --- htdocs/core/class/html.formcompany.class.php | 1 + htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 +++--- htdocs/core/tpl/contacts.tpl.php | 7 ++++++- htdocs/expedition/contact.php | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 10ee91ad50f..58291fb75f0 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -730,6 +730,7 @@ class FormCompany extends Form if (is_object($object) && method_exists($object, 'liste_type_contact')) { $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); + print ''; - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconciliable']['checked'])) print ''; } + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconcilable']['checked'])) print ''; } if (!empty($arrayfields['aa.active']['checked'])) print ''; print '\n"; @@ -450,9 +450,9 @@ if ($resql) if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // Activated or not reconciliation on accounting account - if (!empty($arrayfields['aa.reconciliable']['checked'])) { + if (!empty($arrayfields['aa.reconcilable']['checked'])) { print '\n"; From debecabe69f10e3e0074437d75d8d53396cbabb5 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 16 Mar 2020 08:38:01 +0100 Subject: [PATCH 08/41] FIX missing "contact_" substitution in supplier proposal --- ...c_generic_supplier_proposal_odt.modules.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 3b4a39288ea..5b49aee1711 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -330,11 +330,20 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } // Recipient name + $contactobject = null; if (!empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->thirdparty; + if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) + { + $socobject = $object->contact; + } + else + { + $socobject = $object->thirdparty; + // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + $contactobject = $object->contact; + } } else { @@ -405,7 +414,10 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs); $array_other = $this->get_substitutionarray_other($outputlangs); - $tmparray = array_merge($substitutionarray, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other); + $array_thirdparty_contact = array(); + if ($usecontact && is_object($contactobject)) $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact'); + + $tmparray = array_merge($substitutionarray, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook From fd4e8072111357e0167888b6c6d24e758d576722 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 16 Mar 2020 07:40:10 +0000 Subject: [PATCH 09/41] Fixing style errors. --- .../doc/doc_generic_supplier_proposal_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 5b49aee1711..c97d2f94d63 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -416,7 +416,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $array_thirdparty_contact = array(); if ($usecontact && is_object($contactobject)) $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact'); - + $tmparray = array_merge($substitutionarray, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); From 301b97f6d230d3519ee27a82ab20064f0bbfe941 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Mar 2020 10:05:22 +0100 Subject: [PATCH 10/41] 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 117ff5f4eb692553654c8857709b48a528a2ed82 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 16 Mar 2020 11:49:03 +0100 Subject: [PATCH 11/41] add hook to add sql filter in where clause on select users --- htdocs/core/class/html.form.class.php | 6 +++++- htdocs/core/class/html.formother.class.php | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0db01a84656..3d7bceadcf3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1618,7 +1618,7 @@ class Form public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) { // phpcs:enable - global $conf, $user, $langs; + global $conf, $user, $langs, $hookmanager; // If no preselected user defined, we take current user if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected = $user->id; @@ -1679,6 +1679,10 @@ class Form if (!empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql .= " AND u.statut <> 0"; if (!empty($morefilter)) $sql .= " ".$morefilter; + //Add hook to filter on user (for exemple on usergroup define in custom modules) + $reshook = $hookmanager->executeHooks('addSQLWhereFilterOnSelectUsers', array(), $this, $action); + if (!empty($reshook)) $sql .= $hookmanager->resPrint; + if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) // MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname { $sql .= " ORDER BY u.firstname ASC"; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 829a3f9c72f..b245f5f013b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -424,7 +424,7 @@ class FormOther public function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '', $norepresentative = 0) { // phpcs:enable - global $conf, $langs; + global $conf, $langs, $hookmanager; $langs->load('users'); @@ -440,6 +440,9 @@ class FormOther $out.=$comboenhancement; } } + + $reshook = $hookmanager->executeHooks('addSQLWhereFilterOnSelectSalesRep', array(), $this, $action); + // Select each sales and print them in a select input $out.=' +load_cache_vatrates("'" . $mysoc->country_code . "'"); + if ($num > 0) { + print '

'; + print $langs->trans('VAT') . ' : '; + foreach ($form->cache_vatrates as $rate) { + print ''; + } + } +} +?> diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3ca20a9ddee..93c91e2f55b 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; +global $mysoc; + $langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks")); $id = GETPOST('id', 'int'); @@ -327,7 +329,12 @@ if ($action == "freezone") { $customer = new Societe($db); $customer->fetch($invoice->socid); - $tva_tx = get_default_tva($mysoc, $customer); + $tva_tx = GETPOST('tva_tx', 'alpha'); + if ($tva_tx != '') { + $tva_tx = price2num($tva_tx); + } else { + $tva_tx = get_default_tva($mysoc, $customer); + } // Local Taxes $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); From a74dca4a203cbaf5148e16f584cf8d4b563ac002 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 17 Mar 2020 09:52:26 +0100 Subject: [PATCH 24/41] FIX resolve conflicts --- htdocs/takepos/css/pos.css.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index a95288f2f51..fb9bd1a0707 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -50,7 +50,6 @@ top_httphead('text/css'); // 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=10800, public, must-revalidate'); else header('Cache-Control: no-cache'); -header('Cache-Control: no-cache'); require DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; @@ -120,7 +119,7 @@ button.calcbutton2 { width: calc(25% - 2px); height: calc(25% - 2px); font-weight: bold; - font-size: 10pt; + font-size: 8pt; margin: 1px; } From cb43928a5d5659e0c25d247a915712f41ab07309 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 17 Mar 2020 12:29:14 +0100 Subject: [PATCH 25/41] Fix radio label target --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 611d7d791ec..c6220f647aa 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3017,7 +3017,7 @@ if ($action == 'create') // First situation invoice print '
'; $tmp = ' '; - $tmp = $tmp.''; + $tmp = $tmp.''; $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; From 075757eb3df5ec2412ef85166b1330bec4d79a27 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 17 Mar 2020 16:49:05 +0100 Subject: [PATCH 26/41] Fix situation value transmission --- htdocs/compta/facture/card.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c6220f647aa..94298d14f29 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3304,14 +3304,28 @@ if ($action == 'create') } $retained_warranty = GETPOST('retained_warranty', 'int'); - $retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; + if(empty($retained_warranty)){ + if(!empty($objectsrc->retained_warranty)){ // use previous situation value + $retained_warranty = $objectsrc->retained_warranty; + }else{ + $retained_warranty = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; + } + } + print '
'; From 1fe4e4415e07d428fa0e1e8bb2da1057c7c71722 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 18 Mar 2020 09:27:08 +0100 Subject: [PATCH 27/41] FIX: Bank movements color is not showing --- 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 297f0dd91d4..d7951233f7b 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1157,14 +1157,14 @@ if ($resql) } else { $color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1; } - $backgroundcolor = 'style="background-color: '.$color.';"'; + $backgroundcolor = 'style="background: '.$color.';"'; } else { if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) { $color = '#7fdb86'; } else { $color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2; } - $backgroundcolor = 'style="background-color: '.$color.';"'; + $backgroundcolor = 'style="background: '.$color.';"'; } } print ''; From 50a0bfef64ea1fbdbfa409ae56cc1a5ac98ab7f7 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 18 Mar 2020 09:53:13 +0100 Subject: [PATCH 28/41] NEW: Export module, add extrafields for Contract and Contract line --- htdocs/core/modules/modContrat.class.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 3b8a7aa3f8b..e50af779c5c 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -193,14 +193,20 @@ class modContrat extends DolibarrModules 'p.rowid'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text'); + $keyforselect='contrat'; $keyforelement='contract'; $keyforaliasextra='coextra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $keyforselect='contratdet'; $keyforelement='contract_line'; $keyforaliasextra='codextra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contrat as co,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'contratdet as cod'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cod.fk_product = p.rowid)'; - $this->export_sql_end[$r] .=' WHERE co.fk_soc = s.rowid and co.rowid = cod.fk_contrat'; - $this->export_sql_end[$r] .=' AND co.entity IN ('.getEntity('contract').')'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid'; + $this->export_sql_end[$r] .=' INNER JOIN '.MAIN_DB_PREFIX.'contrat as co ON co.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' INNER JOIN '.MAIN_DB_PREFIX.'contratdet as cod ON co.rowid = cod.fk_contrat'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (cod.fk_product = p.rowid)'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'contrat_extrafields as coextra on (co.rowid = coextra.fk_object)'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'contratdet_extrafields as codextra on (cod.rowid = codextra.fk_object)'; + $this->export_sql_end[$r] .=' WHERE co.entity IN ('.getEntity('contract').')'; } From 2e1554def4be9c37232c9b4fe37242b8a966d97c Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 18 Mar 2020 10:18:52 +0100 Subject: [PATCH 29/41] FIX : wrong include - replace extrafields_create.tpl.php to extrafields_add.tpl.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1ed1327684c..318e6dec614 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1559,7 +1559,7 @@ else // Other attributes $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_create.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // Assign a sale representative print ''; From d3aeec0a7c773fe4c8356da60c863f73177ae9ba Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 18 Mar 2020 10:30:15 +0100 Subject: [PATCH 30/41] Fix situation value transmission --- htdocs/compta/facture/card.php | 13 ++++++++++++- htdocs/compta/facture/class/facture.class.php | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 94298d14f29..dc2eb2c5308 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1699,7 +1699,18 @@ if (empty($reshook)) $object->fk_facture_source = $_POST['situations']; $object->type = Facture::TYPE_SITUATION; - if (!empty($origin) && !empty($originid)) + + $object->retained_warranty = GETPOST('retained_warranty', 'int'); + $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + + $retained_warranty_date_limit = GETPOST('retained_warranty_date_limit'); + if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) { + $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); + } + $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); +var_dump('la', $object->retained_warranty); + + if (!empty($origin) && !empty($originid)) { $object->origin = $origin; $object->origin_id = $originid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8c198b58a3e..c2c82424b77 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1052,6 +1052,11 @@ class Facture extends CommonInvoice $facture->situation_cycle_ref = $this->situation_cycle_ref; $facture->situation_final = $this->situation_final; + $facture->retained_warranty = $this->retained_warranty; + $facture->retained_warranty_fk_cond_reglement = $this->retained_warranty_fk_cond_reglement; + $facture->retained_warranty_date_limit = $this->retained_warranty_date_limit; + + // Loop on each line of new invoice foreach ($facture->lines as $i => $tmpline) { From 0a5f971eb514dda0f6cb1f42451a5f822f3c3d57 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 18 Mar 2020 09:32:34 +0000 Subject: [PATCH 31/41] Fixing style errors. --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dc2eb2c5308..26ea6a28f24 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1708,7 +1708,7 @@ if (empty($reshook)) $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); } $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); -var_dump('la', $object->retained_warranty); + var_dump('la', $object->retained_warranty); if (!empty($origin) && !empty($originid)) { From 7b8cafb710fce5979185df60aa5811cef03a3e3a Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 18 Mar 2020 10:34:44 +0100 Subject: [PATCH 32/41] remove var_dump --- 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 dc2eb2c5308..e75a8d35d7c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1708,7 +1708,6 @@ if (empty($reshook)) $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); } $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); -var_dump('la', $object->retained_warranty); if (!empty($origin) && !empty($originid)) { From 56e4fa1bb3c3e6131be211ff21a922afb3ce9614 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 14:01:11 +0100 Subject: [PATCH 33/41] Trans --- dev/translation/txpull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/translation/txpull.sh b/dev/translation/txpull.sh index 3f24bd0912d..fcccae98221 100755 --- a/dev/translation/txpull.sh +++ b/dev/translation/txpull.sh @@ -54,5 +54,5 @@ fi echo Think to launch also: echo "> dev/tools/fixaltlanguages.sh fix all" -echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with ''" +echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with '' on *.lang files" From cc93a40c4582fe9105b17b91ecedebdee4e538cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 14:06:15 +0100 Subject: [PATCH 34/41] Fix label of local tax --- htdocs/core/modules/modFacture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 984e28f4e31..991cd571f3e 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -216,7 +216,7 @@ class modFacture extends DolibarrModules 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", - 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', + 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', 'none.rest'=>'Rest', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", @@ -303,7 +303,7 @@ class modFacture extends DolibarrModules 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", - 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', + 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', 'none.rest'=>'Rest', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef', From 15614abc3fb29e113756a0d8da1796bd75b5819f Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 18 Mar 2020 15:08:58 +0100 Subject: [PATCH 35/41] NEW: add csv separator setup in module admin --- htdocs/admin/export.php | 19 +++-- htdocs/admin/import.php | 99 +++++++++++++++++++++++++ htdocs/core/modules/modImport.class.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/exports.lang | 2 + 5 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 htdocs/admin/import.php diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index 107954fa4cd..f18b2357cf6 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -23,9 +23,9 @@ */ /** - * \file htdocs/admin/expedition.php - * \ingroup expedition - * \brief Page d'administration/configuration du module Expedition + * \file htdocs/admin/export.php + * \ingroup export + * \brief config Page module Export */ require '../main.inc.php'; @@ -69,7 +69,7 @@ $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; -dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "exports"); +dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic"); print '
'.$langs->trans("Filter").'
   '; $searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1); @@ -371,7 +371,7 @@ if ($resql) if (!empty($arrayfields['aa.labelshort']['checked'])) print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $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, '', $sortfield, $sortorder, 'left '); 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 ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconciliable']['checked'])) print_liste_field_titre($arrayfields['aa.reconciliable']['label'], $_SERVER["PHP_SELF"], 'aa.reconciliable', '', $param, '', $sortfield, $sortorder); } + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconcilable']['checked'])) print_liste_field_titre($arrayfields['aa.reconciliable']['label'], $_SERVER["PHP_SELF"], 'aa.reconciliable', '', $param, '', $sortfield, $sortorder); } 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"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "
'; - if (empty($obj->reconciliable)) { + if (empty($obj->reconcilable)) { print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0178f87a32d..58e6bd600f6 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -136,9 +136,9 @@ class AccountingAccount extends CommonObject public $active; /** - * @var int reconciliable + * @var int reconcilable */ - public $reconciliable; + public $reconcilable; /** * Constructor @@ -167,7 +167,7 @@ class AccountingAccount extends CommonObject global $conf; if ($rowid || $account_number) { - $sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconciliable"; + $sql = "SELECT a.rowid as rowid, a.datec, a.tms, a.fk_pcg_version, a.pcg_type, a.account_number, a.account_parent, a.label, a.labelshort, a.fk_accounting_category, a.fk_user_author, a.fk_user_modif, a.active, a.reconcilable"; $sql .= ", ca.label as category_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as a"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_accounting_category as ca ON a.fk_accounting_category = ca.rowid"; @@ -208,7 +208,7 @@ class AccountingAccount extends CommonObject $this->fk_user_modif = $obj->fk_user_modif; $this->active = $obj->active; $this->status = $obj->active; - $this->reconciliable = $obj->reconciliable; + $this->reconcilable = $obj->reconcilable; return $this->id; } else { @@ -267,7 +267,7 @@ class AccountingAccount extends CommonObject $sql .= ", fk_accounting_category"; $sql .= ", fk_user_author"; $sql .= ", active"; - $sql .= ", reconciliable"; + $sql .= ", reconcilable"; $sql .= ") VALUES ("; $sql .= " '" . $this->db->idate($now) . "'"; $sql .= ", " . $conf->entity; @@ -280,7 +280,7 @@ class AccountingAccount extends CommonObject $sql .= ", " . (empty($this->account_category) ? 0 : (int) $this->account_category); $sql .= ", " . $user->id; $sql .= ", " . (int) $this->active; - $sql .= ", " . (int) $this->reconciliable; + $sql .= ", " . (int) $this->reconcilable; $sql .= ")"; $this->db->begin(); @@ -348,7 +348,7 @@ class AccountingAccount extends CommonObject $sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : (int) $this->account_category); $sql .= " , fk_user_modif = " . $user->id; $sql .= " , active = " . (int) $this->active; - $sql .= " , reconciliable = " . (int) $this->reconciliable; + $sql .= " , reconcilable = " . (int) $this->reconcilable; $sql .= " WHERE rowid = " . $this->id; dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); @@ -588,7 +588,7 @@ class AccountingAccount extends CommonObject } elseif ($mode == 1) { - $fieldtouse = 'reconciliable'; + $fieldtouse = 'reconcilable'; } if ($result > 0) { @@ -619,7 +619,7 @@ class AccountingAccount extends CommonObject * Account activated * * @param int $id Id - * @param int $mode 0=field active, 1=field reconciliable, 2=field active_customer_list, 3=field_active_supplier_list + * @param int $mode 0=field active, 1=field reconcilable * @return int <0 if KO, >0 if OK */ public function account_activate($id, $mode = 0) @@ -633,7 +633,7 @@ class AccountingAccount extends CommonObject } elseif ($mode == 1) { - $fieldtouse = 'reconciliable'; + $fieldtouse = 'reconcilable'; } $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 0a61a6d9c58..e8d11378768 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -193,4 +193,4 @@ ALTER TABLE llx_accounting_account DROP COLUMN pcg_subtype; ALTER TABLE llx_product ADD COLUMN accountancy_code_buy_intra varchar(32) AFTER accountancy_code_buy; ALTER TABLE llx_product ADD COLUMN accountancy_code_buy_export varchar(32) AFTER accountancy_code_buy_intra; -ALTER TABLE llx_accounting_account ADD COLUMN reconciliable tinyint DEFAULT 0 NOT NULL after active; +ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active; diff --git a/htdocs/install/mysql/tables/llx_accounting_account.sql b/htdocs/install/mysql/tables/llx_accounting_account.sql index a3bf8b90b79..7af83585c7f 100644 --- a/htdocs/install/mysql/tables/llx_accounting_account.sql +++ b/htdocs/install/mysql/tables/llx_accounting_account.sql @@ -35,7 +35,7 @@ create table llx_accounting_account fk_user_author integer DEFAULT NULL, fk_user_modif integer DEFAULT NULL, active tinyint DEFAULT 1 NOT NULL, - reconciliable tinyint DEFAULT 0 NOT NULL, + reconcilable tinyint DEFAULT 0 NOT NULL, import_key varchar(14), extraparams varchar(255) -- for other parameters with json format )ENGINE=innodb; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 36b5fbcf55c..ba34d38f36e 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -239,7 +239,7 @@ HideOpeningBalance=Hide opening balance Pcgtype=Group of account PcgtypeDesc=Group of account are used as predefined 'filter' and 'grouping' criteria for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as groups for accounting accounts of products to build the expense/income report. -Reconciliable=Reconcilable +Reconcilable=Reconcilable TotalVente=Total turnover before tax TotalMarge=Total sales margin From c50f2b32d8abab18bcbf7a3447128e6cfa3ae311 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 16 Mar 2020 07:58:44 +0100 Subject: [PATCH 06/41] Add substitution for "user_civility" for ODT --- .../core/class/commondocgenerator.class.php | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 279eb1f7a6b..bd3dcb01e76 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -267,33 +267,34 @@ abstract class CommonDocGenerator $object->state = getState($object->state_code, 0); } - $array_contact = array( - $array_key.'_fullname' => $object->getFullName($outputlangs, 1), - $array_key.'_lastname' => $object->lastname, - $array_key.'_firstname' => $object->firstname, - $array_key.'_address' => $object->address, - $array_key.'_zip' => $object->zip, - $array_key.'_town' => $object->town, - $array_key.'_state_id' => $object->state_id, - $array_key.'_state_code' => $object->state_code, - $array_key.'_state' => $object->state, - $array_key.'_country_id' => $object->country_id, - $array_key.'_country_code' => $object->country_code, - $array_key.'_country' => $object->country, - $array_key.'_poste' => $object->poste, - $array_key.'_socid' => $object->socid, - $array_key.'_statut' => $object->statut, - $array_key.'_code' => $object->code, - $array_key.'_email' => $object->email, - $array_key.'_jabberid' => $object->jabberid, - $array_key.'_phone_pro' => $object->phone_pro, - $array_key.'_phone_perso' => $object->phone_perso, - $array_key.'_phone_mobile' => $object->phone_mobile, - $array_key.'_fax' => $object->fax, - $array_key.'_birthday' => $object->birthday, - $array_key.'_default_lang' => $object->default_lang, - $array_key.'_note_public' => $object->note_public, - $array_key.'_note_private' => $object->note_private + $array_contact = array ( + $array_key . '_fullname' => $object->getFullName($outputlangs, 1), + $array_key . '_lastname' => $object->lastname, + $array_key . '_firstname' => $object->firstname, + $array_key . '_address' => $object->address, + $array_key . '_zip' => $object->zip, + $array_key . '_town' => $object->town, + $array_key . '_state_id' => $object->state_id, + $array_key . '_state_code' => $object->state_code, + $array_key . '_state' => $object->state, + $array_key . '_country_id' => $object->country_id, + $array_key . '_country_code' => $object->country_code, + $array_key . '_country' => $object->country, + $array_key . '_poste' => $object->poste, + $array_key . '_socid' => $object->socid, + $array_key . '_statut' => $object->statut, + $array_key . '_code' => $object->code, + $array_key . '_email' => $object->email, + $array_key . '_jabberid' => $object->jabberid, // deprecated + $array_key . '_phone_pro' => $object->phone_pro, + $array_key . '_phone_perso' => $object->phone_perso, + $array_key . '_phone_mobile' => $object->phone_mobile, + $array_key . '_fax' => $object->fax, + $array_key . '_birthday' => $object->birthday, + $array_key . '_default_lang' => $object->default_lang, + $array_key . '_note_public' => $object->note_public, + $array_key . '_note_private' => $object->note_private, + $array_key . '_civility' => $object->civility, ); // Retrieve extrafields From 191374cc8f740ea4a11800dadca67c4edb7ddb2e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Mar 2020 08:07:05 +0100 Subject: [PATCH 07/41] Work on reconcilation of accouting account --- htdocs/accountancy/admin/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 52148f40140..1afe2ecca18 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -371,7 +371,7 @@ if ($resql) if (!empty($arrayfields['aa.labelshort']['checked'])) print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $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, '', $sortfield, $sortorder, 'left '); 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 ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconcilable']['checked'])) print_liste_field_titre($arrayfields['aa.reconciliable']['label'], $_SERVER["PHP_SELF"], 'aa.reconciliable', '', $param, '', $sortfield, $sortorder); } + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (! empty($arrayfields['aa.reconcilable']['checked'])) print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder); } 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"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "
'.$langs->trans('RetainedWarranty').''; print '%'; // Retained warranty payment term print '
'.$langs->trans('PaymentConditionsShortRetainedWarranty').''; $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; + if(empty($retained_warranty_fk_cond_reglement)){ + $retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; + if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value + $retained_warranty_fk_cond_reglement = $objectsrc->retained_warranty_fk_cond_reglement; + }else{ + $retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; + } + } $form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1); print '
'; @@ -84,13 +84,22 @@ print ''; print ''; print ''; print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print '"; +print ''; +print ''; print ''; print '
'.$langs->trans("EXPORTS_SHARE_MODELS").' '; - print ''; print ''; print ''; echo ajax_constantonoff('EXPORTS_SHARE_MODELS'); print ''; +print '
'.$langs->trans("ExportCsvSeparator").''."global->EXPORT_CSV_SEPARATOR_TO_USE."\">
'; diff --git a/htdocs/admin/import.php b/htdocs/admin/import.php new file mode 100644 index 00000000000..898d5dc4900 --- /dev/null +++ b/htdocs/admin/import.php @@ -0,0 +1,99 @@ + + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2018 Philippe Grand + * + * 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/admin/import.php + * \ingroup import + * \brief config page module import + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array('admin', 'exports', 'other')); + +if (!$user->admin) + accessforbidden(); + +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$page_name = "ImportSetup"; +llxHeader('', $langs->trans($page_name)); + +// Subheader +$linkback = ''.$langs->trans("BackToModuleList").''; + +print load_fiche_titre($langs->trans($page_name), $linkback); + +//$head = export_admin_prepare_head(); +$h = 0; +$head = array(); +$head[$h][0] = DOL_URL_ROOT.'/admin/import.php'; +$head[$h][1] = $langs->trans("Setup"); +$head[$h][2] = 'setup'; +$h++; + +dol_fiche_head($head, 'setup', $langs->trans("ImportArea"), -1, "technic"); + + +print ''; +print ''; +print ''."\n"; +print ''; +print ''."\n"; + +print ''; +print ''; +print ''; +print ''; +print ''; + +print ''; +print '"; +print ''; +print ''; +print ''; + +print '
'.$langs->trans("Parameters").' 
'.$langs->trans("ImportCsvSeparator").''."global->IMPORT_CSV_SEPARATOR_TO_USE."\">
'; + +dol_fiche_end(); + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 6071f04fc44..c725660f239 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -57,7 +57,7 @@ class modImport extends DolibarrModules $this->dirs = array("/import/temp"); // Config pages - $this->config_page_url = array(); + $this->config_page_url = array("import.php"); // Dependencies $this->hidden = false; // A condition to hide module diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7a4de856ba2..62119428b9a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1959,6 +1959,7 @@ WarningValueHigherSlowsDramaticalyOutput=Warning, higher values slows dramatical ModuleActivated=Module %s is activated and slows the interface EXPORTS_SHARE_MODELS=Export models are share with everybody ExportSetup=Setup of module Export +ImportSetup=Setup of module Import InstanceUniqueID=Unique ID of the instance SmallerThan=Smaller than LargerThan=Larger than diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 2dcf4317e00..3549e3f8b23 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -26,6 +26,8 @@ FieldTitle=Field title NowClickToGenerateToBuildExportFile=Now, select the file format in the combo box and click on "Generate" to build the export file... AvailableFormats=Available Formats LibraryShort=Library +ExportCsvSeparator=Csv caracter separator +ImportCsvSeparator=Csv caracter separator Step=Step FormatedImport=Import Assistant FormatedImportDesc1=This module allows you to update existing data or add new objects into the database from a file without technical knowledge, using an assistant. From 9bfc60064b93fa07a5cfb35f54b431f040f57c48 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 18 Mar 2020 15:12:02 +0100 Subject: [PATCH 36/41] ass credential --- htdocs/admin/import.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/import.php b/htdocs/admin/import.php index 898d5dc4900..3ead31ab0f3 100644 --- a/htdocs/admin/import.php +++ b/htdocs/admin/import.php @@ -7,6 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2020 Floriazn 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 From a3328c5ef3b238414cd198f1beaa58117c5a760e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 18:37:44 +0100 Subject: [PATCH 37/41] Fix div --- htdocs/core/tpl/contacts.tpl.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index b5df248b590..a9297d8c2e6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -66,11 +66,12 @@ $userstatic = new User($db); ?> -
-
-
-
'."\n"; +print '
'."\n"; +print '
'."\n"; + if ($permission) { ?>
From b9f404b5fab2fb649beaa56285fc81d1551145f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 19:07:15 +0100 Subject: [PATCH 38/41] Fix form inside table --- htdocs/admin/export.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index 107954fa4cd..b92ab7d7091 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -71,6 +71,9 @@ $h++; dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "exports"); +print ''; +print ''; +print ''; print ''; print ''; @@ -78,23 +81,18 @@ print ''."\n"; print ''; print ''."\n"; - // Example with a yes / no select print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameters").' 
'.$langs->trans("EXPORTS_SHARE_MODELS").' '; - -print ''; -print ''; -print ''; echo ajax_constantonoff('EXPORTS_SHARE_MODELS'); -print ''; - print '
'; +print ''; + dol_fiche_end(); // End of page From 30b48a9ee3480fccf9e067ccd805874f695d6e22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 19:21:32 +0100 Subject: [PATCH 39/41] Fix update --- htdocs/admin/export.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index 2e788ede3fa..ef6a7c3108f 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -38,13 +38,15 @@ if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); -$value = GETPOST('value', 'alpha'); + /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +if ($action == 'save') { + dolibarr_set_const($db, 'EXPORT_CSV_SEPARATOR_TO_USE', GETPOST('EXPORT_CSV_SEPARATOR_TO_USE', 'alphanohtml')); +} /* @@ -73,7 +75,7 @@ dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic"); print '
'; print ''; -print ''; +print ''; print ''; @@ -93,7 +95,7 @@ print ''; print ''; print ''; -print '"; +print '"; print ''; print ''; From 8c34a091b4b7663ddef57ccb20cdff909c29bd54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 19:24:11 +0100 Subject: [PATCH 40/41] Fix import --- htdocs/admin/import.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/import.php b/htdocs/admin/import.php index 3ead31ab0f3..37c9b205424 100644 --- a/htdocs/admin/import.php +++ b/htdocs/admin/import.php @@ -72,6 +72,10 @@ $h++; dol_fiche_head($head, 'setup', $langs->trans("ImportArea"), -1, "technic"); +print ''; +print ''; +print ''; +print ''; print '
'.$langs->trans("ExportCsvSeparator").''."global->EXPORT_CSV_SEPARATOR_TO_USE."\">'."global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE)."\">
'; print ''; @@ -80,19 +84,15 @@ print ''; print ''."\n"; print ''; -print ''; -print ''; -print ''; -print ''; - -print ''; -print '"; +print ''; +print '"; print ''; print ''; -print ''; print '
 
'.$langs->trans("ImportCsvSeparator").''."global->IMPORT_CSV_SEPARATOR_TO_USE."\">'.$langs->trans("ImportCsvSeparator").' ('.$langs->trans("ByDefault").')'."global->IMPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->IMPORT_CSV_SEPARATOR_TO_USE)."\">
'; +print ''; + dol_fiche_end(); // End of page From ef1285f05018de5588ca702b491bc927ee3bbe33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 19:42:20 +0100 Subject: [PATCH 41/41] css --- htdocs/theme/eldy/global.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 03ef2191a50..e590532a11f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1552,7 +1552,7 @@ div.nopadding { td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto { color: var(--colortexttitlenotab); - opacity: 0.65; + opacity: 0.45; } .pictotitle { margin-: 8px;