From 9d89e48d154276396e0dcd1c217cfa59577ac7df Mon Sep 17 00:00:00 2001 From: Julien Gainza Date: Mon, 6 Sep 2021 15:55:33 +0200 Subject: [PATCH 01/59] Fix : Add extrafields on API "get events list" --- htdocs/comm/action/class/api_agendaevents.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index d9feb4472b6..bf35ed95be0 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -171,6 +171,7 @@ class AgendaEvents extends DolibarrApi $obj = $db->fetch_object($result); $actioncomm_static = new ActionComm($db); if ($actioncomm_static->fetch($obj->rowid)) { + $actioncomm_static->fetch_optionals(); $obj_ret[] = $this->_cleanObjectDatas($actioncomm_static); } $i++; From a39f469a503de75d5404d1e4faf7a9e8d0f952d9 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Tue, 7 Sep 2021 22:31:09 +1100 Subject: [PATCH 02/59] Only check takepos configuration if a terminal is choosen, to prevent error message --- htdocs/takepos/index.php | 51 +++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 1ddab39dcbe..61edb446963 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -978,36 +978,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { query($sql); -$paiementsModes = array(); -if ($resql) { - while ($obj = $db->fetch_object($resql)) { - $paycode = $obj->code; - if ($paycode == 'LIQ') { - $paycode = 'CASH'; - } - if ($paycode == 'CHQ') { - $paycode = 'CHEQUE'; - } + $resql = $db->query( $sql ); + $paiementsModes = array(); + if ( $resql ) { + while ( $obj = $db->fetch_object( $resql ) ) { + $paycode = $obj->code; + if ( $paycode == 'LIQ' ) { + $paycode = 'CASH'; + } + if ( $paycode == 'CHQ' ) { + $paycode = 'CHEQUE'; + } - $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"]; - //var_dump($constantforkey.' '.$conf->global->$constantforkey); - if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) { - array_push($paiementsModes, $obj); + $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"]; + //var_dump($constantforkey.' '.$conf->global->$constantforkey); + if ( ! empty( $conf->global->$constantforkey ) && $conf->global->$constantforkey > 0 ) { + array_push( $paiementsModes, $obj ); + } } } + + if ( empty( $paiementsModes ) ) { + $langs->load( 'errors' ); + setEventMessages( $langs->trans( "ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv( "TakePOS" ) ), null, 'errors' ); + setEventMessages( $langs->trans( "ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"] ), null, 'errors' ); + } } -if (empty($paiementsModes)) { - $langs->load('errors'); - setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); - setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); -} if (count($maincategories) == 0) { if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { $tmpcategory = new Categorie($db); From 807b4bf93e8b9662a4c393ba62191895087915ea Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Tue, 7 Sep 2021 22:42:17 +1100 Subject: [PATCH 03/59] Fix cash payment in some cases. Make pay requests language independant and rely on payment method code. --- htdocs/takepos/invoice.php | 6 ++---- htdocs/takepos/pay.php | 15 +++------------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 0c00fcdd938..4130ac5c3cb 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) { if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { $bankaccount = GETPOST('accountid', 'int'); } else { - if ($pay == "cash") { + if ($pay == 'LIQ') { $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility - } elseif ($pay == "card") { - $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility - } elseif ($pay == "cheque") { + } elseif ($pay == "CHQ") { $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility } else { $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index ba8ac8f82f7..6e22f27f7ff 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -316,23 +316,20 @@ print ''; + print ''; } else { print ''; } @@ -345,23 +342,20 @@ print ''; + print ''; } else { $button = array_pop($action_buttons); print ''; @@ -375,23 +369,20 @@ print ''; + print ''; } else { $button = array_pop($action_buttons); print ''; From c8af143468460be7a252412a89b5ac282fd1d429 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Tue, 7 Sep 2021 23:27:31 +1100 Subject: [PATCH 04/59] Fix coding standards --- htdocs/takepos/index.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 61edb446963..415281af65d 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -978,36 +978,36 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { query( $sql ); + $resql = $db->query($sql); $paiementsModes = array(); - if ( $resql ) { - while ( $obj = $db->fetch_object( $resql ) ) { + if ($resql) { + while ( $obj = $db->fetch_object($resql) ) { $paycode = $obj->code; - if ( $paycode == 'LIQ' ) { + if ($paycode == 'LIQ') { $paycode = 'CASH'; } - if ( $paycode == 'CHQ' ) { + if ($paycode == 'CHQ') { $paycode = 'CHEQUE'; } $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"]; //var_dump($constantforkey.' '.$conf->global->$constantforkey); - if ( ! empty( $conf->global->$constantforkey ) && $conf->global->$constantforkey > 0 ) { - array_push( $paiementsModes, $obj ); + if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) { + array_push($paiementsModes, $obj); } } } - if ( empty( $paiementsModes ) ) { - $langs->load( 'errors' ); - setEventMessages( $langs->trans( "ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv( "TakePOS" ) ), null, 'errors' ); - setEventMessages( $langs->trans( "ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"] ), null, 'errors' ); + if (empty($paiementsModes)) { + $langs->load('errors'); + setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); + setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); } } From 65c4a2189860f8176955db309531fa75aea55e4c Mon Sep 17 00:00:00 2001 From: Julien Gainza Date: Mon, 13 Sep 2021 16:35:13 +0200 Subject: [PATCH 05/59] FIX move fetch_optionnal into $ac_static->fetch() --- htdocs/comm/action/class/actioncomm.class.php | 1 + htdocs/comm/action/class/api_agendaevents.class.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9e562173b04..a6252ecebe3 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -763,6 +763,7 @@ class ActionComm extends CommonObject $this->elementid = $obj->elementid; $this->elementtype = $obj->elementtype; + $this->fetch_optionals(); $this->fetchResources(); } $this->db->free($resql); diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index bf35ed95be0..d9feb4472b6 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -171,7 +171,6 @@ class AgendaEvents extends DolibarrApi $obj = $db->fetch_object($result); $actioncomm_static = new ActionComm($db); if ($actioncomm_static->fetch($obj->rowid)) { - $actioncomm_static->fetch_optionals(); $obj_ret[] = $this->_cleanObjectDatas($actioncomm_static); } $i++; From fe241cc71f474a340ddcc65fa6c733e6c31f3dbf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Sep 2021 21:12:39 +0200 Subject: [PATCH 06/59] FIX Accountancy - Format Quadra export - Missing line type C (act account) --- .../class/accountancyexport.class.php | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 9749cd91d4d..66ddd704b1b 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -516,14 +516,19 @@ class AccountancyExport } /** - * Export format : Quadratus + * Export format : Quadratus (Format ASCII) + * Format since 2015 compatible QuadraCOMPTA + * Last review for this format : 2021/09/13 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html + * In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)" * * @param array $TData data * @return void */ public function exportQuadratus(&$TData) { - global $conf; + global $conf, $db; $end_line = "\r\n"; @@ -536,6 +541,40 @@ class AccountancyExport $code_compta = $data->subledger_account; } + $Tab = array(); + + if (!empty($data->subledger_account)){ + $Tab['type_ligne'] = 'C'; + $Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8); + $Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30); + $Tab['filler'] = str_repeat(' ', 59); + + if ($data->doc_type == 'customer_invoice') { + $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); + } elseif ($data->doc_type == 'supplier_invoice') { + $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); + } else { + $Tab['coll_compte'] = str_pad(' ', 8); + } + + $Tab['filler2'] = str_repeat(' ', 110); + $Tab['Maj'] = 2; // Maj partielle (clé alpha, intitulé, adresse, collectif, RIB) + + if ($data->doc_type == 'customer_invoice') { + $Tab['type_compte'] = 'C'; + } elseif ($data->doc_type == 'supplier_invoice') { + $Tab['coll_compte'] = 'F'; + } else { + $Tab['coll_compte'] = 'G'; + } + + $Tab['filler3'] = str_repeat(' ', 235); + + $Tab['end_line'] = $end_line; + + print implode($Tab); + } + $Tab = array(); $Tab['type_ligne'] = 'M'; $Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8); From 6368ba9a6e1d66abd2eb98a1038569f268049bf5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 13 Sep 2021 19:21:53 +0000 Subject: [PATCH 07/59] Fixing style errors. --- htdocs/accountancy/class/accountancyexport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 60dbd67f201..ec1325046cb 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -543,7 +543,7 @@ class AccountancyExport $Tab = array(); - if (!empty($data->subledger_account)){ + if (!empty($data->subledger_account)) { $Tab['type_ligne'] = 'C'; $Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8); $Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30); From 42543ba005c8ab3395390c811a94a27f8a5c49c8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Sep 2021 21:29:31 +0200 Subject: [PATCH 08/59] Add alpha key --- htdocs/accountancy/class/accountancyexport.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 60dbd67f201..07b641d8864 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -547,18 +547,22 @@ class AccountancyExport $Tab['type_ligne'] = 'C'; $Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8); $Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30); - $Tab['filler'] = str_repeat(' ', 59); if ($data->doc_type == 'customer_invoice') { + $Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6)); + $Tab['filler'] = str_repeat(' ', 52); $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); } elseif ($data->doc_type == 'supplier_invoice') { + $Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6)); + $Tab['filler'] = str_repeat(' ', 52); $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); } else { + $Tab['filler'] = str_repeat(' ', 59); $Tab['coll_compte'] = str_pad(' ', 8); } $Tab['filler2'] = str_repeat(' ', 110); - $Tab['Maj'] = 2; // Maj partielle (clé alpha, intitulé, adresse, collectif, RIB) + $Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB) if ($data->doc_type == 'customer_invoice') { $Tab['type_compte'] = 'C'; From 0763846805408b76bcc60a4a3e456fd2795adb75 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Tue, 14 Sep 2021 02:15:22 +0200 Subject: [PATCH 09/59] Bug: #18670 date, account and payment type are lost when sorting by any field Filtereds $date, $search_account and $search_paymenttype are not saved when sorting by any field --- htdocs/compta/paiement/list.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 5f2d4d9a2cd..e21d704889d 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -277,6 +277,11 @@ $param .= (GETPOST("orphelins") ? "&orphelins=1" : ''); $param .= ($search_ref ? "&search_ref=".urlencode($search_ref) : ''); $param .= ($search_company ? "&search_company=".urlencode($search_company) : ''); $param .= ($search_amount ? "&search_amount=".urlencode($search_amount) : ''); +$param .= ($search_paymenttype ? "&search_paymenttype=".urlencode($search_paymenttype) : ""); +$param .= ($search_account ? "&search_account=".urlencode($search_account) : ""); +$param .= ($day ? "&day=".urlencode($day) : ""); +$param .= ($month ? "&month=".urlencode($month) : ""); +$param .= ($year ? "&year=".urlencode($year) : ""); $param .= ($search_payment_num ? "&search_payment_num=".urlencode($search_payment_num) : ''); if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); From e1203d115add9debedc30fc8c16996f6773199e2 Mon Sep 17 00:00:00 2001 From: javieralapps4up Date: Tue, 14 Sep 2021 02:22:30 +0200 Subject: [PATCH 10/59] Update list.php --- htdocs/compta/paiement/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index e21d704889d..756c80e5777 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -277,11 +277,11 @@ $param .= (GETPOST("orphelins") ? "&orphelins=1" : ''); $param .= ($search_ref ? "&search_ref=".urlencode($search_ref) : ''); $param .= ($search_company ? "&search_company=".urlencode($search_company) : ''); $param .= ($search_amount ? "&search_amount=".urlencode($search_amount) : ''); -$param .= ($search_paymenttype ? "&search_paymenttype=".urlencode($search_paymenttype) : ""); -$param .= ($search_account ? "&search_account=".urlencode($search_account) : ""); -$param .= ($day ? "&day=".urlencode($day) : ""); -$param .= ($month ? "&month=".urlencode($month) : ""); -$param .= ($year ? "&year=".urlencode($year) : ""); +$param .= ($search_paymenttype ? "&search_paymenttype=".urlencode($search_paymenttype) : ''); +$param .= ($search_account ? "&search_account=".urlencode($search_account) : ''); +$param .= ($day ? "&day=".urlencode($day) : ''); +$param .= ($month ? "&month=".urlencode($month) : ''); +$param .= ($year ? "&year=".urlencode($year) : ''); $param .= ($search_payment_num ? "&search_payment_num=".urlencode($search_payment_num) : ''); if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); From 7a637104b26a5b985011fdd7f0cbe5dd9f1fb53b Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 15 Sep 2021 11:29:12 +0200 Subject: [PATCH 11/59] Fix: Not filter by company when it is an external user --- htdocs/compta/paiement/list.php | 11 +++++------ htdocs/fourn/paiement/list.php | 6 ++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index cfcdead5fed..20f69401fd6 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2021 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2020 Tobias Sekan * @@ -31,11 +31,6 @@ */ require '../../main.inc.php'; - -// Security check -if ($user->socid) $socid = $user->socid; -$result = restrictedArea($user, 'facture', $facid, ''); - require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; @@ -58,6 +53,10 @@ $day = GETPOST('day', 'int'); $month = GETPOST('month', 'int'); $year = GETPOST('year', 'int'); +// Security check +if ($user->socid) $socid = $user->socid; +$result = restrictedArea($user, 'facture', $facid, ''); + $search_ref = GETPOST("search_ref", "alpha"); $search_company = GETPOST("search_company", 'alpha'); $search_paymenttype = GETPOST("search_paymenttype"); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index f61d1795cba..13adc9d1ffc 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -35,8 +35,7 @@ require '../../main.inc.php'; -// Security check -if ($user->socid) $socid = $user->socid; + // doesn't work :-( // restrictedArea($user, 'fournisseur'); @@ -64,6 +63,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : ' $socid = GETPOST('socid', 'int'); +// Security check +if ($user->socid) $socid = $user->socid; + $search_ref = GETPOST('search_ref', 'alpha'); $search_day = GETPOST('search_day', 'int'); $search_month = GETPOST('search_month', 'int'); From ed37f9fb7a602ff97babc8f45ea32c7497b9c4ea Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 16 Sep 2021 06:40:43 +0200 Subject: [PATCH 12/59] FIX Accountancy - Some correction on export name --- htdocs/accountancy/class/accountancyexport.class.php | 4 ++-- htdocs/langs/en_US/accountancy.lang | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 1f987f61602..ace7f236212 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -119,8 +119,8 @@ class AccountancyExport self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'), self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'), self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'), - self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'), - self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'), + self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'), + self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'), self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'), self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'), ); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 771f0a83e7b..fc4b86a2cdb 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -343,7 +343,7 @@ Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT) Modelcsv_quadratus=Export for Quadratus QuadraCompta Modelcsv_ebp=Export for EBP Modelcsv_cogilog=Export for Cogilog -Modelcsv_agiris=Export for Agiris +Modelcsv_agiris=Export for Agiris Isacompta Modelcsv_LDCompta=Export for LD Compta (v9) (Test) Modelcsv_LDCompta10=Export for LD Compta (v10 & higher) Modelcsv_openconcerto=Export for OpenConcerto (Test) @@ -351,9 +351,10 @@ Modelcsv_configurable=Export CSV Configurable Modelcsv_FEC=Export FEC Modelcsv_FEC2=Export FEC (With dates generation writing / document reversed) Modelcsv_Sage50_Swiss=Export for Sage 50 Switzerland -Modelcsv_winfic=Export Winfic - eWinfic - WinSis Compta +Modelcsv_winfic=Export for Winfic - eWinfic - WinSis Compta Modelcsv_Gestinumv3=Export for Gestinum (v3) -Modelcsv_Gestinumv5Export for Gestinum (v5) +Modelcsv_Gestinumv5=Export for Gestinum (v5) +Modelcsv_charlemagne=Export for Aplim Charlemagne ChartofaccountsId=Chart of accounts Id ## Tools - Init accounting account on product / service From 3091448d1adcc1bba4af2bafa7f2a81afa7d1bc7 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 16 Sep 2021 15:40:25 +0200 Subject: [PATCH 13/59] Expose bank account holder, label and number Useful for automated texts on invoices to have those values available as well. --- htdocs/core/class/commondocgenerator.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index aa8cb7a1301..4fc966459a4 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -399,6 +399,9 @@ abstract class CommonDocGenerator $array_key.'_bank_iban'=>$bank_account->iban, $array_key.'_bank_bic'=>$bank_account->bic, + $array_key.'_bank_label'=>$bank_account->label, + $array_key.'_bank_number'=>$bank_account->number, + $array_key.'_bank_proprio'=>$bank_account->proprio, $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), From 424ddcb218aabcf55370590f9ba963f754af1362 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Sep 2021 16:33:51 +0200 Subject: [PATCH 14/59] Fix page of payment --- htdocs/public/payment/newpayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 702c910ea01..d7bf9b3d565 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1834,7 +1834,8 @@ if ($source == 'organizedeventregistration') { // Debitor print ''.$langs->trans("Attendee"); print ''; - print $thirdparty->name; + print $attendee->email; + print ($thirdparty->name ? ' ('.$thirdparty->name.')' : ''); print ''; print ''."\n"; From 88cd8fface58a2f95cc6c4f6e41320b04879acb4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 16 Sep 2021 17:53:47 +0200 Subject: [PATCH 15/59] FIX: task time: can't filter by user with pgsql + show error message --- htdocs/projet/tasks/time.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 2a4b1d6aeee..7baac31a51a 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1058,7 +1058,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($search_note) $sql .= natural_search('t.note', $search_note); if ($search_task_ref) $sql .= natural_search('pt.ref', $search_task_ref); if ($search_task_label) $sql .= natural_search('pt.label', $search_task_label); - if ($search_user > 0) $sql .= natural_search('t.fk_user', $search_user); + if ($search_user > 0) $sql .= ' AND t.fk_user = ' . intval($search_user); if ($search_valuebilled == '1') $sql .= ' AND t.invoice_id > 0'; if ($search_valuebilled == '0') $sql .= ' AND (t.invoice_id = 0 OR t.invoice_id IS NULL)'; $sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year); @@ -1069,6 +1069,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); + + if (! $resql) { + dol_print_error($db); + exit; + } + $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 { From bfe305dc47456851fefc744a15d5dc994f1822ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Sep 2021 17:46:47 +0200 Subject: [PATCH 16/59] Debug event organization module --- .../conferenceorbooth_list.php | 21 +++-- .../eventorganization/attendee_register.php | 86 +++++++++++++------ 2 files changed, 74 insertions(+), 33 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index c46798b05b5..5f6e2820591 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -55,6 +55,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $id = GETPOST('id', 'int'); $projectid = GETPOST('projectid', 'int'); +$projectref = GETPOST('ref'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -152,12 +153,12 @@ if (!$permissiontoread) accessforbidden(); * Actions */ -if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) { +if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) { $project = new Project($db); //If "set" fields keys is in projects fields $project_attr=preg_replace('/^set/', '', $action); if (array_key_exists($project_attr, $project->fields)) { - $result = $project->fetch($projectid); + $result = $project->fetch($projectid, $projectref); if ($result < 0) { setEventMessages(null, $project->errors, 'errors'); } else { @@ -234,11 +235,13 @@ $now = dol_now(); $help_url = ''; $title = $langs->trans('ListOfConferencesOrBooths'); -if ($projectid > 0) { +if ($projectid > 0 || $projectref) { $project = new Project($db); - $result = $project->fetch($projectid); + $result = $project->fetch($projectid, $projectref); if ($result < 0) { setEventMessages(null, $project->errors, 'errors'); + } else { + $projectid = $project->id; } $result = $project->fetch_thirdparty(); if ($result < 0) { @@ -430,8 +433,8 @@ if ($projectid > 0) { print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage")); //print ''; print ''; - $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); + $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id); + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5'); $linksuggest .= '&securekey='.urlencode($encodedsecurekey); //print '