26require_once NOALYSS_INCLUDE.
"/database/tmp_pcmn_sql.class.php";
38 $this->
table =
"accounting_card";
39 $this->primary_key =
"id";
40 $this->limit_fiche_qcode=0;
44 "parent_accounting"=>
"parent_accounting",
46 "pcm_type"=>
"pcm_type",
47 "fiche_qcode"=>
"fiche_qcode",
48 "pcm_direct_use"=>
"pcm_direct_use"
54 "parent_accounting" =>
"text",
57 "fiche_qcode"=>
"string",
58 "pcm_direct_use"=>
"text"
61 $this->
default = array(
68 pcm_val_parent as parent_accounting,
72 (select string_agg(m.fiche_qcode,' , ')
73 from (select a.ad_value as fiche_qcode
74 from fiche_detail as a
75 join fiche_detail as b on (a.ad_id=23 and a.f_id=b.f_id and b.ad_id=5)
76 where b.ad_value=pcm_val::text order by a.ad_value %s)as m) as fiche_qcode
80 parent::__construct($p_cn,
$p_id);
85 throw new Exception(
"not implemented");
88 public function delete()
91 if ( $this->
cn->get_value(
"select count(*) from jrnx where j_poste=$1",[
$obj->pcm_val]) > 0)
93 throw new Exception(_(
"Impossible d'effacer : ce poste est utilisé"));
95 if ( $this->
cn->get_value(
"select count(*) from tmp_pcmn where pcm_val_parent=$1",[
$obj->pcm_val]) > 0)
97 throw new Exception(_(
"Impossible d'effacer : ce poste est utilisé"));
99 return $obj->delete();
106 return $obj->exist();
112 $obj->set(
"pcm_val",$this->pcm_val);
113 $obj->set(
"pcm_lib",$this->pcm_lib);
114 $obj->set(
"pcm_type",$this->pcm_type);
115 $obj->set(
"pcm_val_parent",$this->parent_accounting);
116 $obj->set(
"pcm_direct_use",$this->pcm_direct_use);
132 $sql=sprintf($this->sql,
" ");
134 $result=$this->
cn->get_array(
$sql.
" where id=$1",array ($this->$pk));
135 if ($this->
cn->count()==0)
155 $sql=sprintf($this->sql,
" ");
164 $obj->set(
"pcm_val",$this->pcm_val);
165 $obj->set(
"pcm_lib",$this->pcm_lib);
166 $obj->set(
"pcm_type",$this->pcm_type);
167 $obj->set(
"pcm_val_parent",$this->parent_accounting);
168 $obj->set(
"pcm_direct_use",$this->pcm_direct_use);
this class is above tmp_pcmn_sql and is a view of tmp_pcmn
load()
Load the current row return false if not found.
set_limit_fiche_qcode($limit_fiche_qcode)
__construct($p_cn, $p_id=-1)
count($p_where="", $p_array=null)
exist()
Count the number of record with the id ,.
seek($cond='', $p_array=null)
retrieve array of object thanks a condition
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
$primary_key
Array of logical and real name.
ORM abstract of the table public.tmp_pcmn.