New #0001983: CA - permettre désactivation poste

This commit is contained in:
sparkyx 2021-06-14 13:43:37 +02:00
parent ec83bf69e2
commit 5593b786f1
5 changed files with 26 additions and 4 deletions

View file

@ -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")]
));
}
/**

View file

@ -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

View file

@ -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--');

View file

@ -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'
);

View file

@ -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 ;