noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 35/173: Task #0001309: Association d'une opér


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 35/173: Task #0001309: Association d'une opération avec elle-même.
Date: Mon, 22 Mar 2021 12:58:32 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit d9510149ffeb7c7abb9315ba852a7e84dd334be4
Author: Dany De Bontridder <dany@alchimerys.be>
AuthorDate: Tue Jan 8 21:35:59 2019 +0100

    Task #0001309: Association d'une opération avec elle-même.
---
 html/js/scripts.js                        |  5 +++--
 include/ajax/ajax_search_operation.php    |  4 +++-
 include/class/acc_ledger_search.class.php | 15 ++++++++++++++-
 include/lib/iconcerned.class.php          | 18 +++++++++++++++---
 include/template/ledger_detail_bottom.php |  7 ++++---
 5 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/html/js/scripts.js b/html/js/scripts.js
index af874cb..4257023 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -1306,7 +1306,7 @@ function search_reconcile(dossier, ctl_concern, 
amount_id, ledger, p_id_target,p
     var str_style = fixed_position(77, 99);
     str_style += ";width:92%;overflow:auto;";
     waiting_box();
-
+    var hide_operation=$(ctl_concern).getAttribute("hide_operation");
 
     var param_send = {gDossier: dossier,
         ctlc: ctl_concern,
@@ -1315,7 +1315,8 @@ function search_reconcile(dossier, ctl_concern, 
amount_id, ledger, p_id_target,p
         amount_id: amount_id,
         ledger: ledger,
         target: target,
-        tiers:tiers
+        tiers:tiers,
+        hide_operation:hide_operation
     };
 
     var qs = encodeJSON(param_send);
diff --git a/include/ajax/ajax_search_operation.php 
b/include/ajax/ajax_search_operation.php
index a279e55..446c9be 100644
--- a/include/ajax/ajax_search_operation.php
+++ b/include/ajax/ajax_search_operation.php
@@ -50,6 +50,8 @@ if (isset($_GET['amount_id']))
     ));
 }
 $target=$http->get("target", "string", "");
+$hide_operation=$http->get("hide_operation","string","");
+
 $ledger=new Acc_Ledger_Search('ALL', 1, $target);
 
 if ($base=='recherche.php'||$base=='do.php')
@@ -103,7 +105,7 @@ if (isset($_GET['viewsearch']))
         // get first date of current exercice
         list($array['date_start'], 
$array['date_end'])=$g_user->get_limit_current_exercice();
     }
-
+    $array['hide_operation']=$hide_operation;
     list($sql, $where)=$ledger->build_search_sql($array);
     // Count nb of line
     $max_line=$cn->count_sql($sql);
diff --git a/include/class/acc_ledger_search.class.php 
b/include/class/acc_ledger_search.class.php
index f2fdb2b..8dd53fa 100644
--- a/include/class/acc_ledger_search.class.php
+++ b/include/class/acc_ledger_search.class.php
@@ -211,6 +211,8 @@ class Acc_Ledger_Search
         $r.=HtmlInput::hidden('ledger_type', $this->type,
                         $this->div."ledger_type");
         $r.=HtmlInput::hidden('ac', $_REQUEST['ac']);
+        if (isset($_REQUEST['hide_operation']))
+            $r.=HtmlInput::hidden("hide_operation", 
$_REQUEST['hide_operation']);
         ob_start();
         $search_filter=$this->build_search_filter();
         require_once NOALYSS_TEMPLATE.'/ledger_search.php';
@@ -383,6 +385,7 @@ class Acc_Ledger_Search
         $fil_account='';
         $fil_paid='';
         $fil_date_paid='';
+        $fil_hide_operation='';
 
         $and='';
         $g_user=new User($this->cn);
@@ -519,6 +522,11 @@ class Acc_Ledger_Search
             $fil_paid=$and.SQL_LIST_UNPAID_INVOICE;
             $and=" and ";
         }
+        if ( isset ($hide_operation) && trim($hide_operation) !="")
+        {
+            $fil_hide_operation=$and.sprintf( ' jr_id not in 
(%s)',sql_string($hide_operation));
+            $and=" and ";
+        }
         global $g_user;
         if ($g_user->admin==0&&$g_user->is_local_admin()==0 && 
$g_user->get_status_security_ledger()==1 )
         {
@@ -528,7 +536,8 @@ class Acc_Ledger_Search
                     " uj_login='".sql_string($_SESSION['g_user'])."'".
                     " and uj_priv in ('R','W'))";
         }
-        
$where=$fil_ledger.$fil_amount.$fil_date.$fil_desc.$fil_sec.$fil_amount.$fil_qcode.$fil_paid.$fil_account.$fil_date_paid;
+        
$where=$fil_ledger.$fil_amount.$fil_date.$fil_desc.$fil_sec.$fil_amount.
+            
$fil_qcode.$fil_paid.$fil_account.$fil_date_paid.$fil_hide_operation;
         $sql.=" where ".$where;
         return array($sql, $where);
     }
