noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 20/46: New #0001983: CA - permettre désactiva


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 20/46: New #0001983: CA - permettre désactivation poste
Date: Tue, 13 Jul 2021 05:01:54 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 5593b786f16d4afee4f3fc9895de0377e054fab5
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon Jun 14 13:43:37 2021 +0200

    New #0001983: CA - permettre désactivation poste
---
 include/class/anc_account_table.class.php       |  5 +++++
 include/class/anc_operation.class.php           |  7 ++++---
 include/constant.php                            |  2 +-
 include/database/poste_analytique_sql.class.php |  2 ++
 include/sql/patch/upgrade161.sql                | 14 ++++++++++++++
 5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/include/class/anc_account_table.class.php 
b/include/class/anc_account_table.class.php
index 08ad0c3..3e816e6 100644
--- a/include/class/anc_account_table.class.php
+++ b/include/class/anc_account_table.class.php
@@ -48,6 +48,7 @@ class Anc_Account_Table extends Manage_Table_SQL
         $this->set_col_label("po_name", _("Label"));
         $this->set_col_label("po_description", _("Description"));
         $this->set_col_label("ga_id", _("Groupe"));
+        $this->set_col_label("po_state", _("Etat"));
         $this->set_col_type("ga_id", "select");
         $this->set_object_name("anc_accounting");
         $this->set_col_sort(1);
@@ -56,6 +57,10 @@ class Anc_Account_Table extends Manage_Table_SQL
             where
             pa_id=$1
             order by 2",0,array($p_table->pa_id));
+        $this->set_col_type("po_state","select",array(
+                                            [ 
"value"=>"0",'label'=>_("Inactif")],
+                                            [ "value"=>"1","label"=>_("Actif")]
+                                ));
         
     }
     /**
diff --git a/include/class/anc_operation.class.php 
b/include/class/anc_operation.class.php
index ea365db..505b393 100644
--- a/include/class/anc_operation.class.php
+++ b/include/class/anc_operation.class.php
@@ -584,12 +584,13 @@ class Anc_Operation
 
             foreach ($a_plan as $r_plan)
             {
-
+                
$existing=(isset($hplan[$p_seq][$count]))?$hplan[$p_seq][$count]:-1;
                 $array=$this->db->make_array(
                            "select po_id as value,".
                            " html_quote(po_name) as label from 
poste_analytique ".
-                           " where pa_id = ".$r_plan['id'].
-                           " order by po_name",$p_null);
+                           " where pa_id = $1 ".
+                           " and ( po_state = 1 or po_id = $2) ".
+                           " order by 
po_name",$p_null,[$r_plan['id'],$existing]);
                 $select =new ISelect("hplan[".$p_seq."][]",$array);
                 $select->table=0;
                 // view only or editables
diff --git a/include/constant.php b/include/constant.php
index 3d6ed3e..4a3d4ba 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -116,7 +116,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
 if ( ! defined ("SYSINFO_DISPLAY")) {
     define ("SYSINFO_DISPLAY",TRUE);
 }
-define ("DBVERSION",161);
+define ("DBVERSION",162);
 define ("MONO_DATABASE",25);
 define ("DBVERSIONREPO",20);
 define ('NOTFOUND','--not found--');
diff --git a/include/database/poste_analytique_sql.class.php 
b/include/database/poste_analytique_sql.class.php
index d3d883e..e5f044c 100644
--- a/include/database/poste_analytique_sql.class.php
+++ b/include/database/poste_analytique_sql.class.php
@@ -49,6 +49,7 @@ class Poste_analytique_SQL extends Table_Data_SQL
             , "po_amount"=>"po_amount"
             , "po_description"=>"po_description"
             , "ga_id"=>"ga_id"
+            , 'po_state'=>'po_state'
         );
         /*
          * Type of columns
@@ -60,6 +61,7 @@ class Poste_analytique_SQL extends Table_Data_SQL
             , "po_amount"=>"numeric"
             , "po_description"=>"text"
             , "ga_id"=>"text"
+            , 'po_state'=>'numeric'
         );
 
 
diff --git a/include/sql/patch/upgrade161.sql b/include/sql/patch/upgrade161.sql
new file mode 100644
index 0000000..18af03e
--- /dev/null
+++ b/include/sql/patch/upgrade161.sql
@@ -0,0 +1,14 @@
+begin;
+
+alter table poste_analytique  add po_state integer;
+
+alter table poste_analytique alter po_state set default   1;
+
+update poste_analytique  set po_state=1;
+
+alter table poste_analytique alter po_state set not null;
+
+comment  on column poste_analytique.po_state is 'Analytic Account state : 0 
disabled 0 enabled ';
+
+insert into version (val,v_description) values (162,'Analytic accountancy : 
enable or disable #1983');
+commit ;
\ No newline at end of file



reply via email to

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