From 55b1a11f6a607bf15b1359f227ea72b901f759a9 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sat, 6 Dec 2025 17:57:54 +0100 Subject: [PATCH 1/5] Acc_Ledger_Search : Inject column --- include/class/acc_ledger_search.class.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/class/acc_ledger_search.class.php b/include/class/acc_ledger_search.class.php index 8d0871d2d..bf211a5b3 100644 --- a/include/class/acc_ledger_search.class.php +++ b/include/class/acc_ledger_search.class.php @@ -38,7 +38,11 @@ class Acc_Ledger_Search private $all; //!< Flag to indicate if all ledgers must be searched (1 for yes) private $div; //!< prefix for id of DOM id var $id ; //!< id of the ledger - private $inject_col; //< inject code into list_operation to add an extra column + private $inject_col; //< inject_code (string) code into list_operation + // to add an extra column + // (see Acc_Ledger_Search::list_operation). + // All the HTML code must be in inject_code, including the TD tag + /** * @brief return a HTML string with the form for the search * @param $p_type if the type of ledger possible values=ALL,VEN,ACH,ODS,FIN: uppercase ! @@ -792,7 +796,10 @@ class Acc_Ledger_Search * \see build_search_sql * \see display_search_form * \see search_form - + @note $this->inject_code (string) code into Acc_Ledger_Search::list_operation + // to add an extra column + // (see Acc_Ledger_Search::list_operation). + // All the HTML code must be in inject_code, including the TD tag * \return HTML string */ public function list_operation($sql, $offset, $p_paid=0) @@ -1042,7 +1049,14 @@ class Acc_Ledger_Search } else $r.=""; - + //< inject_code (string) code into list_operation + // to add an extra column + // (see Acc_Ledger_Search::list_operation). + // All the HTML code must be in inject_code, including the TD tag + if ( $this->inject_col != null) + { + $r.=$this->inject_col; + } // end row $r.=""; } From e431f1d54ded874e43b846212b26c2600e7f8b5a Mon Sep 17 00:00:00 2001 From: sparkyx Date: Mon, 8 Dec 2025 10:32:07 +0100 Subject: [PATCH 2/5] FREC = Upload of document fails --- include/compta_fin_rec.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/compta_fin_rec.inc.php b/include/compta_fin_rec.inc.php index fbc1c09d3..1e85c33dd 100644 --- a/include/compta_fin_rec.inc.php +++ b/include/compta_fin_rec.inc.php @@ -223,7 +223,7 @@ if (isset($_POST['save'])) { echo '
'.$g_succeed.' Mise à jour extrait '.$_POST['ext'].'
'; // -- chargement fichier - $oid=$cn->upload('file_receipt'); + $oid=$cn->upload('file_receipt',true); if ( $oid != false ) { for ($i = 0; $i < count($array); $i++) From 213a0044dc51d72afec7c8d8d7e0aa9b5cc367dd Mon Sep 17 00:00:00 2001 From: sparkyx Date: Wed, 10 Dec 2025 17:44:59 +0100 Subject: [PATCH 3/5] Bug : file not loaded after inserting new operation --- include/class/acc_document.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/class/acc_document.class.php b/include/class/acc_document.class.php index f0b9aaf43..11e2ab5ab 100644 --- a/include/class/acc_document.class.php +++ b/include/class/acc_document.class.php @@ -371,7 +371,22 @@ class Acc_Document extends Document { \record_log($e); throw new \Exception("X281 ",281,$e); } - } + } else { + $this->d_lob=$oid; + $this->d_name=$_FILES['pj']['name']; + $this->d_description=$_FILES['pj']['type']; + + // save extracted document into DB + $this->db->exec_sql("update jrn set jr_pj=$1 , jr_pj_name=$2, + jr_pj_type=$3 where jr_id=$4", + array( + $this->d_lob + , $this->d_name + , $this->d_description + , $this->d_id + ) + ); + } $this->db->commit(); return $oid; From f082ccb7ab29fd8536f1e06bd5c4676d0bf40b94 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Wed, 10 Dec 2025 17:45:20 +0100 Subject: [PATCH 4/5] Acc_Ledger_Search : let you add you own column --- include/class/acc_ledger_search.class.php | 43 +++++++++++++++++++---- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/include/class/acc_ledger_search.class.php b/include/class/acc_ledger_search.class.php index bf211a5b3..60ef7d600 100644 --- a/include/class/acc_ledger_search.class.php +++ b/include/class/acc_ledger_search.class.php @@ -38,10 +38,12 @@ class Acc_Ledger_Search private $all; //!< Flag to indicate if all ledgers must be searched (1 for yes) private $div; //!< prefix for id of DOM id var $id ; //!< id of the ledger - private $inject_col; //< inject_code (string) code into list_operation + public $inject_col; //!< inject_code (callback function ) into list_operation // to add an extra column // (see Acc_Ledger_Search::list_operation). // All the HTML code must be in inject_code, including the TD tag + // example $this->inject_col = function() {echo "} + /** * @brief return a HTML string with the form for the search @@ -108,7 +110,6 @@ class Acc_Ledger_Search * @see build_search_sql * @see display_search_form * @see list_operation - * @example search_acc_operation.php */ function search_form() { @@ -797,10 +798,34 @@ class Acc_Ledger_Search * \see display_search_form * \see search_form @note $this->inject_code (string) code into Acc_Ledger_Search::list_operation - // to add an extra column - // (see Acc_Ledger_Search::list_operation). - // All the HTML code must be in inject_code, including the TD tag - * \return HTML string + * Example of using inject_col to inject a new column + * @code + %s // %s", $param['jr_id'], $param['jr_montant']); + } elseif ($param == 'header') + { + + return ' Operation & montant'; + } +} + +$acc_ledger_search = new Acc_Ledger_Search('VEN', 1, 1); +$acc_ledger_search->inject_col = "inject_col"; + +list($sql, $where) = $acc_ledger_search->build_search_sql($_GET); +list($nb_count, $html) = $acc_ledger_search->list_operation($sql . " and " . $where, 0); + +printf("There are %s rows", $nb_count); +print $html; + + * @endcode + * \return array($count, $html_code); */ public function list_operation($sql, $offset, $p_paid=0) { @@ -888,6 +913,10 @@ class Acc_Ledger_Search } $r.=""._('Concerne').""; $r.=""._('Document').""; + if ( $this->inject_col != null) + { + $r.=call_user_func($this->inject_col,"header"); + } $r.=""; // Total Amount $tot=0.0; @@ -1055,7 +1084,7 @@ class Acc_Ledger_Search // All the HTML code must be in inject_code, including the TD tag if ( $this->inject_col != null) { - $r.=$this->inject_col; + $r.=call_user_func($this->inject_col,$row); } // end row $r.=""; From 102ee05fd649fa7ecc0dea36057c7cfbee94dae0 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Wed, 10 Dec 2025 17:48:07 +0100 Subject: [PATCH 5/5] doxygen code documentation --- Doxyfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 38aca0d3c..4abe7bc3c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -998,7 +998,8 @@ EXCLUDE = ./html/addon \ ./include/config.inc.php \ ./vendor \ ./include/tfpdf \ - ./tmp/ + ./tmp/ \ + ./html/js/tinymce # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or