@@ -558,6 +567,7 @@ class Acc_Ledger_Search
 
         $r.=HtmlInput::hidden('ac', $_REQUEST['ac']);
 
+
         /*  when called from commercial.php some hidden values are needed */
         if (isset($_REQUEST['sa']))
             $r.=HtmlInput::hidden("sa", $_REQUEST['sa']);
@@ -568,6 +578,9 @@ class Acc_Ledger_Search
         if (isset($_REQUEST['f_id']))
             $r.=HtmlInput::hidden("f_id", $_REQUEST['f_id']);
 
+
+
+
         $r.='</FORM>';
 
         $r.='</div>';
diff --git a/include/lib/iconcerned.class.php b/include/lib/iconcerned.class.php
index c296804..d43fa3e 100644
--- a/include/lib/iconcerned.class.php
+++ b/include/lib/iconcerned.class.php
@@ -28,6 +28,7 @@
 require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
 class IConcerned extends HtmlInput
 {
+    private $hideOperation; //!< string of j_id to hide, separated by comma to 
avoid to reconcile an operation with itself
 
        public function __construct($p_name='',$p_value='',$p_id="")
        {
@@ -36,8 +37,9 @@ class IConcerned extends HtmlInput
                $this->amount_id=null;
                $this->paid='';
                $this->id=$p_id;
-                $this->tiers=""; // id of the field for the tiers to be updated
-                $this->div=""; // Dom Element to show the search result
+        $this->tiers=""; // id of the field for the tiers to be updated
+        $this->div=""; // Dom Element to show the search result
+        $this->hideOperation=""; // string of j_id to hide, separated by comma 
to avoid to reconcile an operation with itself
        }
     /*!\brief show the html  input of the widget*/
     public function input($p_name=null,$p_value=null)
@@ -55,17 +57,27 @@ class IConcerned extends HtmlInput
                     $this->tiers  );
         $r=Icon_Action::icon_magnifier(uniqid(), $javascript);
         $r.=sprintf("
-                   <INPUT TYPE=\"text\"  
style=\"color:black;background:lightyellow;border:solid 1px grey;\"  
NAME=\"%s\" ID=\"%s\" VALUE=\"%s\" SIZE=\"8\" readonly>
+                   <INPUT TYPE=\"text\"  
style=\"color:black;background:lightyellow;border:solid 1px grey;\"  
NAME=\"%s\" ID=\"%s\" VALUE=\"%s\" SIZE=\"8\" hide_operation=\"%s\" readonly>
                                   <INPUT class=\"smallbutton\"  
TYPE=\"button\" onClick=\"$('%s').value=''\" value=\"X\">
 
                    ",
                    $this->name,
                    $this->id,
                    $this->value,
+                   $this->hideOperation,
                    $this->id
                   );
         return $r;
     }
+
+    /**
+     * setter
+     * @param $p_string
+     */
+    function set_hideOperation($p_string)
+    {
+        $this->hideOperation=strip_tags($p_string);
+    }
     /*!\brief print in html the readonly value of the widget*/
     public function display()
     {
diff --git a/include/template/ledger_detail_bottom.php 
b/include/template/ledger_detail_bottom.php
index 15e95af..5484eaf 100644
--- a/include/template/ledger_detail_bottom.php
+++ b/include/template/ledger_detail_bottom.php
@@ -26,9 +26,9 @@ $aRap=$oRap->get();
  // find out exercice
  $periode_id=new Periode($cn,$detail->det->jr_tech_per);
  $exercice=$periode_id->get_exercice();
- 
- 
- $nb_document=($detail->det->jr_pj_name != "")?1:0;
+
+
+$nb_document=($detail->det->jr_pj_name != "")?1:0;
 
 $nb_aRap=(is_array($aRap))?count($aRap):0;
 // Array of tab
@@ -225,6 +225,7 @@ if ( $access=='W') {
      $wConcerned=new IConcerned("rapt".$div);
      $wConcerned->amount_id=$obj->det->jr_montant;
      $wConcerned->div="search_reconcile";
+     $wConcerned->set_hideOperation( $obj->jr_id);
     echo $wConcerned->input();
 
 }



reply via email to

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