From bdfb364b7ec092f620d2e57fbdb427b5135e60c1 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 29 Feb 2016 21:42:54 +0100 Subject: [PATCH] Correct the number of rows with predefined operations --- include/class/class_pre_op_ach.php | 8 ++++++-- include/class/class_pre_op_ven.php | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/class/class_pre_op_ach.php b/include/class/class_pre_op_ach.php index 4b51271ed..34d40c6d4 100644 --- a/include/class/class_pre_op_ach.php +++ b/include/class/class_pre_op_ach.php @@ -126,14 +126,18 @@ class Pre_op_ach extends Pre_operation_detail } else { - $array+=array("e_march".$count=>$row['opd_poste'], + if ( trim($row['opd_poste']) !="" ) + { + $array+=array("e_march".$count=>$row['opd_poste'], "e_march".$count."_price"=>$row['opd_amount'], "e_march".$count."_tva_id"=>$row['opd_tva_id'], "e_march".$count."_tva_amount"=>$row['opd_tva_amount'], "e_quant".$count=>$row['opd_quantity'] ); - $count++; + $count++; + } } + $array['nb_item']=$count; } return $array; } diff --git a/include/class/class_pre_op_ven.php b/include/class/class_pre_op_ven.php index 5c386a5c3..26e322d0a 100644 --- a/include/class/class_pre_op_ven.php +++ b/include/class/class_pre_op_ven.php @@ -124,16 +124,20 @@ class Pre_op_ven extends Pre_operation_detail } else { - $array+=array("e_march".$count=>$row['opd_poste'], + if ( trim($row['opd_poste']) != "") + { + $array+=array("e_march".$count=>$row['opd_poste'], "e_march".$count."_price"=>$row['opd_amount'], "e_march".$count."_tva_id"=>$row['opd_tva_id'], "e_quant".$count=>$row['opd_quantity'], "e_march".$count."_label"=>$row['opd_comment'], "e_march".$count."_tva_amount"=>$row['opd_tva_amount'], ); - $count++; + $count++; + } } } + $array['nb_item']=$count; return $array; } /*!\brief load the data from the database and return an array