diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index 7b9b4cd73..448dbf06e 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -3371,11 +3371,11 @@ class Acc_Ledger extends jrn_def_sql $this->jrn_def_id = $p_jrn; $this->jrn_def_name = $p_jrn_name; $this->jrn_def_ech_lib = $p_ech_lib; - $this->jrn_def_max_line_deb = $p_jrn_deb_max_line; + $this->jrn_def_max_line_deb = ($p_jrn_deb_max_line<1)?1:$p_jrn_deb_max_line; $this->jrn_def_type = $p_jrn_type; $this->jrn_def_pj_pref = $jrn_def_pj_pref; $this->jrn_def_fiche_deb = (isset($FICHEDEB)) ? join($FICHEDEB, ',') : ""; - $this->jrn_deb_max_line=$min_row; + $this->jrn_deb_max_line=($min_row<1)?1:$min_row; switch ($this->jrn_def_type) { case 'ACH': diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php index 2e01a7458..930d6f675 100644 --- a/include/class_acc_ledger_purchase.php +++ b/include/class_acc_ledger_purchase.php @@ -1074,11 +1074,13 @@ class Acc_Ledger_Purchase extends Acc_Ledger // Record the current number of article - $Hid=new IHidden(); - $p_article= ( isset ($nb_item))?$nb_item:MAX_ARTICLE; - $r.=$Hid->input("nb_item",$p_article); + $e_comment=(isset($e_comment))?$e_comment:""; - $max=($p_article < MAX_ARTICLE)?MAX_ARTICLE:$p_article; + $p_article= ( isset ($nb_item))?$nb_item:$this->get_min_row(); + $max=($p_article < $this->get_min_row())?$this->get_min_row():$p_article; + + $Hid=new IHidden(); + $r.=$Hid->input("nb_item",$p_article); // For each article //-- diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php index 35ea08433..dad4d806e 100644 --- a/include/class_acc_ledger_sold.php +++ b/include/class_acc_ledger_sold.php @@ -1209,9 +1209,9 @@ class Acc_Ledger_Sold extends Acc_Ledger // Record the current number of article $Hid=new IHidden(); - $p_article= ( isset ($nb_item))?$nb_item:MAX_ARTICLE; + $p_article= ( isset ($nb_item))?$nb_item:$this->get_min_row(); $r.=$Hid->input("nb_item",$p_article); - $max=($p_article < MAX_ARTICLE)?MAX_ARTICLE:$p_article; + $max=($p_article < $this->get_min_row())?$this->get_min_row():$p_article; $f_legend_detail=_("Détail articles vendus"); diff --git a/include/class_pre_op_ach.php b/include/class_pre_op_ach.php index 944085712..83bcef0fd 100644 --- a/include/class_pre_op_ach.php +++ b/include/class_pre_op_ach.php @@ -238,12 +238,13 @@ class Pre_op_ach extends Pre_operation_detail // Record the current number of article - $Hid=new IHidden(); - $p_article= ( isset ($nb_item))?$nb_item:MAX_ARTICLE; - $r.=$Hid->input("nb_item",$p_article); - $e_comment=(isset($e_comment))?$e_comment:""; - $max=($p_article < MAX_ARTICLE)?MAX_ARTICLE:$p_article; + $min=$ledger->get_min_row(); + $p_article= ( isset ($nb_item))?$nb_item:$min; + $max=($p_article < $min)?$min:$p_article; + $e_comment=(isset($e_comment))?$e_comment:""; + $Hid=new IHidden(); + $r.=$Hid->input("nb_item",$p_article); // For each article //-- for ($i=0;$i< $max ;$i++) diff --git a/include/class_pre_op_ven.php b/include/class_pre_op_ven.php index f07c65a59..30afc0712 100644 --- a/include/class_pre_op_ven.php +++ b/include/class_pre_op_ven.php @@ -146,7 +146,7 @@ class Pre_op_ven extends Pre_operation_detail if ( $p_array != null ) extract($p_array); require_once 'class_acc_ledger_sold.php'; $ledger=new Acc_Ledger_Sold($this->db,$this->jrn_def_id); - + $flag_tva=$g_parameter->MY_TVA_USE; /* Add button */ $f_add_button=new IButton('add_card'); @@ -171,14 +171,14 @@ class Pre_op_ven extends Pre_operation_detail $str_add_button=$f_add_button->input(); $str_add_button2=$f_add_button2->input(); } - + $r=''; $r.=dossier::hidden(); $f_legend=_('En-tête facture client'); - + /* if we suggest the next pj, then we need a javascript */ - + // Display the customer //-- $fiche='deb'; @@ -231,11 +231,13 @@ class Pre_op_ven extends Pre_operation_detail // Record the current number of article - $Hid=new IHidden(); - $p_article= ( isset ($nb_item))?$nb_item:MAX_ARTICLE; - $r.=$Hid->input("nb_item",$p_article); - $max=($p_article < MAX_ARTICLE)?MAX_ARTICLE:$p_article; + $min=$ledger->get_min_row(); + $p_article= ( isset ($nb_item))?$nb_item:$min; + $max=($p_article < $min)?$min:$p_article; + $e_comment=(isset($e_comment))?$e_comment:""; + $Hid=new IHidden(); + $r.=$Hid->input("nb_item",$p_article); $f_legend_detail=_("Détail articles vendus");