noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 32/39: Fix Bug : when duplicating an ODS oper


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 32/39: Fix Bug : when duplicating an ODS operation, the accounting is cleared if a card is used
Date: Sat, 11 Jul 2020 13:20:46 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 50cbd096b1dd37e6daa4f11f0d84362c2804cc94
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Tue Jun 30 18:27:45 2020 +0200

    Fix Bug : when duplicating an ODS operation, the accounting is cleared
    if a card is used
---
 include/class/acc_operation.class.php | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/include/class/acc_operation.class.php 
b/include/class/acc_operation.class.php
index 8586607..7639d9d 100644
--- a/include/class/acc_operation.class.php
+++ b/include/class/acc_operation.class.php
@@ -594,8 +594,8 @@ class Acc_Operation
             $ret=new Acc_Fin($this->db,$this->jr_id);
             break;
         default:
-                       $ret=new Acc_Misc($this->db,$this->jr_id);
-                       break;
+            $ret=new Acc_Misc($this->db,$this->jr_id);
+            break;
         }
         $ret->get();
         if ( empty($ret->det->array))
@@ -776,9 +776,20 @@ class Acc_Operation
         }
        
         $r.="</p>";
-        $r.=HtmlInput::simple_array_to_hidden($array);
       
-        //
+        // For Misc Operation , if a card is given then there is no accounting
+        if ( $operation->signature==="ODS") {
+            $nb_array=count($array);
+            for ($i=0;$i<$nb_array;$i++) {
+                if (isset ($array["qc_".$i] ) && $array["qc_".$i] != "" ) {
+                    $array["poste".$i]="";
+                }
+            }
+        }
+        
+        // transform the operation into hidden element
+        $r.=HtmlInput::simple_array_to_hidden($array);
+        
         $r.=HtmlInput::submit(uniqid(), _("Dupliquer"));
         $r.='</form>';
         



reply via email to

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