[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
- [Noalyss-commit] [noalyss] 06/46: Move function to the noalyss_script.js, (continued)
- [Noalyss-commit] [noalyss] 06/46: Move function to the noalyss_script.js, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 10/46: remove direct access to superglobal, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 02/46: File cleaning, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 07/46: ocument : add phpunit test, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 11/46: protect SQL, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 16/46: Improve email sent : check if file attached, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 15/46: Task #0001417: Reconnexion souple connect, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 09/46: Add waiting_box, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 17/46: Task #0001595: CA - liste d'opérations - pas de choix de l'execice., Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 19/46: clean code : remove useless comment, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 20/46: New #0001983: CA - permettre désactivation poste,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 18/46: Bug: possible to set an empy name for an Analytic plan, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 21/46: Bug #0002011: Encodage opération – Verrouillage nombre de lignes si non vides, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 23/46: Task #0002014: Comptabilité analytique = export des pièces des opérations rapprochées, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 27/46: Task #0002014: Comptabilité analytique ordre par date Database_Core setter/getter for sql, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 24/46: Task #0001974: Duplication d'opération – Inclure l'intitulé, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 33/46: If database connx failed then reload the form, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 12/46: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 22/46: Cosmetic, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 26/46: Typo menu, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 28/46: Task #0002015: Export CSV depuis ANCGL : ajout de colonnes, Dany De Bontridder, 2021/07/13