noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 134/151: Fix Bug : Predefined operation in Sa


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 134/151: Fix Bug : Predefined operation in Sales , impossible to add new items
Date: Sat, 4 Feb 2017 17:14:34 +0000 (UTC)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 702052f55227f7c40142705e89a8ed385b52243f
Author: Dany De Bontridder <address@hidden>
Date:   Mon Jan 23 20:27:31 2017 +0100

    Fix Bug : Predefined operation in Sales , impossible to add new items
---
 include/class/class_pre_op_ven.php |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/class/class_pre_op_ven.php 
b/include/class/class_pre_op_ven.php
index 26e322d..1e9dbb8 100644
--- a/include/class/class_pre_op_ven.php
+++ b/include/class/class_pre_op_ven.php
@@ -30,10 +30,11 @@ require_once  
NOALYSS_INCLUDE.'/class/class_pre_operation.php';
 class Pre_op_ven extends Pre_operation_detail
 {
     var $op;
+    //< Pre_operation
     function __construct($cn,$p_id=0)
     {
         parent::__construct($cn,$p_id);
-        $this->operation->od_direct='f';
+        $this->operation->od_direct='f'; //< Pre_operation
     }
 
     function get_post()
@@ -137,7 +138,13 @@ class Pre_op_ven extends Pre_operation_detail
                 }
             }
         }
-        $array['nb_item']=$count;
+        // Find the ledger
+        $ledger=new Acc_Ledger($this->db,$this->operation->jrn_def_id);
+        // Find the max line of the ledger
+        $max_row=$ledger->GetDefLine();
+        
+        // compute nb_item
+        $array['nb_item']=($max_row > $count)?$max_row:$count;
         return $array;
     }
     /*!\brief load the data from the database and return an array



reply via email to

[Prev in Thread] Current Thread [Next in Thread]