From 15313b8d374392641c957d4b7b2e9386728592b8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 24 Sep 2021 06:03:01 +0200 Subject: [PATCH 01/11] FIX Accountancy - Missing specific filename for export on format FEC2 --- htdocs/accountancy/tpl/export_journal.tpl.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index ecb0f7a6b09..93215b9b8db 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -38,7 +38,9 @@ header('Content-Type: text/csv'); include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; $accountancyexport = new AccountancyExport($db); -if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") { // Specific filename for FEC model export into the general ledger +// Specific filename for FEC model export into the general ledger +if ($accountancyexport->getFormatCode($formatexportset) == ($accountancyexport::$EXPORT_TYPE_FEC || $accountancyexport::$EXPORT_TYPE_FEC2) + && $type_export == "general_ledger") { // FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle if (empty($search_date_end)) { // TODO Get the max date into bookeeping table From 8f5f657e4dcda80443599ed7c233a64a48a58e0f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 25 Sep 2021 07:12:33 +0200 Subject: [PATCH 02/11] FIX Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it --- htdocs/accountancy/tpl/export_journal.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index 93215b9b8db..b595402228e 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -39,11 +39,11 @@ include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; $accountancyexport = new AccountancyExport($db); // Specific filename for FEC model export into the general ledger -if ($accountancyexport->getFormatCode($formatexportset) == ($accountancyexport::$EXPORT_TYPE_FEC || $accountancyexport::$EXPORT_TYPE_FEC2) +if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2') && $type_export == "general_ledger") { // FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle if (empty($search_date_end)) { - // TODO Get the max date into bookeeping table + // TODO Get the max date into bookkeeping table $search_date_end = dol_now(); } $datetouseforfilename = $search_date_end; @@ -60,7 +60,7 @@ if ($accountancyexport->getFormatCode($formatexportset) == ($accountancyexport:: $endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard'); $completefilename = $siren."FEC".$endaccountingperiod.".txt"; -} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) { +} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) { $completefilename = "XIMPORT.TXT"; } else { $completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format; From 0e1cc2b0965c79c787afe51f29fd621eb2f96a53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 18:46:27 +0200 Subject: [PATCH 03/11] Fix cost price is 0. --- htdocs/bom/bom_card.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index ab6112c0fed..4396dd36e92 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -75,6 +75,7 @@ if ($object->id > 0) { $object->calculateCosts(); } + // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; @@ -115,8 +116,13 @@ if (empty($reshook)) { $triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record + // Actions cancel, add, update, delete or clone include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + // The fetch/fetch_lines was redone into the inc.php so we must recall the calculateCosts() + if ($action == 'confirm_validate' && $object->id > 0) { + $object->calculateCosts(); + } // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; From ec3154075a71a7514a6778a86bc22f747afb59ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Sep 2021 22:16:08 +0200 Subject: [PATCH 04/11] Comment --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index e6578a1bc66..db0e40790dc 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -441,6 +441,7 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_evento ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_project, email, fk_actioncomm); + create table llx_eventorganization_conferenceorboothattendee_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, From 43ed88f056eb5f89b46b994d16deeb7944e5cb67 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 27 Sep 2021 23:02:19 +0200 Subject: [PATCH 05/11] FIX Propal list - Problem of pagination on date --- htdocs/comm/propal/list.php | 144 ++++++++++++++++++++++++++++-------- 1 file changed, 114 insertions(+), 30 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a0877a50028..692468b8485 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -13,9 +13,9 @@ * Copyright (C) 2016-2021 Ferran Marcet * Copyright (C) 2017-2018 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2019 Alexandre Spangaro + * Copyright (C) 2019-2021 Alexandre Spangaro * Copyright (C) 2021 Anthony Berton - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021 Frédéric France * * 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 @@ -88,12 +88,30 @@ $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'int'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); -$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int')); -$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int')); -$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int')); -$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int')); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_date_end_startday = GETPOST('search_date_end_startday', 'int'); +$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int'); +$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int'); +$search_date_end_endday = GETPOST('search_date_end_endday', 'int'); +$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); +$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); +$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver +$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); +$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int'); +$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int'); +$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int'); +$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int'); +$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int'); +$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int'); +$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); +$search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); $search_availability = GETPOST('search_availability', 'int'); $search_categ_cus = GETPOST("search_categ_cus", 'int'); $search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int'); @@ -278,12 +296,30 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_type = ''; $search_country = ''; $search_type_thirdparty = ''; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; $search_date_start = ''; $search_date_end = ''; - $search_dateend_start = ''; - $search_dateend_end = ''; - $search_datedelivery_start = ''; - $search_datedelivery_end = ''; + $search_date_end_startday = ''; + $search_date_end_startmonth = ''; + $search_date_end_startyear = ''; + $search_date_end_endday = ''; + $search_date_end_endmonth = ''; + $search_date_end_endyear = ''; + $search_date_end_start = ''; + $search_date_end_end = ''; + $search_date_delivery_startday = ''; + $search_date_delivery_startmonth = ''; + $search_date_delivery_startyear = ''; + $search_date_delivery_endday = ''; + $search_date_delivery_endmonth = ''; + $search_date_delivery_endyear = ''; + $search_date_delivery_start = ''; + $search_date_delivery_end = ''; $search_availability = ''; $search_status = ''; $object_statut = ''; @@ -628,17 +664,17 @@ if ($search_date_start) { if ($search_date_end) { $sql .= " AND p.datep <= '".$db->idate($search_date_end)."'"; } -if ($search_dateend_start) { - $sql .= " AND p.fin_validite >= '".$db->idate($search_dateend_start)."'"; +if ($search_date_end_start) { + $sql .= " AND p.fin_validite >= '".$db->idate($search_date_end_start)."'"; } -if ($search_dateend_end) { - $sql .= " AND p.fin_validite <= '".$db->idate($search_dateend_end)."'"; +if ($search_date_end_end) { + $sql .= " AND p.fin_validite <= '".$db->idate($search_date_end_end)."'"; } -if ($search_datedelivery_start) { - $sql .= " AND p.date_livraison >= '".$db->idate($search_datedelivery_start)."'"; +if ($search_date_delivery_start) { + $sql .= " AND p.date_livraison >= '".$db->idate($search_date_delivery_start)."'"; } -if ($search_datedelivery_end) { - $sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'"; +if ($search_date_delivery_end) { + $sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'"; } if ($search_sale > 0) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); @@ -713,12 +749,60 @@ if ($resql) { if ($sall) { $param .= '&sall='.urlencode($sall); } - if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y')); - if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y')); - if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y')); - if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y')); - if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y')); - if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y')); + if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); + } + if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + } + if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); + } + if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); + } + if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + } + if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); + } + if ($search_date_end_startday) { + $param .= '&search_date_end_startday='.urlencode($search_date_end_startday); + } + if ($search_date_end_startmonth) { + $param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth); + } + if ($search_date_end_startyear) { + $param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear); + } + if ($search_date_end_endday) { + $param .= '&search_date_end_endday='.urlencode($search_date_end_endday); + } + if ($search_date_end_endmonth) { + $param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth); + } + if ($search_date_end_endyear) { + $param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear); + } + if ($search_date_delivery_startday) { + $param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday); + } + if ($search_date_delivery_startmonth) { + $param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth); + } + if ($search_date_delivery_startyear) { + $param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear); + } + if ($search_date_delivery_endday) { + $param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday); + } + if ($search_date_delivery_endmonth) { + $param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth); + } + if ($search_date_delivery_endyear) { + $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear); + } if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } @@ -1018,10 +1102,10 @@ if ($resql) { if (!empty($arrayfields['p.fin_validite']['checked'])) { print ''; print '
'; - print $form->selectDate($search_dateend_start ? $search_dateend_start : -1, 'search_dateend_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; - print $form->selectDate($search_dateend_end ? $search_dateend_end : -1, 'search_dateend_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print ''; } @@ -1029,10 +1113,10 @@ if ($resql) { if (!empty($arrayfields['p.date_livraison']['checked'])) { print ''; print '
'; - print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; - print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print ''; } From 0750d4bb6e8fccaf568e235fae240eec5b25dcab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 00:21:54 +0200 Subject: [PATCH 06/11] Look and feel v14 --- htdocs/compta/prelevement/line.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 5aa7344eea5..05bbb547102 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -151,7 +151,9 @@ if ($id) { print $bon->getNomUrl(1).''; print ''.$langs->trans("Date").''.dol_print_date($bon->datec, 'day').''; - print ''.$langs->trans("Amount").''.price($lipre->amount).''; + + print ''.$langs->trans("Amount").''.price($lipre->amount).''; + print ''.$langs->trans("Status").''.$lipre->LibStatut($lipre->statut, 1).''; if ($lipre->statut == 3) { @@ -159,6 +161,7 @@ if ($id) { $resf = $rej->fetch($lipre->id); if ($resf == 0) { print ''.$langs->trans("RefusedReason").''.$rej->motif.''; + print ''.$langs->trans("RefusedData").''; if ($rej->date_rejet == 0) { /* Historique pour certaines install */ @@ -167,6 +170,7 @@ if ($id) { print dol_print_date($rej->date_rejet, 'day'); } print ''; + print ''.$langs->trans("RefusedInvoicing").''.$rej->invoicing.''; } else { print ''.$resf.''; @@ -229,7 +233,7 @@ if ($id) { /* * Action bar */ - print "
"; + print '
'; if ($action == '') { if ($bon->statut == BonPrelevement::STATUS_CREDITED) { @@ -245,7 +249,7 @@ if ($id) { } } - print "
"; + print '
'; /* * List of invoices @@ -267,7 +271,7 @@ if ($id) { if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } - $sql .= " ORDER BY $sortfield $sortorder "; + $sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($conf->liste_limit + 1, $offset); $result = $db->query($sql); From e6e224f33cdaf0222cf06bb9ad167c310133a9c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 11:53:00 +0200 Subject: [PATCH 07/11] Better translation --- htdocs/admin/mails_templates.php | 9 +++++---- htdocs/langs/en_US/admin.lang | 2 +- htdocs/user/group/card.php | 2 +- htdocs/user/home.php | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 3545892d486..7d8bc2f22b1 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -160,6 +160,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $tabhelp = array(); $tabhelp[25] = array( + 'label'=>$langs->trans('EnterAnyCode'), 'topic'=>''.$helpsubstit.'', 'joinfiles'=>$langs->trans('AttachMainDocByDefault'), 'content'=>''.$helpsubstit.'', @@ -683,8 +684,8 @@ if ($action == 'view') { $tmpaction = 'create'; $parameters = array( - 'fieldlist' => $fieldlist, - 'tabname' => $tabname[$id] + 'fieldlist' => $fieldlist, + 'tabname' => $tabname[$id] ); $reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; @@ -822,7 +823,7 @@ if ($resql) { print ''; } elseif ($value == 'fk_user') { print ''; - print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth150'); + print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150'); print ''; } elseif ($value == 'topic') { print ''; @@ -1187,7 +1188,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if ($value == 'fk_user') { print ''; if ($user->admin) { - print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200'); + print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300'); } else { if ($context == 'add') { // I am not admin and we show the add form print $user->getNomUrl(1); // Me diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 367f68e6a9b..d446e076dc3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1921,7 +1921,7 @@ SellTaxRate=Sales tax rate RecuperableOnly=Yes for VAT "Not Perceived but Recoverable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offers a page or web site to check the status of your shipments, you may enter it here. You can use the key {TRACKID} in the URL parameters so the system will replace it with the tracking number the user entered into the shipment card. OpportunityPercent=When you create a lead, you will define an estimated amount of project/lead. According to status of the lead, this amount may be multiplied by this rate to evaluate a total amount all your leads may generate. Value is a percentage (between 0 and 100). -TemplateForElement=This template record is dedicated to which element +TemplateForElement=This mail template is related to what type of object? An email template is available only when using the "Send Email" button from the related object. TypeOfTemplate=Type of template TemplateIsVisibleByOwnerOnly=Template is visible to owner only VisibleEverywhere=Visible everywhere diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 5c1e16e4a0c..56af96740d4 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -415,7 +415,7 @@ if ($action == 'create') { print ''."\n"; print ''."\n"; print '
'.$langs->trans("NonAffectedUsers").''; - print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'maxwidth300'); + print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'minwidth200 maxwidth500'); print '   '; print ''; print ''; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index fbfe4638bd5..924dceb14ab 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -89,12 +89,12 @@ $searchbox .= ''; $searchbox .= ''; $searchbox .= ''; $searchbox .= ''; +$searchbox .= $langs->trans("User").':'; // Search Group if ($canreadperms) { $searchbox .= ''; + $searchbox .= $langs->trans("Group").':'; } $searchbox .= ''; From 0e3ec3ea2d82ea5e095d4d1cf06000e611858938 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 11:56:43 +0200 Subject: [PATCH 08/11] Trans --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 370b10da626..f26b18152b9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6944,7 +6944,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = 'Security key for payment on a member subscription (one key per member)'; $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = 'Security key for payment on an order'; $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = 'Security key for payment on an invoice'; - $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'Security key for payment on a a service'; + $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'Security key for payment on a service of a contract'; $substitutionarray['__DIRECTDOWNLOAD_URL_PROPOSAL__'] = 'Direct download url of a proposal'; $substitutionarray['__DIRECTDOWNLOAD_URL_ORDER__'] = 'Direct download url of an order'; From a70f5dd90e89e87468ca5403fbe2fda940d3c734 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 12:12:11 +0200 Subject: [PATCH 09/11] Doc --- htdocs/core/class/extrafields.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 5c9401fca35..5b6fbf1ab9d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2047,9 +2047,9 @@ class ExtraFields * * @param array $extralabels Deprecated (old $array of extrafields, now set this to null) * @param object $object Object - * @param string $onlykey Only some keys are filled:$this - * 'string' => When we make update of only one extrafield ($action = 'update_extras'), calling page can set this to avoid to have other extrafields being reset. - * '@GETPOSTISSET' => When we make update of extrafields ($action = 'update'), calling page can set this to avoid to have fields not into POST being reset. + * @param string $onlykey Only some keys are filled: + * 'string' => When we make update of only one extrafield ($action = 'update_extras'), calling page can set this to avoid to have other extrafields being reset. + * '@GETPOSTISSET' => When we make update of several extrafields ($action = 'update'), calling page can set this to avoid to have fields not into POST being reset. * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) */ public function setOptionalsFromPost($extralabels, &$object, $onlykey = '') From 9426af8f6a1ea5f15b71f28a9b525043919c78d3 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 25 Sep 2021 07:49:08 +0200 Subject: [PATCH 10/11] NEW #18820 Accountancy - Add product account in import/export of thirdparty (level 3) --- htdocs/core/modules/modSociete.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index af4fb9e64b8..7c3d93499e4 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -281,6 +281,9 @@ class modSociete extends DolibarrModules if (!empty($conf->global->PRODUIT_MULTIPRICES)) { $this->export_fields_array[$r]['s.price_level'] = 'PriceLevel'; } + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + $this->export_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); + } // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('societe'))); // If project are shared, nb will be > 1 @@ -317,7 +320,8 @@ class modSociete extends DolibarrModules 'payterm.libelle'=>'Text', 'paymode.libelle'=>'Text', 's.outstanding_limit'=>'Numeric', 'pbacc.ref'=>'Text', 'incoterm.code'=>'Text', 'u.login'=>'Text', 'u.firstname'=>'Text', 'u.lastname'=>'Text', - 's.entity'=>'Numeric', 's.price_level'=>'Numeric' + 's.entity'=>'Numeric', 's.price_level'=>'Numeric', + 's.accountancy_code_sell'=>'Text', 's.accountancy_code_buy'=>'Text' ); $this->export_entities_array[$r] = array('u.login'=>'user', 'u.firstname'=>'user', 'u.lastname'=>'user'); // We define here only fields that use another picto @@ -488,6 +492,9 @@ class modSociete extends DolibarrModules if (!empty($conf->global->PRODUIT_MULTIPRICES)) { $this->import_fields_array[$r]['s.price_level'] = 'PriceLevel'; } + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + $this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); + } // Add extra fields $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")"; $resql = $this->db->query($sql); @@ -621,7 +628,9 @@ class modSociete extends DolibarrModules 's.canvas' => "empty / a custom canvas form layout url e.g. mycanvas@mymodule", 's.datec' => 'formatted as '.dol_print_date(dol_now(), '%Y-%m-%d'), 's.fk_multicurrency' => '0 (use system default currency) / 1 (use local currency)', - 's.multicurrency_code' => 'GBP/USD etc... matches field "code_iso" in table "'.MAIN_DB_PREFIX.'c_currencies"' + 's.multicurrency_code' => 'GBP/USD etc... matches field "code_iso" in table "'.MAIN_DB_PREFIX.'c_currencies"', + 's.accountancy_code_sell' => '707', + 's.accountancy_code_buy' => '607', ); $this->import_updatekeys_array[$r] = array( 's.nom' => 'Name', From fc56b88a1f7c5cbd6d3f0fcdcd9f8508c3b8c05d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Sep 2021 13:44:42 +0200 Subject: [PATCH 11/11] FIX select list of orders not complete when field type of company is on --- htdocs/commande/class/commande.class.php | 12 ++++++------ htdocs/commande/list.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 050b7251898..f02e74687af 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -299,13 +299,9 @@ class Commande extends CommonOrder 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>56), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60), + 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>70), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80), 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95), @@ -344,6 +340,10 @@ class Commande extends CommonOrder 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), 'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275), 'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302), + 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>304), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), ); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b3a0ec37167..e2ea9b2222c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -545,7 +545,7 @@ if ($search_state) { if ($search_country) { $sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')'; } -if ($search_type_thirdparty) { +if ($search_type_thirdparty && $search_type_thirdparty != '-1') { $sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')'; } if ($search_company) { @@ -787,7 +787,7 @@ if ($resql) { if ($search_country != '') { $param .= '&search_country='.urlencode($search_country); } - if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { + if ($search_type_thirdparty && $search_type_thirdparty != '-1') { $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); } if ($search_product_category != '') {
'.$langs->trans("Search").'
'; -$searchbox .= $langs->trans("User").':
'; - $searchbox .= $langs->trans("Group").':