From 27687e9153f5943c1605d9a0a455a8d2dcb04fc1 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 3 Feb 2026 23:53:17 +0100 Subject: [PATCH] Fix Bug : duplicate operation doesn't allow to add more items --- include/class/acc_operation.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/class/acc_operation.class.php b/include/class/acc_operation.class.php index 3ac02140f..d4f5eed8f 100644 --- a/include/class/acc_operation.class.php +++ b/include/class/acc_operation.class.php @@ -910,7 +910,7 @@ EOF; // retrieve all info about operation $operation = $this->get_quant(); $array=$operation->compute_array(); - + global $g_user; $a_code=$this->db->get_array("select code from v_menu_dependency vmd where me_code=$1 and p_id=$2", array( $operation->signature,$g_user->get_profile())); @@ -1013,6 +1013,8 @@ EOF; echo \Noalyss\Dbg::hidden_info("operation->det", $operation->det); echo \Noalyss\Dbg::hidden_info("array", $array); } + $ledger=new \Acc_Ledger($this->db,$operation->det->jr_def_id); + $array['nb_item']=max($ledger->get_min_row(),$array['nb_item']); // transform the operation into hidden element $r.=HtmlInput::simple_array_to_hidden($array); $r.=HtmlInput::hidden("e_comm",$operation->det->jr_comment);